Check impulse responses are inverses using convolution

9 次查看(过去 30 天)
I have written the following code to check that h1[n] and g[n] are inverses of each other by generating an impulse when I convolute them. However, I'm not currently getting an impulse.
The original transfer function is H(z) = (1-2.5*z^(-1)+z^(-2))/(1-z^(-1)+0.7z^(-2));
function part2b
n=-20:0;
g1 = -1.8*(2).^(n-1);
n=1:20;
g2=-0.3*(0.5).^(n-1);
g=[g1 g2];
g(21)=g(21)+1;
n=0:20;
h1 = 0.82*exp(1i*2.72)*(0.84*exp(1i*0.93)).^(n-1) + 0.82*exp(1i*-2.72)*(0.84*exp(1i*-0.93)).^(n-1);
h1(1)=h1(1)+1;
y=conv(h1,g);
x = -20:40;
stem(x,y)

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Signal Generation, Analysis, and Preprocessing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by