## Documentation Center |

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

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

`[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 *i*th
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

`[gd,w] = grpdelay(...,n,'whole')` and

`gd = grpdelay(...,w)` and

`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`

Was this topic helpful?