diff --git a/Source/FilteringFunctions/arm_conv_q31.c b/Source/FilteringFunctions/arm_conv_q31.c index adefa2ae6..a9d66b256 100644 --- a/Source/FilteringFunctions/arm_conv_q31.c +++ b/Source/FilteringFunctions/arm_conv_q31.c @@ -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. diff --git a/Source/FilteringFunctions/arm_correlate_q31.c b/Source/FilteringFunctions/arm_correlate_q31.c index 46270e23d..e3a09468a 100644 --- a/Source/FilteringFunctions/arm_correlate_q31.c +++ b/Source/FilteringFunctions/arm_correlate_q31.c @@ -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. diff --git a/Source/FilteringFunctions/arm_fir_decimate_q31.c b/Source/FilteringFunctions/arm_fir_decimate_q31.c index 751fa12ce..bfadbd1ca 100644 --- a/Source/FilteringFunctions/arm_fir_decimate_q31.c +++ b/Source/FilteringFunctions/arm_fir_decimate_q31.c @@ -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. diff --git a/Source/FilteringFunctions/arm_fir_interpolate_q31.c b/Source/FilteringFunctions/arm_fir_interpolate_q31.c index 259a2ff4d..749c672bf 100644 --- a/Source/FilteringFunctions/arm_fir_interpolate_q31.c +++ b/Source/FilteringFunctions/arm_fir_interpolate_q31.c @@ -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 1/(numTaps/L). since numTaps/L 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) diff --git a/Source/FilteringFunctions/arm_fir_q31.c b/Source/FilteringFunctions/arm_fir_q31.c index 421fbdab3..c013d014b 100644 --- a/Source/FilteringFunctions/arm_fir_q31.c +++ b/Source/FilteringFunctions/arm_fir_q31.c @@ -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. diff --git a/Source/FilteringFunctions/arm_lms_norm_q31.c b/Source/FilteringFunctions/arm_lms_norm_q31.c index db94dd193..4e4904f45 100644 --- a/Source/FilteringFunctions/arm_lms_norm_q31.c +++ b/Source/FilteringFunctions/arm_lms_norm_q31.c @@ -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( diff --git a/Source/FilteringFunctions/arm_lms_q31.c b/Source/FilteringFunctions/arm_lms_q31.c index 0fae211dc..08c2e3546 100644 --- a/Source/FilteringFunctions/arm_lms_q31.c +++ b/Source/FilteringFunctions/arm_lms_q31.c @@ -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( diff --git a/Source/MatrixFunctions/arm_mat_cmplx_mult_q31.c b/Source/MatrixFunctions/arm_mat_cmplx_mult_q31.c index 9cb461003..3dcabe832 100644 --- a/Source/MatrixFunctions/arm_mat_cmplx_mult_q31.c +++ b/Source/MatrixFunctions/arm_mat_cmplx_mult_q31.c @@ -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) diff --git a/Source/MatrixFunctions/arm_mat_mult_opt_q31.c b/Source/MatrixFunctions/arm_mat_mult_opt_q31.c index 40ce25887..7ace9fa77 100755 --- a/Source/MatrixFunctions/arm_mat_mult_opt_q31.c +++ b/Source/MatrixFunctions/arm_mat_mult_opt_q31.c @@ -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 diff --git a/Source/MatrixFunctions/arm_mat_mult_q31.c b/Source/MatrixFunctions/arm_mat_mult_q31.c index 27e578dba..178afd7ad 100644 --- a/Source/MatrixFunctions/arm_mat_mult_q31.c +++ b/Source/MatrixFunctions/arm_mat_mult_q31.c @@ -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. */