I need to plot a phase response using freqz function. Can you please help with it.
显示 更早的评论
system was given h[n]
I obtained the frequency response and the phase below. when i plotted it did not look right.
Can please help me to plot it using the freqz command.
angle(H(e^jw)= tan ^-1(sin(w)-2*sin(w)+4*sin(3*w)-4*sin(5*w)+3sin(6*w)-2*sin(7*w)+sin(8*w))/(1-2*cos(w)+3*cos(2*w)-4*cos(3*w)+4*cos(5*w)-3*cos(6*w)+2*cos(7*w)-8*cos(8*w)
回答(1 个)
Geetla Sindhu
2022-10-6
编辑:Geetla Sindhu
2022-10-6
Hello Gerald,
I understand that you are trying to plot the phase of the frequency response of the system using “freqz” command.
You can try the following workaround to solve the issue:
- If the system transfer function is given in the form of

Use
[H,w] = freqz(B,A,n,fs)
where, B = [b(1) b(2) … b(M)]
A = [a(1) a(2) … a(N)]
fs = Sampling rate
Please refer to Frequency response of digital filter - MATLAB freqz(mathworks.com) for further information regarding "freqz" command.
- In order to get the phase response of the system in degrees, use
plot(w,angle(H)*360/(2*pi))
You can also refer to the example below for reference:
Thank you.
类别
在 帮助中心 和 File Exchange 中查找有关 Filter Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!