Convoluting two signals and correcting the time vector
5 ビュー (過去 30 日間)
古いコメントを表示
n = -10:10; h3 = gauspuls(n-6); x1 = [1 1 1 0 0 0 0 0 0 0 0] conv(h3,x1) % Convoluting these two signals should only shift the x1 signal 6 steps to the right but I get a vector with 31 numbers and the shift of x1 is 17 steps to the right. How can I correct this?
0 件のコメント
回答 (1 件)
Anish Mitra
2016 年 2 月 24 日
Since the pulse signal, 'h3', is generated with a time range of -10:10, the output actually starts from n = -10. Hence the shift of 17 is actually a shift of 6.
n = 0:10;
h3 = gauspuls(n-6);
x1 = [1 1 1 0 0 0 0 0 0 0 0];
y = conv(h3,x1);
figure;
subplot(3,1,1);
stem(n,x1);
subplot(3,1,2);
stem(n,h3);
subplot(3,1,3);
stem(n,y(1:11));
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Subplots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!