Main Content

CDSP

Process data output from ADC peripherals of IFX TC4x

Since R2024a

  • CDSP block

Libraries:
Embedded Coder Support Package for Infineon AURIX TC4x Microcontrollers / AURIX TC4x

Description

The Converter Digital Signal Processing (CDSP) block applies signal processing techniques to data from DSADC block. Based on the filter properties and filter chain that you specify in the block, the block outputs the filtered data as 16-bit signed and unsigned integers.

When you enable the timestamp output, the block provides an additional output port to read the timestamp as a 16-bit unsigned value.

Note

You must install DSP System Toolbox™, SoC Blockset™, or Vision HDL Toolbox™ to use CDSP block in the Simulink model.

Ports

Input

expand all

The port accepts incoming data from DSADC block (using on-chip or external modulator) and applies different signal processing techniques based on the application.

Note

  • In a code generation workflow, the port accepts data from DSADC block

  • In a simulation workflow, the port accepts data from any Simulink® source block

Data Types: uint16 | int16

The port accepts incoming data from DSADC block (using on-chip or external modulator) and uses this secondary input data for addition or subtraction with CDSP secondary input in the Math filter block.

Dependencies

To view the secondary input port, set the DSP Filter chain parameter to Advanced average 1 (FC1), Basic data accumulation (FC2), or Advanced average 2 (FC4). This choice adds a Math tab, where you must set the Math operation parameter to Addition with CDSP secondary input or subtraction with CDSP secondary input

Data Types: uint16 | int16

Output

expand all

The block outputs the filtered data as 16-bit values in the form of an N-by-1 array. N varies based on based on the timestamp, number of output samples, and FIFO depth configuration.

The size of output depends on the values of the other parameters in the block.

Enable FIFOEnable timestamp outputNumber of output samples FIFO depthSize of filtereddata
DisableDisableNANA1-by-1
EnableNANA1-by-1
EnableDisable144-by-1
33-by-1
22-by-1
11-by-1
244-by-1
22-by-1
Enable143-by-1
32-by-1
21-by-1
243-by-1

Data Types: uint16 | int16

The port outputs the status of the 16-bit counter value of timestamp counter.

Dependencies

To enable this port, select the Enable timestamp output parameter.

Data Types: uint16

Parameters

expand all

Filter Config

Select this parameter to configure the timestamp output port.

Selecting this parameter enables options in the Timestamp tab and Timestamp event (under Events tab) in the CDSP Peripheral Configuration.

Note

As the timestamp is always associated with the trigger, it is recommended that you configure and provide the trigger accordingly, when the timestamp is enabled. Otherwise, the FIFO functionality does not work, as timestamp is flushed into FIFO first and then to the result registers.

Select the filter chain to be used by the CDSP block.

  • Demo FIR (FC0): Select this option to use the finite impulse response (FIR) filter block.

  • Advanced average 1 (FC1): Select this option to use the filter blocks in the predefined sequence of FIR > (sixth-order infinite impulse response filter) IIR6 > Math filter (MAT) > Average filter (AVG).

  • Basic data accumulation (FC2): Select this option to use the filter blocks in the predefined sequence of FIR > IIR6 > MAT > Data accumulation filter (DA).

  • Advanced median (FC3): Select this option to use the filter blocks in the predefined sequence of FIR > IIR6 > Median filter (MDN).

  • Advanced average 2 (FC4): Select this option to use the filter blocks in the predefined sequence of IIR6 > FIR > MAT > AVG.

  • Basic AURIX (FCM): Select this option to use the filter blocks in the predefined sequence of FIR > (first-order infinite impulse response filter) IIR1 > DA.

The block adds the FIR, IIR6, IIR1, MAT, AVG, and DA tabs in the block parameters window depending on the choice of the DSP filer chain parameter. You can set the parameters of the filter block in these tabs.

Select data type of the filtered output.

Filter Config > FIFO Configuration

Select to enable FIFO register.

Configure whether to read a single sample or double samples at a time.

