# iircomb (Digital Filter Design Toolkit, MathScript Function)

Owning Class: singlerate

## Syntax

[b, a] = iircomb(n, bw)

[b, a] = iircomb(n, bw, ab)

[b, a] = iircomb(n, bw, t)

[b, a] = iircomb(n, bw, ab, t)

## Description

Designs an infinite impulse response (IIR) comb filter.

Examples

## Inputs

Name Description
n Specifies the order of the filter. n is a positive integer.
bw Specifies the bandwidth of the filter notch or peak at -ab dB. bw is a double-precision, floating-point number that must fall in the range (0, 2/n).
ab Specifies the attenuation, in decibels, that corresponds to the bandwidth bw. ab is a double-precision, floating-point number greater than zero. The default is 3.0103, which corresponds to a 3 dB bandwidth, a commonly used bandwidth for a filter.
t Specifies the type of IIR comb filter you want to design. t is a string that accepts the following values:

 'notch' (default) Designs a comb notch filter. 'peak' Designs a comb peak filter.

## Outputs

 Name Description b Returns the numerator of the designed IIR filter. b is a real vector with a length of n+1. a Returns the denominator of the designed IIR filter. a is a real vector with a length of n+1.

## Examples

[b, a] = iircomb(10, 0.001, 3.0103);
fft_mag = abs(fft(b, 16384)./fft(a, 16384));
figure;
plot(0:1/8192:1, fft_mag(1:8193));

[b, a] = iircomb(10, 0.001, 3.0103, 'peak');
fft_mag = abs(fft(b, 16384)./fft(a, 16384));
figure;
plot(0:1/8192:1, fft_mag(1:8193));