discrete convolution matrix

  • Follow


Hi all, 
I'm convolving a vector x with another vector h, both of length N. I need a matrix corresponding to convolution with h, not just conv(x,h), so I'm assembling the discrete convolution matrix A as follows

M = 2*N-1;
A = sparse(M,N);
for i=1:N
        A(i:min(M,i+N-1),i) = h(1:min(N,M-i+1));
end
%convolution would happen as y = A*x, but I just need A

However creating this matrix is very slow. Anyone have any tricks to creating A quickly? I can't think of any way to vectorize this any more
0
Reply Ross 11/5/2010 10:37:03 PM

Please see post #8 
http://www.mathworks.com/matlabcentral/newsreader/view_thread/292941

Bruno
0
Reply Bruno 11/5/2010 10:57:03 PM


1 Replies
413 Views

(page loaded in 0.063 seconds)

Similiar Articles:













7/23/2012 3:06:36 PM


Reply: