Convoluting two signals and correcting the time vector

4 ビュー (過去 30 日間)
Friðrik Hover
Friðrik Hover 2016 年 2 月 21 日
回答済み: Anish Mitra 2016 年 2 月 24 日
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?

回答 (1 件)

Anish Mitra
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));

カテゴリ

Help Center および File ExchangeSubplots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by