help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Right function for Discrete Convolution


From: Quentin Spencer
Subject: Re: Right function for Discrete Convolution
Date: Tue, 08 Feb 2005 11:38:52 -0600
User-agent: Mozilla Thunderbird 0.9 (X11/20041127)

NZG wrote:

I need to convolve a 2 vector of discrete samples with a vector representing a unit sample response system. Looking at "conv" I see that it returns a vector of size greater than the original dimensions of the sample.
This doesn't seem to make sense, am I missing something?
I know this is a Matlab cloned function, but Matlab doesn't describe it well either. How can I convolve two sequences and get a resulting vector that I can plot against the original time vector?

thx,
NZG.
Convolution returns an output longer than its inputs by definition. If the input vectors are of length M and N respectively, the output will be length (M+N-1). In order to plot the input against the output of the filter, you can either truncate the output or put zeros at the end of the input to make them the same length. Also note that the "filter" function can be used to convolve two vectors, and the output is already truncated: filter(x,1,y) for a vector y of length N returns the first N values of conv(x,y).

Hope this helps.

Quentin



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]