From 9f95ff5b6ba01db09552b84a0ab79607060a2666 Mon Sep 17 00:00:00 2001 From: Ali Labbene Date: Wed, 11 Dec 2019 08:59:21 +0100 Subject: Official ARM version: v5.4.0 Add CMSIS V5.4.0, please refer to index.html available under \docs folder. Note: content of \CMSIS\Core\Include has been copied under \Include to keep the same structure used in existing projects, and thus avoid projects mass update Note: the following components have been removed from ARM original delivery (as not used in ST packages) - CMSIS_EW2018.pdf - .gitattributes - .gitignore - \Device - \CMSIS - \CoreValidation - \DAP - \Documentation - \DoxyGen - \Driver - \Pack - \RTOS\CMSIS_RTOS_Tutorial.pdf - \RTOS\RTX - \RTOS\Template - \RTOS2\RTX - \Utilities - All ARM/GCC projects files are deleted from \DSP, \RTOS and \RTOS2 Change-Id: Ia026c3f0f0d016627a4fb5a9032852c33d24b4d3 --- docs/DSP/html/group__BiquadCascadeDF2T.html | 533 ++++++++++++++++++++++++++++ 1 file changed, 533 insertions(+) create mode 100644 docs/DSP/html/group__BiquadCascadeDF2T.html (limited to 'docs/DSP/html/group__BiquadCascadeDF2T.html') diff --git a/docs/DSP/html/group__BiquadCascadeDF2T.html b/docs/DSP/html/group__BiquadCascadeDF2T.html new file mode 100644 index 0000000..65ab903 --- /dev/null +++ b/docs/DSP/html/group__BiquadCascadeDF2T.html @@ -0,0 +1,533 @@ + + + + + +Biquad Cascade IIR Filters Using a Direct Form II Transposed Structure +CMSIS-DSP: Biquad Cascade IIR Filters Using a Direct Form II Transposed Structure + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-DSP +  Version 1.5.2 +
+
CMSIS DSP Software Library
+
+
+ +
+
    + +
+
+ + + +
+
+ +
+
+
+ +
+ + + + +
+ +
+ +
+ +
+
Biquad Cascade IIR Filters Using a Direct Form II Transposed Structure
+
+
+ + + + + + + + + + + + + + + + + + + + +

+Functions

