# iirlpnorm (Digital Filter Design Toolkit, MathScript Function)

Owning Class: singlerate

## Syntax

[b, a] = iirlpnorm(n, d, f, e, mag)

[b, a] = iirlpnorm(n, d, f, e, mag, w)

[b, a] = iirlpnorm(n, d, f, e, mag, w, p)

## Description

Designs an infinite impulse response (IIR) filter that uses the least p-th norm algorithm to approximate the frequency response you specify.

Examples

## Inputs

 Name Description n Specifies the order of the numerator. n is a nonnegative integer. d Specifies the order of the denominator. d is a nonnegative integer. f Specifies the frequency points. f is a vector whose values increase monotonically between 0 and 1. e Specifies the band edge frequencies. e is a vector whose values must also exist in f. mag Specifies the magnitude response of the filter at f. mag is a vector of the same length as f. w Specifies the weight of each frequency point. w is a vector of the same length as f. The default is a vector in which each element has a value of 1. p Specifies the value of p to use in the least p-th norm algorithm. p is a positive integer that must fall in the range [1, 128]. The default is 128.

## 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 d+1.

## Examples

[b, a] = iirlpnorm(8, 8, [0, 0.2, 0.5, 0.6, 1], [0, 0.5, 0.6, 1], [1, 2, 1, 0, 0]);fft_mag = abs(fft(b, 16384)./fft(a, 16384));
figure;
plot(0:1/8192:1, fft_mag(1:8193));

[b, a] = iirlpnorm(6, 6, [0, 0.5, 0.6, 1], [0, 0.5, 0.6, 1], [1, 1, 0, 0], [1, 1, 1, 1], 12);
figure;
freqz(b, a);
figure;
zplane(b, a);