[SciPy-User] Convolution of sinus signal and rectangular pulse

Abdu Adil kasoft1010 at gmail.com
Tue Feb 28 23:31:43 EST 2012


I would like to perform the operation of convolution of sinus signal and
rectangular pulse, in scipy, I convolved sinus signal with cosinus signal
and ploted that on the graph,
but I would like to know how to create array with rectangular pulse,
something similar to this matlab expression
y = rectpulse(x,nsamp), so I can convolve them, i use this to create my
sinus and cosinus signal

x=r_[0:50] (my array)
y01=sin(2*pi*x/49)
y02=cos(2*pi*x/49)

So i tried to create a nu.zeros(50), and manually changing the zeros from
position 15-25 from 0.0. to 0.9 so it looks like rectangle but convolution
on sinus array and this 'rectangle' array is weird,
It is supposed to be zero when there is no intersection but i get sinus
signal in return, here is the code http://tinypaste.com/4791061a

I apologize in advance, i feel like this is the easiest thing but I could
not find any reference on how to create a rectangular pulse, Im doing
computer science and I just started this course
signals and systems and Im a bit lame i know :D.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20120229/4d5450ef/attachment.html>


More information about the SciPy-User mailing list