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");
댓글 수: 1
Walter Roberson
2023년 1월 19일
By the way, are those single rectangular pulses, or are they a repeated rectangular pulse chain ?
답변 (2개)
Walter Roberson
2023년 1월 19일
편집: Walter Roberson
2023년 1월 19일
the function accepts 1 argument or 3 arguments but not two arguments.
댓글 수: 0
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.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!