# Multirate and Multistage Filters

Multirate filters are digital filters that change the sample rate of a
digital signal without introducing aliasing or imaging in the
rate-converted signal. These filters are categorized as decimators that
reduce the sample rate, interpolators that increase the sample rate, and
rate converters that do a combination of both. For details on these rate
conversion operations and their effect on the signal in time and
frequency domains, see Overview of Multirate Filters. DSP System Toolbox™ offers MATLAB^{®} System objects and Simulink^{®} blocks that implement decimators, interpolators, and rate
converters. Advanced filter technologies such as channelizers, channel
synthesizers, two-channel halfband filter banks, and multilevel filter
banks use these filters as building components.

You can implement a multirate filter with a large rate conversion factor efficiently in two or more stages rather than in one single stage. When the design is long (contains many coefficients) and costly (requires many multiplications and additions per input sample), the multistage approach is more efficient to implement compared to the single-stage approach. For more details, see Overview of Multistage Filters.

The `designMultistageDecimator`

and `designMultistageInterpolator`

functions in DSP System Toolbox automatically determine the optimal configuration of the
filter, which includes determining the number of stages and the rate
conversion factor for each stage. An optimal configuration leads to the
least computational effort and you can measure the cost of such an
implementation using the `cost`

function. For an
example, see Multistage Rate Conversion.

## Objects

## Functions

## Blocks

## Topics

### Sample and Frame Rates in Multirate Models

**Inspect Sample and Frame Rates in Simulink**

Understand sample time, sample rate, frame period, and frame rate in the context of a Simulink model. Determine the sample and frame rates of signals in your model.**Convert Sample and Frame Rates in Simulink Using Rate Conversion Blocks**

Learn how direct-rate conversion blocks impact the sample rate and frame rate of signals in Simulink models.**Convert Sample and Frame Rates in Simulink Using Frame Rebuffering Blocks**

Learn how frame rebuffering blocks impact the sample rate and frame rate of signals in Simulink models.

### Multirate Filters

**Overview of Multirate Filters**

Define multirate filters and understand decimation and interpolation. Understand aliasing and imaging and ways to avoid them.**Design of Decimators and Interpolators**

This example shows how to design filters for decimation and interpolation of discrete sequences.**Multirate Filtering in MATLAB and Simulink**

Perform multirate filtering using rate conversion objects and blocks.**FIR Nyquist (L-th band) Filter Design**

This example shows how to design lowpass FIR Nyquist filters.

### Multistage Filters

**Overview of Multistage Filters**

Different types of multistage filters and their uses. Learn how to implement decimators and interpolators using the multistage approach.**Multistage Rate Conversion**

Design multistage rate conversion filters.

### Filter Banks

**Overview of Filter Banks**

Provides an overview of the channelizer, channel synthesizer, and the two-channel filter bank.**Two-Channel Filter Bank Using Halfband Decimators and Halfband Interpolators**

Implement a two-channel filter bank using the FIR and IIR halfband filters. Compare the implementation cost and group delay.**Channelize and Synthesize Sine Wave in MATLAB**

Channelize and synthesize sinusoidal signal in MATLAB.**Synthesize and Channelize Audio in Simulink**

Synthesize and channelize audio signals.**Multilevel Filter Banks**

Understand dyadic analysis and dyadic synthesis multilevel filter banks.**Calculate Channel Latencies Required for Wavelet Reconstruction**

Learn how to calculate the latencies required for perfect wavelet reconstruction.

### Dataflow

**Model Multirate Signal Processing Systems Using Dataflow**

Use a Dataflow Subsystem to automatically calculate frame sizes in multirate systems.

### Delay and Latency

**Time-Based Scheduling and Code Generation (Simulink Coder)**

Consider continuous and discrete block usage, sample times, rate transitions for multirate models, discretization, and choosing between single-tasking mode and multitasking mode when designing models intended for code generation.**Delay and Latency**

Configure the Simulink environment to minimize delay and increase simulation performance.