Phase response of digital filter
[phi,w] = phasez(b,a,n)
[phi,w] = phasez(sos,n)
[phi,w] = phasez(...,n,'whole')
phi = phasez(...,w)
[phi,f] = phasez(...,n,fs)
phi = phasez(...f,fs)
[phi,w,s] = phasez(...)
[phi,w] = phasez(b,a,n) returns the n-point unwrapped phase response vector, phi, in radians and frequency vector, w, in radians/sample for the filter coefficients specified in b and a. The values of the frequency vector, w, range from 0 to pi. If n is omitted, the length of the phase response vector defaults to 512.
[phi,w] = phasez(sos,n) returns the unwrapped phase response for the second order sections matrix, sos. sos is a K-by-6 matrix, where the number of sections, K, must be greater than or equal to 2. If the number of sections is less than 2, phasez considers the input to be the numerator vector, b. Each row of sos corresponds to the coefficients of a second order (biquad) filter. The i-th row of the sos matrix corresponds to [bi(1) bi(2) bi(3) ai(1) ai(2) ai(3)].
[phi,w]=phasez(Hd,n) returns the unwrapped phase response for the dfilt filter object, Hd, or the array of dfilt filter objects. If Hd is an array of dfilt objects, each column of phi is the group delay of the corresponding dfilt object. If n is unspecified for discrete-time filter objects, the length of the phase response vector defaults to 8192.
phi = phasez(...,w) returns the unwrapped phase response in radians at frequencies specified in w (radians/sample). The frequencies are normally between 0 and pi.The vector w must have at least two elements.
[phi,f] = phasez(...,n,fs) return the unwrapped phase vector phi in radians and the frequency vector in Hz. The frequency vector ranges from 0 to the Nyquist frequency, fs/2. If the 'whole' option is used, the frequency vector ranges from 0 to the sampling frequency.
phasez(...) with no output arguments plots the phase response of the filter. If you input the filter coefficients or second order sections matrix, the current figure window is used. If you input a discrete-time filter object or array of filter objects, fvtool is used to plot the phase response.
Plot the phase response of a constrained least squares FIR filter:
In the next example, we design an equiripple lowpass default filter object and display the result:
d=fdesign.lowpass; Hd=design(d,'equiripple'); phasez(Hd)
Plot the phase response of an elliptic filter:
d=fdesign.lowpass('Fp,Fst,Ap,Ast',0.4,0.5,1,60); Hd=design(d,'ellip'); phasez(Hd)