The UDB_IIR component implements a simple first order IIR low pass filter. This IIR filter is implemented using the Universal Digital Blocks (UDB) of the PSoC device. This component does not use any CPU resources for its operation. It needs only one API to start the component i.e. UDB_IIR_Start().
Standard output of the filter is in 2’s complement format, but by using the Enable_Sign_Magnitude and Enable_ABS parameters, output can be converted to a sign magnitude or absolute value formats.
Bitstream – input
Input stream that needs to be filtered
Sample_Clock – input
Sample clock that controls the generation of the bitstream or is related to the desired cutoff frequency.
Clock – input
Clock source for the UDB block. It must be at least 5x to 14x the sample clock.
Done – output
This signal is asserted when the filter calculation is completed.
Beta: Determines the cutoff frequency as well as the number of clock cycles required to complete a sample calculation. Allowed values: 0 to 7
Debug: Enables debug mode by providing access to internal debug signals
Decimation: Discard number of samples before asserting the Done signal. Allowed values: 0 to 127
Enable_ABS: Provides the output in absolute format. To enable this setting, Enable_Sign_Magnitude setting must be enabled.
Enable_Offset: Adds an offset to the output sample
Enable_Sign_Magnitude: Enables the sign magnitude output, where the MSb represents the sign bit. Enabling this bit requires two additional clock cycles for the conversion.
Resolution: Sets the full scale output. This number corresponds to the value when the output is permanently high and a negative of this number when the output is permanently low
Stagger: Delay the start-up by this many sample clock cycles before allowing the done signal to assert.
Application Programming Interface (API)
Application Programming Interface (API) routines allow you to configure the component using software. The following table lists and describes the interface to each function. The subsequent sections cover each function in more detail.
void UDB_IIR_Start(void) – This function starts the UDB_IIR component