Convolution of different sized arrays

O

Olenka Subota

Hello all,

I need your help. I have to simulate a filter whose transfer function
is a step fct, and I wrote it as a column-vector of Ns elements :
h=ones(3,dtype=float)
print h [ 1. 1. 1.]
h=reshape(h,(3,1))
h
array([[ 1.],
[ 1.],
[ 1.]])

In this case Ns=3 for simplicity.
The input of my filter is another column-vector of k*Ns elements
(3*3):
x0_vect
array([[ 1.41421356],
[ 0. ],
[ 0. ],
[ 1.41421356],
[ 0. ],
[ 0. ],
[ 1.41421356],
[ 0. ],
[ 0. ]])
So I`d like to convolve the two column vectors. Am I going to obtain a
row-vector?
I`ve tried to apply the convolve built-in function but it gives me
this error:
convolve(x0_vect,h)

Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
convolve(x0_vect,h)
File "C:\Python27\lib\site-packages\numpy\core\numeric.py", line
787, in convolve
return multiarray.correlate(a, v[::-1], mode)
ValueError: object too deep for desired array

If anyone of you can help, please do it..
Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top