Main Content

# Complex Bandpass Decimator

Extract a frequency subband using a one-sided (complex) bandpass decimator

Libraries:
DSP System Toolbox / Filtering / Multirate Filters

## Description

The Complex Bandpass Decimator block extracts a specific subband of frequencies using a one-sided, multistage, complex bandpass decimator. The block determines the bandwidth of interest using the specified center frequency, decimator factor, and bandwidth values.

This block supports SIMD code generation. For details, see Code Generation.

## Ports

### Input

expand all

Specify the input data as a vector or a matrix.

The block treats each column of the input signal as a separate channel. If the input is a two-dimensional signal, the first dimension represents the channel length (or frame size) and the second dimension represents the number of channels. If the input is a one-dimensional signal, then the block interprets it as a single-channel signal.

When you input a variable-size signal (frame length changes during simulation), the frame length of the signal can be arbitrary, that is, the input frame length does not have to be a multiple of the decimation factor. When you input a fixed-size signal (frame length does not change during simulation), the frame length can be arbitrary only when you select the Allow arbitrary frame length for fixed-size input signals parameter.

To determine the decimation factor, click the View Info button.

This port is unnamed until you select the Specify center frequency from input port parameter.

Data Types: single | double
Complex Number Support: Yes

Center frequency of the desired band in Hz, specified as a real, finite numeric scalar in the range [–Fs/2, Fs/2]. The value of Fs depends on the Inherit sample rate from input parameter. When you select this parameter, Fs is the value the block inherits from the input signal. When you clear this parameter, Fs is the value you specify in the Input sample rate (Hz) parameter.

To enable this port, select the Specify center frequency from input port parameter.

Data Types: single | double
Complex Number Support: Yes

### Output

expand all

Output of the complex bandpass decimator, returned as a vector or a matrix. The output contains the subband of frequencies specified by the parameters on the block dialog.

The output signal dimensions depend on the input signal dimensions, the overall decimation factor of the Complex Bandpass Decimator block, and whether you select the Allow arbitrary frame length for fixed-size input signals parameter. You can determine the overall decimator factor D by clicking the button in the block dialog box.

This table provides more details on the dimensions of the output signal when you input a fixed-size input signal.

Fixed-Size Input Signal

Input SignalOutput Signal Dimensions

P-by-1 column vector, where P is a multiple of the decimation factor D

(P/D)-by-1

P-by-1 column vector, where P is not a multiple of the decimation factor D

ceil(P/D)-by-1 when you select Allow arbitrary frame length for fixed-size input signals.

If you do not select Allow arbitrary frame length for fixed-size input signals, the block errors.

P-by-Q matrix, where P is a multiple of the decimation factor D

(P/D)-by-Q

P-by-Q matrix, where P is not a multiple of the decimation factor D

ceil(P/D)-by-Q when you select Allow arbitrary frame length for fixed-size input signals.

If you do not select Allow arbitrary frame length for fixed-size input signals, the block errors.

This table gives more details on the dimensions of the output signal when you input a variable-size input signal. When you input a variable-size signal (frame length changes during simulation), the Allow arbitrary frame length for fixed-size input signals parameter is visible in the block dialog box but does not have any impact on the input frame length. You can input a variable-size signal of any frame length even if you do not select the Allow arbitrary frame length for fixed-size input signals parameter.

Variable-Size Input Signal

Input SignalOutput Signal Dimensions

P-by-Q

ceil(P/D)-by-Q

The data type of the output is same as the data type of the input. The output signal is always complex.

Data Types: single | double
Complex Number Support: Yes

## Parameters

expand all

Filter design parameters, specified as one of the following:

• Decimation factor –– The block specifies the decimation factor through the Decimation factor parameter. The bandwidth of interest (BW) is computed using the following equation:

$BW=Fs/D$

where

• Fs –– Sample rate specified through the Input sample rate (Hz) parameter.

• D –– Decimation factor.

• Bandwidth –– The block specifies the bandwidth through the Bandwidth (Hz) parameter. The decimation factor (D) is computed using the following equation:

$D=\text{floor}\left(\frac{Fs}{BW+TW}\right)$

where

• Fs –– Sample rate specified through the Input sample rate (Hz) parameter.

• BW –– Bandwidth of interest.

• TW –– Transition width specified through the Transition width (Hz) parameter.

• Decimation factor and bandwidth –– The decimation factor and the bandwidth of interest are specified through the Decimation factor and Bandwidth (Hz) parameters.

Factor by which to reduce the bandwidth of the input signal, specified as a positive integer. The frame size (number of rows) of the input signal must be a multiple of the decimation factor.

#### Dependencies

This parameter applies when you set Filter specification to either Decimation factor or Decimation factor and bandwidth.

