Using Matlab perform the convolution of the following signals of different duration and energy

12 visualizaciones (últimos 30 días)
S1 is a rectangular pulse that has amplitude 1 width 1
S2 is a rectangular pulse that has amplitude 1 width 1.5
S3 is a rectangular pulse that has amplitude 1 width 3
I have been trying to figure out how to get the rectangularPulse function to work, but I keep getting errors telling me that I have an invalid number of arguments, please look over my script and tell me what needs to be corrected and how to do so, thank you.
t1 = 0:1;
s1 = rectangularPulse(t1, 1);
t2 = 0:1.5;
s2 = rectangularPulse(t2, 1);
t3 = 0:3;
s3 = rectangularPulse(t3, 1);
conv12 = conv(s1, s2);
conv13 = conv(s1, s3);
conv23 = conv(s2, s3);
figure;
subplot(3,1,1);
plot(conv12);
title("S1 * S2");
subplot(3,1,2);
plot(conv13);
title("S1 * S3");
subplot(3,1,3);
plot(conv23);
title("S2 * S3");

Respuestas (2)

Walter Roberson
Walter Roberson el 19 de En. de 2023
Editada: Walter Roberson el 19 de En. de 2023
the function accepts 1 argument or 3 arguments but not two arguments.

Paul
Paul el 19 de En. de 2023
Hi Ali,
Assuming S1, S2, and S3 are continuous-domain signals, I think it would be better to compute the convolution integral using int. Examples on this forum are easily found, including those that use rectangularPulse.

Categorías

Más información sobre Matched Filter and Ambiguity Function en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by