Main Content

Downsampler

Downsample by removing data samples between input samples

Since R2022b

  • Downsampler block

Libraries:
DSP HDL Toolbox / Signal Operations

Description

The Downsampler block downsamples an input signal by removing K–1 data samples between input samples. The block supports these combinations of input and output data.

  • Scalar input and scalar output

  • Vector input and scalar output

  • Vector input and vector output

The block provides an architecture suitable for HDL code generation and hardware deployment.

Note

You can also generate HDL code for this hardware-optimized algorithm, without creating a Simulink® model, by using the DSP HDL IP Designer app. The app provides the same interface and configuration options as the Simulink block.

Examples

Ports

Input

expand all

Input data, specified as a scalar or a column vector with a length up to 64. The input data must be an integer or a fixed point with a word length less than or equal to 128. The Downsample factor (K) parameter must be an integer multiple of the input frame size.

The double and single data types are supported for simulation, but not for HDL code generation.

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

Control signal that indicates whether the input data is valid. When this value is 1, the block accepts the values on the data input port. When this value is 0, the block ignores the values on the data input port.

Data Types: Boolean

Control signal that clears the internal states. When this value is 1, the block stops the current calculation and clears its internal states. When this value is 0 and valid is 1, the block captures data for processing.

For more reset considerations, see the Reset Signal section on the Hardware Control Signals page.

Dependencies

To enable this port, on the Control Ports tab, select the Enable reset input port parameter.

Data Types: Boolean

Output

expand all

Downsampled data, returned as a scalar or a column vector with a length up to 1 to 64.

For a vector input, if the vector size is less than or equal to Downsample factor (K), the block outputs scalar output.

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

Control signal that indicates whether data from the data output port is valid. When this value is 1, the block returns valid data on the data output port. When this value is 0, the values on the data output port are not valid.

Data Types: Boolean

Parameters

expand all

Main

Specify the downsampling factor at which the block decreases the input sample rate.

Specify the sample offset in the range [0, Downsample factor (K) – 1].

Control Ports

Select this parameter to enable the reset input port. The reset signal implements a local synchronous reset of the data path registers.

For more reset considerations, see Tips.

Algorithms

expand all

Extended Capabilities

Version History

Introduced in R2022b