Accelerating the pace of engineering and science

# grpdelay

Filter group delay

## Syntax

[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)

## Description

grpdelay returns the group delay based on the current filter coefficients. This section describes common grpdelay operation with adaptive filters, discrete-time 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

$-\frac{d}{dw}\left(angle\left(w\right)\right)$

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.

## Input Arguments

expand all

 hfilt hfilt is either: An adaptive adaptfilt, discrete-time dfilt, or multirate mfilt filter objectA vector of adaptive, discrete-time, or multirate filter objects 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

### Name-Value Pair Arguments

Specify optional comma-separated 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' — Value types:‘double' | 'single' | 'fixed'

For filter System object inputs only, specify the arithmetic used during analysis. When you specify 'double' or 'single', the function performs double- or single-precision 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.

When you do not specify the arithmetic for non-CIC structures, the function uses double-precision 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 fixed-point arithmetic.

## Output Arguments

 gd Complex, n-element group-delay vector. If hfilt is a vector of filters, gd is a complex, length(hfilt)-by-n matrix of group-delay 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)-by-n matrix of group-delay vectors whose columns correspond to each filter in hfilt. If n is not specified, the function uses a default value of 8192.