how can I write the time function when I am plotting the convolution of two time continuous signals?

1 次查看(过去 30 天)
% assume I have two signals to find and plot their convolution:
s=conv(x,h);
% t= ??
plot(t,s)
% I have error in length, "they should be the same length" is shown as error

回答(1 个)

Ahmet Cecen
Ahmet Cecen 2016-12-14
This question shows a lack of fundamental understanding of convolution. Make sure to read up on what convolution/correlation is and work out a graphical example.
The output of a convolution has a natural origin, and the length of `s` represents time/space lags. So the center element of `s` will be t=0, or when both `x` and `h` are in sync. One element below the center will represent a lag of 1 units of t, or when there is a 1 unit delay between signals `x` and `h`.
Using the above information, you should be able to figure out what the length of the vector `s` means, and how to create a new `t` vector that corresponds to `s`.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by