Selecting 2 helps in fetching the data faster from the FIFO.

Dependencies

To enable this parameter, select the Enable FIFO parameter.

FIFO level after which the module generates service request.

Dependencies

To view this parameter, select the Enable FIFO parameter.

FIR

Select to bypass FIR block in the filer chain.

Specify the FIR filter coefficients of size ranging from 1-by-1 to 1-by-128.

Dependencies

To enable this parameter, disable the Bypass FIR block parameter.

Specify the ratio of input data rate to output data rate in the FIR filter.

Note

  • In a code generation workflow, the block supports decimation rate ranging from 1 to 16 .

  • In a simulation workflow, the block supports a decimation rate of 1.

Dependencies

To enable this parameter, disable the Bypass FIR block parameter.

IIR6

Select to bypass IIR6 filter block in the filer chain.

Specify the 1-by-18 filter coefficients in the sequence of [a00, a01, a02, a10, a11, a12, a20, a21, a22, b00, b01, b02, b10, b11, b12, b20, b21, b22] for the IIR6 filter with the transfer function:

b00+b01z1+b02z2a00+a01z1+a02z2×b10+b11z1+b12z2a10+a11z1+a12z2×b20+b21z1+b22z2a20+a21z1+a22z2

Dependencies

To enable this parameter, disable the Bypass IIR6 block parameter.

Specify the ratio of input data rate to output data rate in the IIR6 filter.

Note

  • In a code generation workflow, the block supports decimation rate ranging from 1 to 16 .

  • In a simulation workflow, the block supports a decimation rate of 1.

Dependencies

To enable this parameter, disable the Bypass IIR6 block parameter.

Specify the number of bits to shift in the IIR6 filter block to improve precision.

Dependencies

To enable this parameter, disable the Bypass IIR6 block parameter.

Math

Select to bypass Math filter block in the filer chain.

Specify the mathematical operation for the Math filter.

If you choose the Addition with CDSP secondary input or Subtraction with CDSP secondary input, the CDSP block adds an input port for the secondary input.

Dependencies

To enable this parameter, disable the Bypass math block parameter.

Specify the constant value to use in the Math filter.

Dependencies

To enable this parameter, disable the Bypass math block parameter and set the .Math operation parameter to Addition with constant, Subtraction with constant, or Multiplication with constant.

Specify the number of bits for arithmetic right-shift operation on the Math filtered output to correct the output in case of overflow.

Dependencies

To enable this parameter, disable the Bypass math block parameter.

Average

Select to bypass average filter block in the filer chain.

Specify the number of samples to consider for averaging operation.

Dependencies

To enable this parameter, disable the Bypass average block parameter.

Median

Select to bypass MDN filter block in the filer chain.

Specify the number of samples to consider for median filter.

Dependencies

To enable this parameter, disable the Bypass median block parameter.

IIR1

Select to bypass IIR1 filter block in the filer chain.

Dependencies

To enable this parameter, disable the Bypass IIR1 block parameter.

Specify the 1-by-4 filter coefficients in the sequence of [a0, a1, b0, b1] for the IIR1 filter with transfer function:

b0+b1z1a0+a1z1

Dependencies

To enable this parameter, disable the Bypass IIR1 block parameter.

DA

Select to bypass DA filter block in the filer chain.

Disable this parameter to configure data accumulation parameters in the Integrator Control tab in CDSP Peripheral Configuration tool.

Specify the number of data samples per accumulation cycle.

Dependencies

To enable this parameter, disable the Bypass DA block parameter.

Specify the number of data samples to discard during accumulation process.

Dependencies

To enable this parameter, disable the Bypass DA block parameter.

Specify the number of bits for right shift operation on the DA result for gain adjustment.

Dependencies

To enable this parameter, disable the Bypass DA block parameter.

Select to disable the restarting of all the filter blocks prior to DA filter block in the selected filter chain.

Dependencies

To enable this parameter, disable the Bypass DA block parameter.

Version History

Introduced in R2024a