Lines Matching +full:- +full:a

1 /* ----------------------------------------------------------------------
9 * Target Processor: Cortex-M and Cortex-A cores
10 * -------------------------------------------------------------------- */
12 * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved.
14 * SPDX-License-Identifier: Apache-2.0
18 * You may obtain a copy of the License at
20 * www.apache.org/licenses/LICENSE-2.0
41 @brief Variance of the elements of a Q31 vector.
47 The function is implemented using an internal 64-bit accumulator.
49 which yields 1.23, and intermediate multiplication yields a 2.46 format.
51 and as a consequence has only 16 guard bits.
55 … log2(blockSize)-8 bits, as a total of blockSize additions are performed internally.
57 … Finally, the 18.46 accumulator is right shifted by 15 bits to yield a 1.31 format value.
78 /* Compute 4 outputs at a time */ in arm_var_q31()
83 /* C = (A[0] * A[0] + A[1] * A[1] + ... + A[blockSize-1] * A[blockSize-1]) */ in arm_var_q31()
85 * and then store the result in a temporary variable, sumOfSquares. */ in arm_var_q31()
92 blkCnt --; in arm_var_q31()
103 /* C = A[0] * A[0] + A[1] * A[1] + ... + A[blockSize-1] * A[blockSize-1] */ in arm_var_q31()
104 /* C = A[0] + A[1] + ... + A[blockSize-1] */ in arm_var_q31()
107 /* Compute sum of squares and store result in a temporary variable, sumOfSquares. */ in arm_var_q31()
109 /* Compute sum and store result in a temporary variable, sum. */ in arm_var_q31()
113 blkCnt--; in arm_var_q31()
117 * and then store the result in a temporary variable, meanOfSquares. */ in arm_var_q31()
118 meanOfSquares = sumOfSquares / (q63_t) (blockSize - 1U); in arm_var_q31()
121 squareOfMean = sum * sum / (q63_t) (blockSize * (blockSize - 1U)); in arm_var_q31()
124 *pResult = asrl(meanOfSquares - squareOfMean, 15U); in arm_var_q31()
146 /* Loop unrolling: Compute 4 outputs at a time */ in arm_var_q31()
151 /* C = A[0] * A[0] + A[1] * A[1] + ... + A[blockSize-1] * A[blockSize-1] */ in arm_var_q31()
152 /* C = A[0] + A[1] + ... + A[blockSize-1] */ in arm_var_q31()
155 /* Compute sum of squares and store result in a temporary variable, sumOfSquares. */ in arm_var_q31()
157 /* Compute sum and store result in a temporary variable, sum. */ in arm_var_q31()
173 blkCnt--; in arm_var_q31()
188 /* C = A[0] * A[0] + A[1] * A[1] + ... + A[blockSize-1] * A[blockSize-1] */ in arm_var_q31()
189 /* C = A[0] + A[1] + ... + A[blockSize-1] */ in arm_var_q31()
192 /* Compute sum of squares and store result in a temporary variable, sumOfSquares. */ in arm_var_q31()
194 /* Compute sum and store result in a temporary variable, sum. */ in arm_var_q31()
198 blkCnt--; in arm_var_q31()
201 /* Compute Mean of squares and store result in a temporary variable, meanOfSquares. */ in arm_var_q31()
202 meanOfSquares = (sumOfSquares / (q63_t)(blockSize - 1U)); in arm_var_q31()
205 squareOfMean = ( sum * sum / (q63_t)(blockSize * (blockSize - 1U))); in arm_var_q31()
208 *pResult = (meanOfSquares - squareOfMean) >> 15U; in arm_var_q31()