Signal Processing Toolbox    
grpdelay

Compute the average filter delay (group delay).

Syntax

Description

The group delay of a filter is a measure of the average delay of the filter as a function of frequency. It is the negative first derivative of the phase response of the filter. If the complex frequency response of a filter is , then the group delay is

where is frequency and is the phase angle of .

[gd,w] = grpdelay(b,a,n) returns the n-point group delay, , of the digital filter

given the numerator and denominator coefficients in vectors b and a. grpdelay returns both gd, the group delay, and w, a vector containing the n frequency points in radians. grpdelay evaluates the group delay at n points equally spaced around the upper half of the unit circle, so w contains n points between 0 and .

[gd,f] = grpdelay(b,a,n,fs) specifies a positive sampling frequency fs in hertz. It returns a length n vector f containing the actual frequency points at which the group delay is calculated, also in hertz. f contains n points between 0 and fs/2.

[gd,w] = grpdelay(b,a,n,'whole') and

[gd,f] = grpdelay(b,a,n,'whole',fs) use n points around the whole unit circle (from 0 to 2, or from 0 to fs).

gd = grpdelay(b,a,w) and

gd = grpdelay(b,a,f,fs) return the group delay evaluated at the points in w (in radians) or f (in hertz), respectively, where fs is the sampling frequency in hertz.

grpdelay with no output arguments plots the group delay versus frequency in the current figure window.

grpdelay works for both real and complex input systems.

Examples

Plot the group delay of Butterworth filter b(z)/a(z).

Plot both the group and phase delays of a system on the same graph.

Algorithm

grpdelay multiplies the filter coefficients by a unit ramp. After Fourier transformation, this process corresponds to differentiation.

See Also
cceps
Implement complex cepstral analysis.
fft
Compute the frequency one-dimensional fast Fourier transform.
freqz
Compute the frequency response of digital filters.
hilbert
Compute the Hilbert transform.
icceps
Compute the inverse complex cepstrum.
rceps
Real cepstrum and minimum phase reconstruction.


 gmonopuls hamming