how to see the frequency response of difference equation
24 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
moonman
el 15 de Dic. de 2011
Comentada: Mike Shane
el 27 de Jul. de 2023
Hi I am having the difference equation
y[n] = -0.9y[n-1] +x [n] -x [n-1]
I want to see its frequency response. What should i do
should i first convert it into Z-Form and then proceede Any ideas how to go abt it
Respuesta aceptada
Wayne King
el 15 de Dic. de 2011
You can do the following:
W = -pi:(2*pi)/8192:pi;
[H,W] = freqz([1 -1],[1 0.9],W);
plot(W,abs(H));
4 comentarios
Boom
el 7 de Ag. de 2016
How did you get [1 0.9]? Why 1? and why 0.9? I see the equation has a negative 0.9, but not positive 0.9. Thanks
Mike Shane
el 27 de Jul. de 2023
I hope by now you've figured it out, but for those who have the same question here is a simple explanation
y[n] = -0.9y[n-1] +x [n] -x [n-1] is the origianl expression
you have to put y terms on one side and x terms on one side, as below
y[n] + 0.9y[n-1] = x[n] -x[n-1]
now you can take the coefficients of y and x correctly, otherwise you are making a mistake while taking the coefficients
after that you'll get the below,
y has [1 0.9]
x has [1 -1]
Más respuestas (4)
Wayne King
el 15 de Dic. de 2011
Hi, here you go. If you want to visualize the magnitude:
fvtool([1 -1],[1 0.9]);
If you want the complex-valued response:
[H,W] = freqz([1 -1],[1 0.9]);
plot(W,abs(H));
2 comentarios
Wayne King
el 15 de Dic. de 2011
Hi, that's because your graphs are showing the frequency response over [-pi,pi). You can use the 'whole' option in freqz()
[H,W] = freqz([1 -1],[1 0.9],'whole');
plot(W,abs(H));
0 comentarios
moonman
el 15 de Dic. de 2011
4 comentarios
Wayne King
el 15 de Dic. de 2011
the book is wrong, the frequency response in magnitude should be 20 at pi radians/sample and -pi radians/sample
Ver también
Categorías
Más información sobre Digital Filter Analysis en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!