# grpdelay (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info Download Help (Windows Only)

Owning Class: filter design

Requires: MathScript RT Module

## Syntax

grpdelay(b)

grpdelay(b, a)

grpdelay(b, a, n)

grpdelay(b, a, n, 'whole')

grpdelay(b, a, n, f)

grpdelay(b, a, n, 'whole', f)

grpdelay(b, a, w)

grpdelay(b, a, w, f)

gd = grpdelay(b, a)

gd = grpdelay(b, a, n)

gd = grpdelay(b, a, n, 'whole')

gd = grpdelay(b, a, n, f)

gd = grpdelay(b, a, n, 'whole', f)

gd = grpdelay(b, a, w)

gd = grpdelay(b, a, w, f)

[gd, fr] = grpdelay(b)

[gd, fr] = grpdelay(b, a)

[gd, fr] = grpdelay(b, a, n)

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

[gd, fr] = grpdelay(b, a, n, f)

[gd, fr] = grpdelay(b, a, n, 'whole', f)

[gd, fr] = grpdelay(b, a, w)

[gd, fr] = grpdelay(b, a, w, f)

## Description

Computes the group delay of a filter. If you do not request an output, this function plots the group delay in the current plot window. grpdelay(b) is equivalent to grpdelay(b, , 512). grpdelay(b, a) is equivalent to grpdelay(b, a, 512).

Examples

## Inputs

Name Description
b Specifies the forward filter coefficients. b is a real vector.
a Specifies the backward filter coefficients. a is a real vector. The default is .
n Specifies the number of frequencies to use. n is a nonnegative integer. The default is 512.
w Specifies predefined frequencies. If you do not specify w, LabVIEW evaluates the frequency response at n points equally spaced around the upper half of the unit circle. w is a vector.
f Specifies the sampling frequency. f is a scalar.
'whole' Indicates that you want to use the whole unit circle.

## Outputs

Name Description
gd Returns the group delay of the filter defined by a and b. gd is a real vector.
fr Returns the corresponding frequencies of the filter. fr is a real vector.

## Details

The following table lists the support characteristics of this function.

 Supported in the LabVIEW Run-Time Engine Yes (if you request output) Supported on RT targets Yes (if you request output) Suitable for bounded execution times on RT Not characterized

## Examples

W = 0:0.01:0.5;
A = ;
B = [1, 4, 1, 6];
GD = grpdelay(B, A, W)

b = [2, 3, 7, 1];
a = [1, 7, 3, 10];
n = 250;
f = 20;
[GD, FR] = grpdelay(b, a, n, 'whole', f)