Documentation Center

  • Trial Software
  • Product Updates

CMSIS Conditions for DSP Blocks to Support ARM Cortex-M

General Conditions on All Blocks

Under the following conditions, CMSIS support for DSP blocks is available:

  • Input data type is single. (except for Discrete FIR Filter with 'Direct Form' Structure, where both single and fixed-point data types are supported.)

  • Block is in single rate mode.

  • Input or output is real. (Support for complex input or output is available for FFT and IFFT blocks.)

  • Input is single channel.

    Note:   In the Fixed-point mode of the CMSIS DSP (FIR) function, Wrap is used for intermediate MAC operations if accumulator result overflows. At the end, the accumulator is right shifted and saturated to the output data type. For discrete FIR block or system object, there is only one overflow setting for accumulator and output. So if overflow happens in accumulation, the simulation result will not match the CMSIS library result.

Specific Block Parameters Used to Support CMSIS

DSP blocks supporting the ARM-Cortex-M package require a set of conditions that would allow code replacement with the CMSIS Library, when generating C code from a model. The CMSIS library supports these DSP blocks only when you set specific parameters, as indicated in the following table. To use the CMSIS library with these blocks offering ARM support, you must follow these rules for specifying parameters.

The following table illustrates the rules under which CMSIS supports these blocks offering ARM support:

DSP BlockBlock Parameters for CMSIS Support Equivalent CMSIS Methods
Discrete FIR Filter
  • Filter structure: Direct Form or Lattice MA

  • Input is real

    Input processing: Columns as channels (frame based); and input has one column

    Input : single channel

  • Initial states : 0

  • Coefficients source: Dialog parameters or Input port

  • The following settings are needed to support fixed-point Discrete FIR Filter block, in Direct Form Structure only:

  • RndMeth: 'Floor'

  • SaturateOnIntegerOverflow: on

  • lockScale: on

  • Q15 Specific: Number of filter coefficients must be even and greater than or equal to 4. If not, pad zeros at the end.

  • 'Direct Form' Structure:

  • arm_fir_f32

  • arm_fir_init_f32

  • fixed-point input with q7 format:

  • arm_fir_q7

  • arm_fir_init_q7

  • fixed-point input with q15 format:

  • arm_fir_q15

  • arm_fir_init_q15

  • fixed-point input with q31 format:

  • arm_fir_q31

  • arm_fir_init_q31

  • 'Lattice MA' Structure:

  • arm_fir_lattice_f32

  • arm_fir_lattice_init_f32

FIR Decimation
  • Filter structure: Direct Form

  • Input processing: Columns as channels (frame-based), and input has one column

    Input: single channel

  • Rate options: Enforce single-rate processing

  • Coefficients source: Dialog parameters

  • arm_fir_decimate_init_f32

    arm_fir_decimate_f32

FIR Interpolation
  • Input processing : Columns as channels (frame based), and input has one column

    Input: single channel

  • Rate options: Enforce single-rate processing

  • Coefficients source: Dialog parameters

  • arm_fir_interpolate_init_f32

    arm_fir_interpolate_f32

LMS Filter
  • Specify step size via: Dialog (mu specified from the dialog)

  • Reset port :None (no reset port)

  • Output filter weights : off (no weights output port)

  • Adapt port : off (no adapt output port)

  • Leakage : 1

  • Initial value of filter weights : 0 (initial weights are zero)

  • Algorithm is either LMS or Normalized LMS

  • arm_lms_init_f32

  • arm_lms_f32

    If the algorithm is Normalized LMS:

    • arm_lms_norm_f32

    • arm_lms_norm_init_f32

Biquad Filter
  • Coefficients source: Dialog parameters or Input port(s)

    • Restriction: If Coefficient source is Input port(s), replacement only occurs when Scale value mode is set to Assume all are unity and optimize

  • No replacement for DFILT object

  • Filter structure: Direct Form I or Direct Form II transposed

  • Initial conditions: 0

  • Input processing: Columns as channels (frame based)

  • arm_biquad_cascade_df1_init_f32

    arm_biquad_cascade_df2T_init_f32

    arm_biquad_cascade_df1_f32

    arm_biquad_cascade_df2T_f32

FFT
  • FFT implementation: Radix-2

  • Scale result by FFT length: uncheck (or OFF)

  • Inherit FFT length from input dimensions: uncheck (or OFF)

    • Restriction: Input Length must be equal to FFT Length because of CMSIS FFT algorithm

  • FFT length: 16, 64, 256, 1024

  • Input: complex single

    • Restriction: Input length must equal FFT length, because of CMSIS in-place FFT algorithm

  • arm_cfft_radix2_init_f32

    arm_cfft_radix2_f32

IFFT
  • FFT implementation: Radix-2

  • Divide output by FFT length: check (or ON)

  • Inherit FFT length from input dimensions: uncheck (or OFF)

    • Restriction: Input Length must be equal to FFT Length because of CMSIS FFT algorithm

  • FFT length: 16, 64, 256, 1024

  • Output sampling mode: both sample based and frame based

  • Input: complex single

    • Restriction: Input length must equal FFT length, because of CMSIS in-place FFT algorithm

  • arm_cfft_radix2_init_f32

    arm_cfft_radix2_f32

Correlation

Convolution
  • Computation domain: Time

  • Input: Single channel

  • The two inputs must be of the same length

  • inputs must be real

  • arm_conv_f32

    arm_correlate_f32

    There are no init methods associated with these algorithms.

Mean

RMS

Variance

Standard deviation
  • Non-running mode only

  • ROI Processing: disabled (does not apply to RMS)

  • Find statistic over entire input

  • Input is one-dimensional

  • Input: single channel, not scalar, real

  • arm_mean_f32

    arm_rms_f32

    arm_var_f32

    arm_std_f32

    There are no init methods associated with these algorithms.

Was this topic helpful?