stem a convolve signal
이전 댓글 표시
% Define fs and time duration
fs = 10; % sample/second
duration = 1; % second
% Generate the time axis
t = 0:1/fs:duration-1/fs;
% the rectangular signal
x = ones(size(t));
% Plot the signal
subplot(2,1,1);
stem(t, x);
xlabel('Time (s)');
ylabel('Amplitude');
title('orignal Signal x[n]');
% Convolve the signal with itself
y = conv(x, x);
% Generate the time axis for the convolved signal
t_conv = 0:1/fs:2*duration-1/fs;
% Plot the convolved signal
subplot(2,1,2);
stem(t_conv, y);
xlabel('Time (s)');
ylabel('Amplitude');
title('Convolved Signal y[n]');
댓글 수: 3
Mohammed Alqahtany
2023년 11월 25일
Dyuman Joshi
2023년 11월 25일
The error is clear - The lengths of t_conv and y are not the same.
They should be the same.
Mohammed Alqahtany
2023년 11월 25일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
