Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/FilteringFunctions/arm_conv_q31.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
The input signals should be scaled down to avoid intermediate overflows.
Scale down the inputs by log2(min(srcALen, srcBLen)) (log2 is read as log to the base 2) times to avoid overflows,
as maximum of min(srcALen, srcBLen) number of additions are carried internally.
The 2.62 accumulator is right shifted by 31 bits and saturated to 1.31 format to yield the final result.
The result is in 1.31 format.

@remark
Refer to \ref arm_conv_fast_q31() for a faster but less precise implementation of this function.
Expand Down
2 changes: 1 addition & 1 deletion Source/FilteringFunctions/arm_correlate_q31.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
The input signals should be scaled down to avoid intermediate overflows.
Scale down one of the inputs by 1/min(srcALen, srcBLen)to avoid overflows since a
maximum of min(srcALen, srcBLen) number of additions is carried internally.
The 2.62 accumulator is right shifted by 31 bits and saturated to 1.31 format to yield the final result.
The result is in 1.31 format.

@remark
Refer to \ref arm_correlate_fast_q31() for a faster but less precise implementation of this function.
Expand Down
6 changes: 4 additions & 2 deletions Source/FilteringFunctions/arm_fir_decimate_q31.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@
@param[in] blockSize number of input samples to process

@par Scaling and Overflow Behavior
The function is implemented using an internal 64-bit accumulator.
The scalar implementation uses an internal 64-bit accumulator.
The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit.
Thus, if the accumulator result overflows it wraps around rather than clip.
In order to avoid overflows completely the input signal must be scaled down by log2(numTaps) bits (where log2 is read as log to the base 2).
After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format.
The result is in 1.31 format.
The Helium implementation may avoid some intermediate overflows, but the same scaling constraints
as for the scalar implementation should be followed.

@remark
Refer to \ref arm_fir_decimate_fast_q31() for a faster but less precise implementation of this function.
Expand Down
6 changes: 4 additions & 2 deletions Source/FilteringFunctions/arm_fir_interpolate_q31.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@
@param[in] blockSize number of input samples to process

@par Scaling and Overflow Behavior
The function is implemented using an internal 64-bit accumulator.
The scalar implementation uses an internal 64-bit accumulator.
The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit.
Thus, if the accumulator result overflows it wraps around rather than clip.
In order to avoid overflows completely the input signal must be scaled down by <code>1/(numTaps/L)</code>.
since <code>numTaps/L</code> additions occur per output sample.
After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format.
The result is in 1.31 format.
The Helium implementation may avoid some intermediate overflows, but the same scaling constraints
as for the scalar implementation should be followed.
*/

#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE)
Expand Down
6 changes: 4 additions & 2 deletions Source/FilteringFunctions/arm_fir_q31.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@
@param[in] blockSize number of samples to process

@par Scaling and Overflow Behavior
The function is implemented using an internal 64-bit accumulator.
The scalar implementation uses an internal 64-bit accumulator.
The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit.
Thus, if the accumulator result overflows it wraps around rather than clip.
In order to avoid overflows completely the input signal must be scaled down by log2(numTaps) bits.
After all multiply-accumulates are performed, the 2.62 accumulator is right shifted by 31 bits and saturated to 1.31 format to yield the final result.
The result is in 1.31 format.
The Helium implementation may avoid some intermediate overflows, but the same scaling constraints
as for the scalar implementation should be followed.

@remark
Refer to \ref arm_fir_fast_q31() for a faster but less precise implementation of this filter.
Expand Down
6 changes: 2 additions & 4 deletions Source/FilteringFunctions/arm_lms_norm_q31.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,10 @@
Thus, if the accumulator result overflows it wraps around rather than clip.
In order to avoid overflows completely the input signal must be scaled down by
log2(numTaps) bits. The reference signal should not be scaled down.
After all multiply-accumulates are performed, the 2.62 accumulator is shifted
and saturated to 1.31 format to yield the final result.
The output signal and error signal are in 1.31 format.
@par
In this filter, filter coefficients are updated for each sample and the
updation of filter coefficients are saturted.
In this filter, filter coefficients are updated for each sample and
the coefficient updates are saturated.
*/

ARM_DSP_ATTRIBUTE void arm_lms_norm_q31(
Expand Down
4 changes: 1 addition & 3 deletions Source/FilteringFunctions/arm_lms_q31.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,10 @@
In order to avoid overflows completely the input signal must be scaled down by
log2(numTaps) bits.
The reference signal should not be scaled down.
After all multiply-accumulates are performed, the 2.62 accumulator is shifted
and saturated to 1.31 format to yield the final result.
The output signal and error signal are in 1.31 format.
@par
In this filter, filter coefficients are updated for each sample and
the updation of filter coefficients are saturted.
the coefficient updates are saturated.
*/

ARM_DSP_ATTRIBUTE void arm_lms_q31(
Expand Down
2 changes: 1 addition & 1 deletion Source/MatrixFunctions/arm_mat_cmplx_mult_q31.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
distorts the result. The input signals should be scaled down to avoid intermediate
overflows. The input is thus scaled down by log2(numColsA) bits
to avoid overflows, as a total of numColsA additions are performed internally.
The 2.62 accumulator is right shifted by 31 bits and saturated to 1.31 format to yield the final result.
The result is in 1.31 format.
*/
#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE)

Expand Down
6 changes: 4 additions & 2 deletions Source/MatrixFunctions/arm_mat_mult_opt_q31.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,16 @@
- \ref ARM_MATH_SIZE_MISMATCH : Matrix size check failed

@par Scaling and Overflow Behavior
The function is implemented using an internal 64-bit accumulator.
The scalar implementation uses an internal 64-bit accumulator.
The accumulator has a 2.62 format and maintains full precision of the intermediate
multiplication results but provides only a single guard bit. There is no saturation
on intermediate additions. Thus, if the accumulator overflows it wraps around and
distorts the result. The input signals should be scaled down to avoid intermediate
overflows. The input is thus scaled down by log2(numColsA) bits
to avoid overflows, as a total of numColsA additions are performed internally.
The 2.62 accumulator is right shifted by 31 bits and saturated to 1.31 format to yield the final result.
The result is in 1.31 format.
The Helium implementation may avoid some intermediate overflows, but the same scaling constraints
as for the scalar implementation should be followed.
@remark
Refer to \ref arm_mat_mult_fast_q31() for a faster but less precise implementation of this function.
@remark
Expand Down
6 changes: 4 additions & 2 deletions Source/MatrixFunctions/arm_mat_mult_q31.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,16 @@
- \ref ARM_MATH_SIZE_MISMATCH : Matrix size check failed

@par Scaling and Overflow Behavior
The function is implemented using an internal 64-bit accumulator.
The scalar implementation uses an internal 64-bit accumulator.
The accumulator has a 2.62 format and maintains full precision of the intermediate
multiplication results but provides only a single guard bit. There is no saturation
on intermediate additions. Thus, if the accumulator overflows it wraps around and
distorts the result. The input signals should be scaled down to avoid intermediate
overflows. The input is thus scaled down by log2(numColsA) bits
to avoid overflows, as a total of numColsA additions are performed internally.
The 2.62 accumulator is right shifted by 31 bits and saturated to 1.31 format to yield the final result.
The result is in 1.31 format.
The Helium implementation may avoid some intermediate overflows, but the same scaling constraints
as for the scalar implementation should be followed.
@remark
Refer to \ref arm_mat_mult_fast_q31() for a faster but less precise implementation of this function.
*/
Expand Down