Multirate FIR filter design

`designMultirateFIR`

designs an (*N* – 1)th order,
*R*th band Nyquist FIR filter using the *N*-length
Kaiser window vector to window the truncated impulse response of the FIR filter.

Filter length, *N* is defined as *N* =
2**P***R* and *R* is defined as explained in B.

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(n-N/2)=\frac{\mathrm{sin}({w}_{c}(n-N/2))}{\pi (n-N/2)},\text{\hspace{1em}}n=0,\cdots ,\frac{N}{2},\cdots ,N$$

where $${w}_{c}=\pi /R$$.

For every *R*th 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)=\frac{{I}_{0}\left(\beta \sqrt{1-{\left(\frac{n-N/2}{N/2}\right)}^{2}}\right)}{{I}_{0}(\beta )},\text{\hspace{1em}}\text{\hspace{1em}}0\le n\le N,$$

where *I _{0}* is the zeroth-order modified
Bessel function of the first kind.

The shape parameter β is calculated from:

$$\beta =\{\begin{array}{ll}0.1102({A}_{stop}-8.7)\hfill & \text{if}{A}_{stop}\ge 50\hfill \\ 0.5842{({A}_{stop}-\text{\hspace{0.17em}}\text{\hspace{0.17em}}21)}^{0.4}+0.07886({A}_{stop}-\text{\hspace{0.17em}}\text{\hspace{0.17em}}21)\hfill & \text{if}21{A}_{stop}50\hfill \\ 0\hfill & \text{if}{A}_{stop}\le 21,\hfill \end{array}$$

where *A _{stop}* is the stopband attenuation in dB.

The windowed impulse response is given by

$$h(n)=w(n)d(n-N/2)=w(n)\frac{\mathrm{sin}({w}_{c}(n-N/2))}{\pi (n-N/2)},\text{\hspace{1em}}n=0,\cdots ,\frac{N}{2},\cdots ,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*.

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