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

2 visualizzazioni (ultimi 30 giorni)
% 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

Risposte (1)

Ahmet Cecen
Ahmet Cecen il 14 Dic 2016
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