Documentation Center 
Filter group delay
[gd,w]=grpdelay(hfilt)
[gd,w]=grpdelay(hfilt,n)
grpdelay(hfilt)
[gd,w]
= grpdelay(hs)
[gd,w]
= grpdelay(hs,n)
[gd,w] =
grpdelay(hs,Name,Value)
grpdelay(hs)
grpdelay returns the group delay based on the current filter coefficients. This section describes common grpdelay operation with adaptive filters, discretetime filters, multirate filters, and filter System objects. For more input options, refer to grpdelay in Signal Processing Toolbox™ documentation.
[gd,w]=grpdelay(hfilt) returns the group delay, which is the derivative of the phase response phi of the filter hfilt, and the corresponding frequencies w at which the function evaluates the group delay. Group delay is
The group delay is evaluated at 8192 points equally spaced around the upper half of the unit circle.
[gd,w]=grpdelay(hfilt,n) returns the group delay gd of the filter hfilt and the corresponding frequencies w at which the function evaluates the group delay. The group delay is evaluated at n points equally spaced around the upper half of the unit circle.
grpdelay(hfilt) displays the group delay of hfilt in the Filter Visualization Tool (FVTool).
[gd,w] = grpdelay(hs) returns the group delay for the filter System object™ hs using 8192 samples.
[gd,w] = grpdelay(hs,n) returns the group delay for the filter System object hs using n samples.
[gd,w] = grpdelay(hs,Name,Value) returns the group delay with additional options specified by one or more Name,Value pair arguments.
grpdelay(hs) uses FVTool to plot the group delay of the filter System object hs.
hfilt 
hfilt is either:

hs 
Filter System object. The following Filter System objects are supported by this analysis function: 
n 
Number of samples. For an FIR filter where n is a power of two, the computation is done faster using FFTs. Default: 8192 
Specify optional commaseparated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.
'Arithmetic' 
For filter System object inputs only, specify the arithmetic used during analysis. When you specify 'double' or 'single', the function performs double or singleprecision analysis. When you specify 'fixed' , the arithmetic changes depending on the setting of the CoefficientDataType property and whether the System object is locked or unlocked. Details for FixedPoint Arithmetic When you do not specify the arithmetic for nonCIC structures, the function uses doubleprecision arithmetic if the filter System object is in an unlocked state. If the System object is locked, the function performs analysis based on the locked input data type. CIC structures only support fixedpoint arithmetic. 
gd 
Complex, nelement groupdelay vector. If hfilt is a vector of filters, gd is a complex, length(hfilt)byn matrix of groupdelay vectors whose columns correspond to each filter in hfilt. If n is not specified, the function uses a default value of 8192. For adaptive filters, gd is the instantaneous group delay. 
w 
Frequency vector of length n, in radians/sample. w consists of n points equally spaced around the upper half of the unit circle (from 0 to π radians/sample). If hfilt is a vector of filters, w is a complex, length(hfilt)byn matrix of groupdelay vectors whose columns correspond to each filter in hfilt. If n is not specified, the function uses a default value of 8192. 