Why am I unable to obtain a phase response plot using the FREQZ function?

Illustration
Aayushsingh - 2021-03-16T10:12:23+00:00
Question: Why am I unable to obtain a phase response plot using the FREQZ function?

I unable to obtain a phase response plot using the FREQZ function, but am able to get a phase  plot when using the FREQZPLOT  functionwith the same parameters. I would expect the plots to be the same using both functions. I use the following code to obtain the frequency response vector, but the phase response plot has nothing in it:     freqz(num,den,4096,Fs); When I try to the following command:     [h,f,s]=freqz(num,den,4096,Fs); freqzplot(h,f,s); I get a phase response plot. Note that my frequency response vector contains elements that have very small magnitudes.  

Expert Answer

Profile picture of Prashant Kumar Prashant Kumar answered . 2025-11-20

This bug has been fixed for Release 14 SP1 (R14SP1). For previous releases, please read below for any possible workarounds:
 
The reason you see this behavior is due to the frequency response vector "h" containing elements with extremely small magnitudes. The FREQZ function considers the magnitude to be extremely small if
 
 
 abs(h) <= eps^(2/3)

The elements with extremely small magnitudes are then set as having undefined phase. That is why you do not see a phase plot when you use the FREQZ function without any outputs using the following command:

 

freqz(num,den,4096,Fs);
If you still want to see the phase plot, even though the phase results might not be accurate due to the very small magnitudes, you can use the following code:
 
 
[h,f,s]=freqz(num,den,4096,Fs);

freqzplot(h1,f1,s);
However, be aware that the phase may not be accurate when the magnitudes are extremely small.

 


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!