Documentation |
Average filter delay (group delay)
[gd,w] = grpdelay(b,a)
[gd,w] = grpdelay(b,a,n)
[gd,w] = grpdelay(sos,n)
[gd,w] = grpdelay(d,n)
[gd,f] = grpdelay(...,n,fs)
[gd,w] = grpdelay(...,n,'whole')
[gd,f] = grpdelay(...,n,'whole',fs)
gd = grpdelay(...,w)
gd = grpdelay(...,f,fs)
grpdelay(...)
[gd,w] = grpdelay(b,a) returns the group delay response, gd, of the discrete-time filter specified by the input vectors, b and a. The input vectors are the coefficients for the numerator, b, and denominator, a, polynomials in z^{-1}. The Z-transform of the discrete-time filter is
$$H(z)=\frac{B(z)}{A(z)}=\frac{{\displaystyle \sum _{l=0}^{N-1}b}(n+1){z}^{-l}}{{\displaystyle \sum _{l=0}^{M-1}a}(l+1){z}^{-l}},$$
The filter's group delay response is evaluated at 512 equally spaced points in the interval [0,π) on the unit circle. The evaluation points on the unit circle are returned in w.
[gd,w] = grpdelay(b,a,n) returns the group delay response of the discrete-time filter evaluated at n equally spaced points on the unit circle in the interval [0,π). n is a positive integer. For best results, set n to a value greater than the filter order.
[gd,w] = grpdelay(sos,n) returns the group delay 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, grpdelay considers the input to be the numerator vector, b. Each row of sos corresponds to the coefficients of a second-order (biquad) filter. The ith row of the sos matrix corresponds to [bi(1) bi(2) bi(3) ai(1) ai(2) ai(3)].
[gd,w] = grpdelay(d,n) returns the group delay response for the digital filter, d. Use designfilt to generate d based on frequency-response specifications.
[gd,f] = grpdelay(...,n,fs) specifies a positive sampling frequency fs in hertz. It returns a length-n vector, f, containing the frequency points in hertz at which the group delay response is evaluated. f contains n points between 0 and fs/2.
[gd,w] = grpdelay(...,n,'whole') and [gd,f] = grpdelay(...,n,'whole',fs) use n points around the whole unit circle (from 0 to 2π, or from 0 to fs).
gd = grpdelay(...,w) and gd = grpdelay(...,f,fs) return the group delay response evaluated at the angular frequencies in w (in radians/sample) or in f (in cycles/unit time), respectively, where fs is the sampling frequency. w and f are vectors with at least two elements.
grpdelay(...) with no output arguments plots the group delay response versus frequency.
grpdelay works for both real and complex filters.
cceps | designfilt | digitalFilter | fft | freqz | fvtool | hilbert | icceps | phasedelay | rceps