LOW_OPTIMIZATION_ENTER void arm_biquad_cascade_df2T_f32 (const arm_biquad_cascade_df2T_instance_f32 *S, float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
 Processing function for the floating-point transposed direct form II Biquad cascade filter. More...
 
LOW_OPTIMIZATION_ENTER void arm_biquad_cascade_df2T_f64 (const arm_biquad_cascade_df2T_instance_f64 *S, float64_t *pSrc, float64_t *pDst, uint32_t blockSize)
 Processing function for the floating-point transposed direct form II Biquad cascade filter. More...
 
void arm_biquad_cascade_df2T_init_f32 (arm_biquad_cascade_df2T_instance_f32 *S, uint8_t numStages, float32_t *pCoeffs, float32_t *pState)
 Initialization function for the floating-point transposed direct form II Biquad cascade filter. More...
 
void arm_biquad_cascade_df2T_init_f64 (arm_biquad_cascade_df2T_instance_f64 *S, uint8_t numStages, float64_t *pCoeffs, float64_t *pState)
 Initialization function for the floating-point transposed direct form II Biquad cascade filter. More...
 
LOW_OPTIMIZATION_ENTER void arm_biquad_cascade_stereo_df2T_f32 (const arm_biquad_cascade_stereo_df2T_instance_f32 *S, float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
 Processing function for the floating-point transposed direct form II Biquad cascade filter. More...
 
void arm_biquad_cascade_stereo_df2T_init_f32 (arm_biquad_cascade_stereo_df2T_instance_f32 *S, uint8_t numStages, float32_t *pCoeffs, float32_t *pState)
 Initialization function for the floating-point transposed direct form II Biquad cascade filter. More...
 
+

Description

+

This set of functions implements arbitrary order recursive (IIR) filters using a transposed direct form II structure. The filters are implemented as a cascade of second order Biquad sections. These functions provide a slight memory savings as compared to the direct form I Biquad filter functions. Only floating-point data is supported.

+

This function operate on blocks of input and output data and each call to the function processes blockSize samples through the filter. pSrc points to the array of input data and pDst points to the array of output data. Both arrays contain blockSize values.

+
Algorithm
Each Biquad stage implements a second order filter using the difference equation:
+   y[n] = b0 * x[n] + d1
+   d1 = b1 * x[n] + a1 * y[n] + d2
+   d2 = b2 * x[n] + a2 * y[n]
+
where d1 and d2 represent the two state values.
+
A Biquad filter using a transposed Direct Form II structure is shown below.
+BiquadDF2Transposed.gif +
+Single transposed Direct Form II Biquad
+Coefficients b0, b1, and b2 multiply the input signal x[n] and are referred to as the feedforward coefficients. Coefficients a1 and a2 multiply the output signal y[n] and are referred to as the feedback coefficients. Pay careful attention to the sign of the feedback coefficients. Some design tools flip the sign of the feedback coefficients:
+   y[n] = b0 * x[n] + d1;
+   d1 = b1 * x[n] - a1 * y[n] + d2;
+   d2 = b2 * x[n] - a2 * y[n];
+
In this case the feedback coefficients a1 and a2 must be negated when used with the CMSIS DSP Library.
+
Higher order filters are realized as a cascade of second order sections. numStages refers to the number of second order stages used. For example, an 8th order filter would be realized with numStages=4 second order stages. A 9th order filter would be realized with numStages=5 second order stages with the coefficients for one of the stages configured as a first order filter (b2=0 and a2=0).
+
pState points to the state variable array. Each Biquad stage has 2 state variables d1 and d2. The state variables are arranged in the pState array as:
+    {d11, d12, d21, d22, ...}
+
where d1x refers to the state variables for the first Biquad and d2x refers to the state variables for the second Biquad. The state array has a total length of 2*numStages values. The state variables are updated after each block of data is processed; the coefficients are untouched.
+
The CMSIS library contains Biquad filters in both Direct Form I and transposed Direct Form II. The advantage of the Direct Form I structure is that it is numerically more robust for fixed-point data types. That is why the Direct Form I structure supports Q15 and Q31 data types. The transposed Direct Form II structure, on the other hand, requires a wide dynamic range for the state variables d1 and d2. Because of this, the CMSIS library only has a floating-point version of the Direct Form II Biquad. The advantage of the Direct Form II Biquad is that it requires half the number of state variables, 2 rather than 4, per Biquad stage.
+
Instance Structure
The coefficients and state variables for a filter are stored together in an instance data structure. A separate instance structure must be defined for each filter. Coefficient arrays may be shared among several instances while state variable arrays cannot be shared.
+
Init Functions
There is also an associated initialization function. The initialization function performs following operations:
    +
  • Sets the values of the internal structure fields.
  • +
  • Zeros out the values in the state buffer. To do this manually without calling the init function, assign the follow subfields of the instance structure: numStages, pCoeffs, pState. Also set all of the values in pState to zero.
  • +
+
+
Use of the initialization function is optional. However, if the initialization function is used, then the instance structure cannot be placed into a const data section. To place an instance structure into a const data section, the instance structure must be manually initialized. Set the values in the state buffer to zeros before static initialization. For example, to statically initialize the instance structure use
+    arm_biquad_cascade_df2T_instance_f32 S1 = {numStages, pState, pCoeffs};
+
where numStages is the number of Biquad stages in the filter; pState is the address of the state buffer. pCoeffs is the address of the coefficient buffer;
+

This set of functions implements arbitrary order recursive (IIR) filters using a transposed direct form II structure. The filters are implemented as a cascade of second order Biquad sections. These functions provide a slight memory savings as compared to the direct form I Biquad filter functions. Only floating-point data is supported.

+

This function operate on blocks of input and output data and each call to the function processes blockSize samples through the filter. pSrc points to the array of input data and pDst points to the array of output data. Both arrays contain blockSize values.

+
Algorithm
Each Biquad stage implements a second order filter using the difference equation:
+   y[n] = b0 * x[n] + d1
+   d1 = b1 * x[n] + a1 * y[n] + d2
+   d2 = b2 * x[n] + a2 * y[n]
+
where d1 and d2 represent the two state values.
+
A Biquad filter using a transposed Direct Form II structure is shown below.
+BiquadDF2Transposed.gif +
+Single transposed Direct Form II Biquad
+Coefficients b0, b1, and b2 multiply the input signal x[n] and are referred to as the feedforward coefficients. Coefficients a1 and a2 multiply the output signal y[n] and are referred to as the feedback coefficients. Pay careful attention to the sign of the feedback coefficients. Some design tools flip the sign of the feedback coefficients:
+   y[n] = b0 * x[n] + d1;
+   d1 = b1 * x[n] - a1 * y[n] + d2;
+   d2 = b2 * x[n] - a2 * y[n];
+
In this case the feedback coefficients a1 and a2 must be negated when used with the CMSIS DSP Library.
+
Higher order filters are realized as a cascade of second order sections. numStages refers to the number of second order stages used. For example, an 8th order filter would be realized with numStages=4 second order stages. A 9th order filter would be realized with numStages=5 second order stages with the coefficients for one of the stages configured as a first order filter (b2=0 and a2=0).
+
pState points to the state variable array. Each Biquad stage has 2 state variables d1 and d2. The state variables are arranged in the pState array as:
+    {d11, d12, d21, d22, ...}
+
where d1x refers to the state variables for the first Biquad and d2x refers to the state variables for the second Biquad. The state array has a total length of 2*numStages values. The state variables are updated after each block of data is processed; the coefficients are untouched.
+
The CMSIS library contains Biquad filters in both Direct Form I and transposed Direct Form II. The advantage of the Direct Form I structure is that it is numerically more robust for fixed-point data types. That is why the Direct Form I structure supports Q15 and Q31 data types. The transposed Direct Form II structure, on the other hand, requires a wide dynamic range for the state variables d1 and d2. Because of this, the CMSIS library only has a floating-point version of the Direct Form II Biquad. The advantage of the Direct Form II Biquad is that it requires half the number of state variables, 2 rather than 4, per Biquad stage.
+
Instance Structure
The coefficients and state variables for a filter are stored together in an instance data structure. A separate instance structure must be defined for each filter. Coefficient arrays may be shared among several instances while state variable arrays cannot be shared.
+
Init Functions
There is also an associated initialization function. The initialization function performs following operations:
    +
  • Sets the values of the internal structure fields.
  • +
  • Zeros out the values in the state buffer. To do this manually without calling the init function, assign the follow subfields of the instance structure: numStages, pCoeffs, pState. Also set all of the values in pState to zero.
  • +
+
+
Use of the initialization function is optional. However, if the initialization function is used, then the instance structure cannot be placed into a const data section. To place an instance structure into a const data section, the instance structure must be manually initialized. Set the values in the state buffer to zeros before static initialization. For example, to statically initialize the instance structure use
+    arm_biquad_cascade_df2T_instance_f64 S1 = {numStages, pState, pCoeffs};
+
where numStages is the number of Biquad stages in the filter; pState is the address of the state buffer. pCoeffs is the address of the coefficient buffer;
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LOW_OPTIMIZATION_ENTER void arm_biquad_cascade_df2T_f32 (const arm_biquad_cascade_df2T_instance_f32S,
float32_tpSrc,
float32_tpDst,
uint32_t blockSize 
)
+
+
Parameters
+ + + + + +
[in]*Spoints to an instance of the filter data structure.
[in]*pSrcpoints to the block of input data.
[out]*pDstpoints to the block of output data
[in]blockSizenumber of samples to process.
+
+
+
Returns
none.
+ +

References blockSize, arm_biquad_cascade_df2T_instance_f32::numStages, arm_biquad_cascade_df2T_instance_f32::pCoeffs, and arm_biquad_cascade_df2T_instance_f32::pState.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LOW_OPTIMIZATION_ENTER void arm_biquad_cascade_df2T_f64 (const arm_biquad_cascade_df2T_instance_f64S,
float64_tpSrc,
float64_tpDst,
uint32_t blockSize 
)
+
+
Parameters
+ + + + + +
[in]*Spoints to an instance of the filter data structure.
[in]*pSrcpoints to the block of input data.
[out]*pDstpoints to the block of output data
[in]blockSizenumber of samples to process.
+
+
+
Returns
none.
+ +

References blockSize, arm_biquad_cascade_df2T_instance_f64::numStages, arm_biquad_cascade_df2T_instance_f64::pCoeffs, and arm_biquad_cascade_df2T_instance_f64::pState.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void arm_biquad_cascade_df2T_init_f32 (arm_biquad_cascade_df2T_instance_f32S,
uint8_t numStages,
float32_tpCoeffs,
float32_tpState 
)
+
+
Parameters
+ + + + + +
[in,out]*Spoints to an instance of the filter data structure.
[in]numStagesnumber of 2nd order stages in the filter.
[in]*pCoeffspoints to the filter coefficients.
[in]*pStatepoints to the state buffer.
+
+
+
Returns
none
+

Coefficient and State Ordering:

+
The coefficients are stored in the array pCoeffs in the following order:
+    {b10, b11, b12, a11, a12, b20, b21, b22, a21, a22, ...}
+
+
where b1x and a1x are the coefficients for the first stage, b2x and a2x are the coefficients for the second stage, and so on. The pCoeffs array contains a total of 5*numStages values.
+
The pState is a pointer to state array. Each Biquad stage has 2 state variables d1, and d2. The 2 state variables for stage 1 are first, then the 2 state variables for stage 2, and so on. The state array has a total length of 2*numStages values. The state variables are updated after each block of data is processed; the coefficients are untouched.
+ +

References arm_biquad_cascade_df2T_instance_f32::numStages, arm_biquad_cascade_df2T_instance_f32::pCoeffs, and arm_biquad_cascade_df2T_instance_f32::pState.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void arm_biquad_cascade_df2T_init_f64 (arm_biquad_cascade_df2T_instance_f64S,
uint8_t numStages,
float64_tpCoeffs,
float64_tpState 
)
+
+
Parameters
+ + + + + +
[in,out]*Spoints to an instance of the filter data structure.
[in]numStagesnumber of 2nd order stages in the filter.
[in]*pCoeffspoints to the filter coefficients.
[in]*pStatepoints to the state buffer.
+
+
+
Returns
none
+

Coefficient and State Ordering:

+
The coefficients are stored in the array pCoeffs in the following order:
+    {b10, b11, b12, a11, a12, b20, b21, b22, a21, a22, ...}
+
+
where b1x and a1x are the coefficients for the first stage, b2x and a2x are the coefficients for the second stage, and so on. The pCoeffs array contains a total of 5*numStages values.
+
The pState is a pointer to state array. Each Biquad stage has 2 state variables d1, and d2. The 2 state variables for stage 1 are first, then the 2 state variables for stage 2, and so on. The state array has a total length of 2*numStages values. The state variables are updated after each block of data is processed; the coefficients are untouched.
+ +

References arm_biquad_cascade_df2T_instance_f64::numStages, arm_biquad_cascade_df2T_instance_f64::pCoeffs, and arm_biquad_cascade_df2T_instance_f64::pState.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LOW_OPTIMIZATION_ENTER void arm_biquad_cascade_stereo_df2T_f32 (const arm_biquad_cascade_stereo_df2T_instance_f32S,
float32_tpSrc,
float32_tpDst,
uint32_t blockSize 
)
+
+

Processing function for the floating-point transposed direct form II Biquad cascade filter. 2 channels.

+
Parameters
+ + + + + +
[in]*Spoints to an instance of the filter data structure.
[in]*pSrcpoints to the block of input data.
[out]*pDstpoints to the block of output data
[in]blockSizenumber of samples to process.
+
+
+
Returns
none.
+ +

References blockSize, arm_biquad_cascade_stereo_df2T_instance_f32::numStages, arm_biquad_cascade_stereo_df2T_instance_f32::pCoeffs, and arm_biquad_cascade_stereo_df2T_instance_f32::pState.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void arm_biquad_cascade_stereo_df2T_init_f32 (arm_biquad_cascade_stereo_df2T_instance_f32S,
uint8_t numStages,
float32_tpCoeffs,
float32_tpState 
)
+
+
Parameters
+ + + + + +
[in,out]*Spoints to an instance of the filter data structure.
[in]numStagesnumber of 2nd order stages in the filter.
[in]*pCoeffspoints to the filter coefficients.
[in]*pStatepoints to the state buffer.
+
+
+
Returns
none
+

Coefficient and State Ordering:

+
The coefficients are stored in the array pCoeffs in the following order:
+    {b10, b11, b12, a11, a12, b20, b21, b22, a21, a22, ...}
+
+
where b1x and a1x are the coefficients for the first stage, b2x and a2x are the coefficients for the second stage, and so on. The pCoeffs array contains a total of 5*numStages values.
+
The pState is a pointer to state array. Each Biquad stage has 2 state variables d1, and d2 for each channel. The 2 state variables for stage 1 are first, then the 2 state variables for stage 2, and so on. The state array has a total length of 2*numStages values. The state variables are updated after each block of data is processed; the coefficients are untouched.
+ +

References arm_biquad_cascade_stereo_df2T_instance_f32::numStages, arm_biquad_cascade_stereo_df2T_instance_f32::pCoeffs, and arm_biquad_cascade_stereo_df2T_instance_f32::pState.

+ +
+
+
+
+ + + + -- cgit