Revert doxygen documentation

pull/39/head
Jean-Baptiste Rolland 3 years ago
parent 768ec08507
commit 80f3a64c3a

@ -29,108 +29,103 @@
#include "dsp/filtering_functions.h" #include "dsp/filtering_functions.h"
/** /**
@ingroup groupFilters @ingroup groupFilters
*/ */
/** /**
@defgroup BiquadCascadeDF2T Biquad Cascade IIR Filters Using a Direct Form II Transposed Structure @defgroup BiquadCascadeDF2T Biquad Cascade IIR Filters Using a Direct Form II Transposed Structure
This set of functions implements arbitrary order recursive (IIR) filters using a transposed direct form II structure.
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.
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.
These functions provide a slight memory savings as compared to the direct form I Biquad filter functions. Only floating-point data is supported.
Only floating-point data is supported. This function operate on blocks of input and output data and each call to the function
processes <code>blockSize</code> samples through the filter.
This function operate on blocks of input and output data and each call to the function <code>pSrc</code> points to the array of input data and
processes <code>blockSize</code> samples through the filter. <code>pDst</code> points to the array of output data.
<code>pSrc</code> points to the array of input data and Both arrays contain <code>blockSize</code> values.
<code>pDst</code> points to the array of output data. @par Algorithm
Both arrays contain <code>blockSize</code> values. Each Biquad stage implements a second order filter using the difference equation:
<pre>
@par Algorithm y[n] = b0 * x[n] + d1
Each Biquad stage implements a second order filter using the difference equation: d1 = b1 * x[n] + a1 * y[n] + d2
<pre> d2 = b2 * x[n] + a2 * y[n]
y[n] = b0 * x[n] + d1 </pre>
d1 = b1 * x[n] + a1 * y[n] + d2 where d1 and d2 represent the two state values.
d2 = b2 * x[n] + a2 * y[n] @par
</pre> A Biquad filter using a transposed Direct Form II structure is shown below.
where d1 and d2 represent the two state values. \image html BiquadDF2Transposed.gif "Single transposed Direct Form II Biquad"
@par Coefficients <code>b0, b1, and b2 </code> multiply the input signal <code>x[n]</code> and are referred to as the feedforward coefficients.
A Biquad filter using a transposed Direct Form II structure is shown below. Coefficients <code>a1</code> and <code>a2</code> multiply the output signal <code>y[n]</code> and are referred to as the feedback coefficients.
\image html BiquadDF2Transposed.gif "Single transposed Direct Form II Biquad" Pay careful attention to the sign of the feedback coefficients.
Coefficients <code>b0, b1, and b2 </code> multiply the input signal <code>x[n]</code> and are referred to as the feedforward coefficients. Some design tools flip the sign of the feedback coefficients:
Coefficients <code>a1</code> and <code>a2</code> multiply the output signal <code>y[n]</code> and are referred to as the feedback coefficients. <pre>
Pay careful attention to the sign of the feedback coefficients. y[n] = b0 * x[n] + d1;
Some design tools flip the sign of the feedback coefficients: d1 = b1 * x[n] - a1 * y[n] + d2;
<pre> d2 = b2 * x[n] - a2 * y[n];
y[n] = b0 * x[n] + d1; </pre>
d1 = b1 * x[n] - a1 * y[n] + d2; In this case the feedback coefficients <code>a1</code> and <code>a2</code> must be negated when used with the CMSIS DSP Library.
d2 = b2 * x[n] - a2 * y[n]; @par
</pre> Higher order filters are realized as a cascade of second order sections.
In this case the feedback coefficients <code>a1</code> and <code>a2</code> must be negated when used with the CMSIS DSP Library. <code>numStages</code> refers to the number of second order stages used.
@par For example, an 8th order filter would be realized with <code>numStages=4</code> second order stages.
Higher order filters are realized as a cascade of second order sections. A 9th order filter would be realized with <code>numStages=5</code> second order stages with the
<code>numStages</code> refers to the number of second order stages used. coefficients for one of the stages configured as a first order filter (<code>b2=0</code> and <code>a2=0</code>).
For example, an 8th order filter would be realized with <code>numStages=4</code> second order stages. @par
A 9th order filter would be realized with <code>numStages=5</code> second order stages with the <code>pState</code> points to the state variable array.
coefficients for one of the stages configured as a first order filter (<code>b2=0</code> and <code>a2=0</code>). Each Biquad stage has 2 state variables <code>d1</code> and <code>d2</code>.
@par The state variables are arranged in the <code>pState</code> array as:
<code>pState</code> points to the state variable array. <pre>
Each Biquad stage has 2 state variables <code>d1</code> and <code>d2</code>. {d11, d12, d21, d22, ...}
The state variables are arranged in the <code>pState</code> array as: </pre>
<pre> where <code>d1x</code> refers to the state variables for the first Biquad and
{d11, d12, d21, d22, ...} <code>d2x</code> refers to the state variables for the second Biquad.
</pre> The state array has a total length of <code>2*numStages</code> values.
where <code>d1x</code> refers to the state variables for the first Biquad and The state variables are updated after each block of data is processed; the coefficients are untouched.
<code>d2x</code> refers to the state variables for the second Biquad. @par
The state array has a total length of <code>2*numStages</code> values. The CMSIS library contains Biquad filters in both Direct Form I and transposed Direct Form II.
The state variables are updated after each block of data is processed; the coefficients are untouched. The advantage of the Direct Form I structure is that it is numerically more robust for fixed-point data types.
@par That is why the Direct Form I structure supports Q15 and Q31 data types.
The CMSIS library contains Biquad filters in both Direct Form I and transposed Direct Form II. The transposed Direct Form II structure, on the other hand, requires a wide dynamic range for the state variables <code>d1</code> and <code>d2</code>.
The advantage of the Direct Form I structure is that it is numerically more robust for fixed-point data types. Because of this, the CMSIS library only has a floating-point version of the Direct Form II Biquad.
That is why the Direct Form I structure supports Q15 and Q31 data types. 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.
The transposed Direct Form II structure, on the other hand, requires a wide dynamic range for the state variables <code>d1</code> and <code>d2</code>. @par Instance Structure
Because of this, the CMSIS library only has a floating-point version of the Direct Form II Biquad. The coefficients and state variables for a filter are stored together in an instance data structure.
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. 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.
@par Instance Structure @par Init Functions
The coefficients and state variables for a filter are stored together in an instance data structure. There is also an associated initialization function.
A separate instance structure must be defined for each filter. The initialization function performs following operations:
Coefficient arrays may be shared among several instances while state variable arrays cannot be shared. - Sets the values of the internal structure fields.
- Zeros out the values in the state buffer.
@par Init Functions To do this manually without calling the init function, assign the follow subfields of the instance structure:
There is also an associated initialization function. numStages, pCoeffs, pState. Also set all of the values in pState to zero.
The initialization function performs following operations: @par
- Sets the values of the internal structure fields. Use of the initialization function is optional.
- Zeros out the values in the state buffer. However, if the initialization function is used, then the instance structure cannot be placed into a const data section.
To do this manually without calling the init function, assign the follow subfields of the instance structure: To place an instance structure into a const data section, the instance structure must be manually initialized.
numStages, pCoeffs, pState. Also set all of the values in pState to zero. Set the values in the state buffer to zeros before static initialization.
@par For example, to statically initialize the instance structure use
Use of the initialization function is optional. <pre>
However, if the initialization function is used, then the instance structure cannot be placed into a const data section. arm_biquad_cascade_df2T_instance_f64 S1 = {numStages, pState, pCoeffs};
To place an instance structure into a const data section, the instance structure must be manually initialized. arm_biquad_cascade_df2T_instance_f32 S1 = {numStages, pState, pCoeffs};
Set the values in the state buffer to zeros before static initialization. </pre>
For example, to statically initialize the instance structure use where <code>numStages</code> is the number of Biquad stages in the filter;
<pre> <code>pState</code> is the address of the state buffer.
arm_biquad_cascade_df2T_instance_f64 S1 = {numStages, pState, pCoeffs}; <code>pCoeffs</code> is the address of the coefficient buffer;
arm_biquad_cascade_df2T_instance_f32 S1 = {numStages, pState, pCoeffs}; */
</pre>
where <code>numStages</code> is the number of Biquad stages in the filter;
<code>pState</code> is the address of the state buffer.
<code>pCoeffs</code> is the address of the coefficient buffer;
*/
/** /**
@addtogroup BiquadCascadeDF2T @addtogroup BiquadCascadeDF2T
@{ @{
*/ */
/** /**
@brief Processing function for the floating-point transposed direct form II Biquad cascade filter. @brief Processing function for the floating-point transposed direct form II Biquad cascade filter.
@param[in] S points to an instance of the filter data structure @param[in] S points to an instance of the filter data structure
@param[in] pSrc points to the block of input data @param[in] pSrc points to the block of input data
@param[out] pDst points to the block of output data @param[out] pDst points to the block of output data
@param[in] blockSize number of samples to process @param[in] blockSize number of samples to process
@return none @return none
*/ */
#if defined(ARM_MATH_NEON) #if defined(ARM_MATH_NEON)
void arm_biquad_cascade_df2T_f64( void arm_biquad_cascade_df2T_f64(

Loading…
Cancel
Save