IIR Filter Design Issues : MATLAB I am designing an IIR Filter with the following designs constraints:


Passband $(0.75\pi,\pi)$
Stopband $(0,0.70\pi)$
No more than $0.5$ % ripple in the passband
No less than $40$ dB attenuation in the stopband


Using the designfilt command I am able to design the filter. 

However when I am using the following code for the "Butteworth" filter I do not get any Phase response. The magnitude response is fine, but the Phase values have NaN values - "Not a Number". The same codes are able to design for "Chebyshev" and "Elliptic" filters.

Wp = 0.75;
Ws = 0.7;
Rp = 20*log10(1.005);
Rs = 40;

[Nb, Wnb] = buttord(Wp, Ws, Rp, Rs); % Nb: minimum order; Wnb: cutoff frequency
[Zb, Pb, Kb] = butter(Nb, Wnb,'high'); % Zb : zeros ; Pb : Poles , Kb : gain

SOSb = zp2sos(Zb, Pb, Kb);

freqz(SOSb)


Response for Butterworth Filter



Response for Chebyshev I filter
This would appear to be a bug in the freqz implementation. I didn't dig enough to figure out why but even this doesn't work:

freqz(SOSb(1:2,:));


Even though angle(freqz(SOSb(1:2,:))) returns a legitimate result.

But I found this as a workaround:

[h,f,s]=freqz(SOSb);
freqzplot(h,f,s);


Unfortunately freqzplot is being obsoleted so you might have to resort to:

plot(angle(freqz(SOSb)));