Documentation

CMSIS Conditions for DSP Blocks to Support ARM Cortex-M

DSP blocks that can be used with the Support Package for ARM® Cortex®-M processors require specific conditions to allow code replacement with the CMSIS Library. when generating C code from a model. You use this code replacement when generating C code from a model. The CMSIS library supports these DSP blocks only when you set specific properties, as indicated in the following table:

Note

In the Fixed-point mode of the CMSIS DSP functions (FIR and Biquad filters), 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 and Biquad filter blocks, 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. If Overflow Mode is set to 'Wrap' or SaturateOn IntegerOverflow is turned off and only the output overflows, the simulation result will also not match the CMSIS library result.

DSP BlockInput RequirementsParameter RequirementsEquivalent CMSIS Functions
Discrete FIR Filter
  • Real values. Output must also be real values.

  • single data type for Lattice MA structure.

  • single or fixed-point data types for Direct Form structure.

    • For fixed-point data, the input word length must be 8, 16, or 32 bits including any number of fractional bits, but the input and output must be the same data type.

  • Single channel (one column).

  • Filter structure: Direct Form or Lattice MA.

  • Input processing: Columns as channels (frame based).

  • Initial states: 0.

  • Coefficients source: Dialog parameters or Input port.

For fixed-point Discrete FIR Filter block with Direct Form Structure:

  • Rounding mode: 'Floor'.

  • Saturate on integer overflow: On (check box is selected) or Off (check box is cleared).

  • 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
  • Real values. Output must also be real values.

  • single data type.

  • Single channel (one column).

  • Filter structure: Direct Form

  • Input processing: Columns as channels (frame-based).

  • Rate options: Enforce single-rate processing.

  • Coefficients source: Dialog parameters.

  • arm_fir_decimate_init_f32

  • arm_fir_decimate_f32

FIR Interpolation
  • Real values. Output must also be real values.

  • single data type.

  • Single channel (one column).

  • Input processing : Columns as channels (frame based).

  • Rate options: Enforce single-rate processing.

  • Coefficients source: Dialog parameters.

  • arm_fir_interpolate_init_f32

  • arm_fir_interpolate_f32

LMS Filter
  • Real values. Output must also be real values.

  • single data type.

  • Single channel.

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

  • Reset port:None.

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

  • Adapt port : off (no adapt output port).

  • Leakage: 1.

  • Initial value of filter weights: 0.

  • Algorithm: 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
  • Real values. Output must also be real values.

  • single or fixed-point data type.

    • For fixed-point data, the input word length must be 16 or 32 bits including any number of fractional bits, but the input and output must be the same data type.

  • Single channel (one column).

  • Single rate mode.

  • 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.

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

  • Initial conditions: 0.

  • Input processing: Columns as channels (frame based).

For fixed-point support for Direct Form I Structure for Q15, Q31, and Q15 fast version:

  • Rounding mode: 'Floor'.

  • Overflow mode: Wrap or Saturate.

  • Lock data type settings: On.

  • arm_biquad_cascade_df1_init_f32

  • arm_biquad_cascade_df2T_init_f32

  • arm_biquad_cascade_df1_f32

  • arm_biquad_cascade_df2T_f32

  • arm_biquad_cascade_df1_init_q15

  • arm_biquad_cascade_df1_q15

  • arm_biquad_cascade_df1_fast_q15

  • arm_biquad_cascade_df1_init_q31

  • arm_biquad_cascade_df1_q31

FFT
  • Complex values.

  • single data type.

  • Single channel.

  • Input length must equal FFT length.

  • FFT implementation: Radix-2.

  • Scale result by FFT length: Off (check box is cleared).

  • Inherit FFT length from input dimensions: Off (check box is cleared).

  • FFT length: 16, 64, 256, 1024

  • arm_cfft_radix2_init_f32

  • arm_cfft_radix2_f32

IFFT
  • Complex values.

  • single data type.

  • Single channel.

  • Input length must equal FFT length.

  • FFT implementation: Radix-2.

  • Divide output by FFT length: On (check box is selected).

  • Inherit FFT length from input dimensions: Off (check box is cleared).

  • FFT length: 16, 64, 256, 1024

  • arm_cfft_radix2_init_f32

  • arm_cfft_radix2_f32

Correlation
Convolution
  • Real values. Output must also be real values.

  • single data type.

  • Single channel.

  • The two inputs must be the same length.

  • Computation domain: Time.

  • arm_conv_f32

  • arm_correlate_f32

There are no init functions associated with these algorithms.

Mean
RMS
Variance
Standard deviation
  • Non-scalar, real values. Output must also be real values.

  • single data type.

  • Single channel, one-dimensional.

  • The two inputs must be the same length.

  • Running statistic

    : Off (check box is cleared).

  • Enable ROI Processing: Off (check box is cleared). ROI does not apply to RMS.

  • Find statistic over: entire input.

  • arm_mean_f32

  • arm_rms_f32

  • arm_var_f32

  • arm_std_f32

There are no init functions associated with these algorithms.