Width of the frequency band of interest, specified as a real positive scalar in Hz.

#### Dependencies

This parameter applies when you set Filter specification to either Bandwidth or Decimation factor and bandwidth.

Data Types: single | double

When you select this check box, the center frequency is input through the Fc port. When you clear this check box, the center frequency is specified on the block dialog through the Center frequency (Hz) parameter.

When you select this check box, the block does not compute the filter response. To view the filter response, clear this check box, specify the center frequency on the block dialog, and click button.

Center frequency of the desired band in Hz, specified as a real, finite numeric scalar in the range [–Fs/2, Fs/2].

Tunable: Yes

Data Types: single | double

Stopband attenuation of the filter in dB, specified as a finite positive scalar.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Passband ripple of the filter, specified as a positive scalar in dB.

#### Dependencies

This parameter applies when you set Filter specification to either Bandwidth or Decimation factor and bandwidth.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Transition width of the filter in Hz, specified as a positive scalar.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Minimize the number of complex coefficients. When you select this parameter, the first stage of the multistage filter is bandpass (with complex coefficients) centered at the specified center frequency. The first stage is followed by a mixing stage that heterodynes the signal to DC. The remaining filter stages, all with real coefficients, follow.

When you clear the parameter, the input signal is first passed through the different stages of the multistage filter. All stages are bandpass (complex coefficients). The signal is then heterodyned to DC if Mix signal to baseband parameter is selected and the frequency offset resulting from the decimation is nonzero.

Mix the signal to baseband. When you select this parameter, the block heterodynes the filtered, decimated signal to DC. This mixing stage runs at the output sample rate of the filter. When you clear this parameter, the block skips the mixing stage.

#### Dependencies

This parameter applies when you clear the Reduce number of complex coefficients parameter.

When you select this parameter, the block inherits its sample rate from the input signal. The block calculates the sample rate based on the sample time of the input port. When you clear this parameter, specify the sample rate in Input sample rate (Hz).

Sampling rate of the input signal in Hz, specified as a real positive scalar.

#### Dependencies

This parameter applies when you clear the Inherit sample rate from input parameter.

Data Types: single | double

Since R2023a

Specify whether fixed-size input signals (whose size does not change during simulation) can have an arbitrary frame length, where the frame length does not have to be a multiple of the decimation factor. The block uses this parameter only for fixed-size input signals and ignores it if the input data varies in size during simulation.

When the input signal is a variable-size signal, the signal can have an arbitrary frame length, that is, the frame length does not have to be a multiple of the decimation factor.

For fixed-size input signals, if you:

• Select the Allow arbitrary frame length for fixed-size input signals parameter, the frame length of the signal does not have to be a multiple of the decimation factor. If the input is not a multiple of the decimation factor, then the output is generally a variable-size signal. Therefore, to support arbitrary input size, the block must also support variable-size operations, which you can enable by selecting the Allow arbitrary frame length for fixed-size input signals parameter.

• Clear the Allow arbitrary frame length for fixed-size input signals parameter, the input frame length must be a multiple of the decimation factor.

Click this button to open the Dynamic Filter Visualizer window and display the magnitude and phase response of the complex bandpass decimator. The response is based on the parameters you select in the block dialog box. To update the response while the visualizer is running, modify the parameters in the dialog box and click .

You can configure the plot settings and the frequency response measurements from the interface of the visualizer.

On the Plot tab, you can enable the legend, specify to plot both magnitude and phase responses of the filter, modify the plot settings, generate a script to re-create the plot, and even save or share the settings.

On the Measurements tab, you can enable data cursors, and display the peak values of the filter response.

For more details on the Dynamic Filter Visualizer interface and its tools, see Configure Filter Visualizer.

Display filter information of the Complex Bandpass Decimator block:

This button brings the functionality of the info analysis method into the Simulink® environment.

Specify the type of simulation to run as one of the following:

• Code generation –– Simulate model using generated C code. The first time you run a simulation, Simulink generates C code for the block. The C code is reused for subsequent simulations, as long as the model does not change. This option requires additional startup time but provides faster simulation speed than Interpreted execution.

• Interpreted execution –– Simulate model using the MATLAB®  interpreter. This option shortens startup time but has slower simulation speed than Code generation.

## Block Characteristics

 Data Types double | single Multidimensional Signals No Variable-Size Signals Yes

## Algorithms

The complex bandpass decimator is designed by applying a complex frequency shift transformation on a lowpass prototype filter. The lowpass prototype in this case is a multirate, multistage finite impulse response (FIR) filter. The desired frequency shift applies only to the first stage. Subsequent stages scale the desired frequency shift by their respective cumulative decimation factors. For details, see Complex Bandpass Filter Design and Zoom FFT.

## Version History

Introduced in R2018a

expand all