필터 지우기
필터 지우기

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

조회 수: 12 (최근 30일)
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");

답변 (2개)

Walter Roberson
Walter Roberson 2023년 1월 19일
편집: Walter Roberson 2023년 1월 19일
the function accepts 1 argument or 3 arguments but not two arguments.

Paul
Paul 2023년 1월 19일
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.

카테고리

Help CenterFile Exchange에서 Matched Filter and Ambiguity Function에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by