Check impulse responses are inverses using convolution

9 vues (au cours des 30 derniers jours)
Ian Downie
Ian Downie le 26 Oct 2018
Modifié(e) : Ian Downie le 26 Oct 2018
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)

Réponses (0)

Catégories

En savoir plus sur Signal Generation, Analysis, and Preprocessing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by