Zero-phase response of digital filter
[Hr,w] = zerophase(sos)
[Hr,w] = zerophase(Hd)
[Hr,w] = zerophase(...,nfft,'whole')
[Hr,f] = zerophase(...,f,fs)
[Hr,w,phi] = zerophase(...)
[Hr,w] = zerophase(b,a) returns the zero-phase response Hr, and the frequency vector w (in radians/sample) at which Hr is computed, given a filter defined by numerator b and denominator a. For FIR filters where a=1, you can omit the value a from the command. The zero-phase response is evaluated at 512 equally spaced points on the upper half of the unit circle.
The zero-phase response, H(ω), is related to the frequency response, H(ω) by
where H(ejω) is the frequency response, Hr(ω) is the zero-phase response and φ(ω) is the continuous phase.
Note The zero-phase response is always real, but it is not the equivalent of the magnitude response. The former can be negative while the latter cannot be negative.
[Hr,w] = zerophase(sos) returns the zero-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, zerophase 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)].
[Hr,w] = zerophase(Hd) returns the zero-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 Hr is the zero-phase response of the corresponding dfilt object.
[Hr,f] = zerophase(...,f,fs) returns the zero-phase response Hr and frequency vector f (Hz), using the sampling frequency fs (in Hz), to determine the frequency vector f (in Hz) at which Hr is computed. The vector f must have at least two elements.
[Hr,w,phi] = zerophase(...) returns the zero-phase response Hr, frequency vector w (rad/sample), and the continuous phase component, phi. (Note that this quantity is not equivalent to the phase response of the filter when the zero-phase response is negative.)
zerophase(...) plots the zero-phase response versus frequency. The plot is displayed in the current figure window. If the input is the numerator and denominator coefficients, a second order sections matrix, or a single dfilt object, the zero–phase response of the single filter is displayed. If the input is an array of dfilt objects, the zero–phase responses of all filters in the array are displayed.
Plot the zero-phase response of a constrained least squares FIR filter:
Plot the zero-phase response of an elliptic filter: