Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

designMultirateFIR

Multirate FIR filter design

Syntax

B = designMultirateFIR(L,M)
B = designMultirateFIR(L,M,P)
B = designMultirateFIR(L,M,P,Astop)

Description

example

B = designMultirateFIR(L,M) designs a multirate FIR filter with interpolation factor L and decimation factor M. The output B is the vector of designed FIR coefficients. To design a pure interpolator, set M to 1. To design a pure decimator, set L to 1.

example

B = designMultirateFIR(L,M,P) designs a multirate FIR filter with half-polyphase length P. By default, the half-polyphase length is 12.

example

B = designMultirateFIR(L,M,P,Astop) designs a multirate FIR filter with stopband attenuation Astop. By default, the stopband attenuation is 80 dB.

Examples

collapse all

To design an FIR Interpolator using the designMultirateFIR function, you must specify the interpolation factor of interest (usually greater than 1) and a decimation factor equal to 1. You can use the default half-polyphase length of 12 and the default stopband attenuation of 80 dB. Alternately, you can also specify the half-polyphase length and stopband attenuation values.

Design an FIR interpolator with interpolation factor set to 5. Use the default half-polyphase length of 12 and the default stopband attenuation of 80 dB.

b = designMultirateFIR(5,1);
fvtool(b,'impulse')

To design an FIR Decimator using the designMultirateFIR function, you must specify the decimation factor of interest (usually greater than 1) and an interpolation factor equal to 1. You can use the default half-polyphase length of 12 and the default stopband attenuation of 80 dB. Alternately, you can also specify the half-polyphase length and stopband attenuation values. Design an FIR decimator with decimation factor set to 3, and half-polyphase length set to 14. Use the default stopband attenuation of 80 dB.

b = designMultirateFIR(1,3,14);
fvtool(b,'impulse');

To design an FIR Rate Comverter using the designMultirateFIR function, you must specify an interpolation factor and decimation factor of interest (usually greater than 1). You can use the default half-polyphase length of 12 and the default stopband attenuation of 80 dB. Alternately, you can also specify the half-polyphase length and stopband attenuation values.

Design an FIR rate converter with interpolation factor set to 3, decimation factor set to 4, half-polyphase length set to 14, and stopband attenuation set to 90 dB.

b = designMultirateFIR(3,4,14,90);
fvtool(b,'impulse');

Input Arguments

collapse all

Interpolation factor, specified as a positive scalar integer. To design a decimator only, set L to 1.

Example: 2

Data Types: single | double

Decimation factor, specified as a positive scalar integer. To design an interpolator only, set M to 1.

Example: 2

Data Types: single | double

Half-polyphase length, specified as a positive scalar integer.

Example: 12

Example: 20

Data Types: single | double

Stopband attenuation in dB, specified as a nonnegative real scalar greater than or equal to 0.

Example: 0.0

Example: 80.5

Data Types: single | double

Output Arguments

collapse all

Multirate FIR filter coefficients, returned as a real-valued N + 1 length vector, where N = 2*P*R, where P is the half-polyphase length, R is defined as max(L,M). For more details, see the More About section.

Algorithms

designMultirateFIR designs an Nth order, Rth band Nyquist FIR filter using the N + 1 length Kaiser window vector to window the truncated impulse response of the FIR filter.

Filter order N is defined as N = 2*P*R and R is defined as max(L,M).

The truncated impulse response d(n) is delayed by N/2 samples to make it causal. The truncated and delayed impulse response is given by:

d(nN/2)=sin(wc(nN/2))π(nN/2),n=0,,N2,,N

where wc=π/R.

For every Rth band, the impulse response of the Nyquist filters is exactly zero. Because of this property, when Nyquist filters are used for pure interpolation, the input samples remain unaltered after interpolating.

A Kaiser window is used because of its near-optimum performance while providing a robust way of designing a Nyquist filter. The window depends on two parameters: length N + 1 and shape parameter β.

The Kaiser window is defined by:

w(n)=I0(β1(nN/2N/2)2)I0(β),0nN,

where I0 is the zeroth-order modified Bessel function of the first kind.

The shape parameter β is calculated from:

β={0.1102(Astop8.7)if Astop500.5842(Astop21)0.4+0.07886(Astop21)if 21<Astop<500if Astop21,

where Astop is the stopband attenuation in dB.

The windowed impulse response is given by

h(n)=w(n)d(nN/2)=w(n)sin(wc(nN/2))π(nN/2),n=0,,N2,,N

h(n) for n = 0,..,N/2,...N are the coefficients of the multirate filter. These coefficients are defined by the interpolation factor, L, and decimation factor, M.

References

[1] Orfanidis, Sophocles J. Introduction to Signal Processing. Upper Saddle River, NJ: Prentice-Hall, 1996.

Extended Capabilities

Introduced in R2016a

Was this topic helpful?