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 Q15 vector.
47 The function is implemented using a 64-bit internal accumulator.
49 Intermediate multiplication yields a 2.30 format, and this
50 result is added without saturation to a 64-bit accumulator in 34.30 format.
54 15 bits, and then saturated to yield a result in 1.15 format.
79 /* C = (A[0] * A[0] + A[1] * A[1] + ... + A[blockSize-1] * A[blockSize-1]) */ in arm_var_q15()
81 * and then store the result in a temporary variable, sumOfSquares. */ in arm_var_q15()
86 blkCnt --; in arm_var_q15()
94 /* C = A[0] * A[0] + A[1] * A[1] + ... + A[blockSize-1] * A[blockSize-1] */ in arm_var_q15()
95 /* C = A[0] + A[1] + ... + A[blockSize-1] */ in arm_var_q15()
98 /* Compute sum of squares and store result in a temporary variable, sumOfSquares. */ in arm_var_q15()
104 /* Compute sum and store result in a temporary variable, sum. */ in arm_var_q15()
108 blkCnt--; in arm_var_q15()
112 * and then store the result in a temporary variable, meanOfSquares. */ in arm_var_q15()
113 meanOfSquares = arm_div_int64_to_int32(sumOfSquares, (blockSize - 1U)); in arm_var_q15()
116 squareOfMean = arm_div_int64_to_int32((q63_t)sum * sum, (q31_t)(blockSize * (blockSize - 1U))); in arm_var_q15()
119 *pResult = (meanOfSquares - squareOfMean) >> 15; in arm_var_q15()
145 /* Loop unrolling: Compute 4 outputs at a time */ in arm_var_q15()
150 /* C = A[0] * A[0] + A[1] * A[1] + ... + A[blockSize-1] * A[blockSize-1] */ in arm_var_q15()
151 /* C = A[0] + A[1] + ... + A[blockSize-1] */ in arm_var_q15()
153 /* Compute sum of squares and store result in a temporary variable, sumOfSquares. */ in arm_var_q15()
154 /* Compute sum and store result in a temporary variable, sum. */ in arm_var_q15()
184 blkCnt--; in arm_var_q15()
199 /* C = A[0] * A[0] + A[1] * A[1] + ... + A[blockSize-1] * A[blockSize-1] */ in arm_var_q15()
200 /* C = A[0] + A[1] + ... + A[blockSize-1] */ in arm_var_q15()
203 /* Compute sum of squares and store result in a temporary variable, sumOfSquares. */ in arm_var_q15()
209 /* Compute sum and store result in a temporary variable, sum. */ in arm_var_q15()
213 blkCnt--; in arm_var_q15()
216 /* Compute Mean of squares and store result in a temporary variable, meanOfSquares. */ in arm_var_q15()
217 meanOfSquares = (q31_t) (sumOfSquares / (q63_t)(blockSize - 1U)); in arm_var_q15()
220 squareOfMean = (q31_t) ((q63_t) sum * sum / (q63_t)(blockSize * (blockSize - 1U))); in arm_var_q15()
223 *pResult = (meanOfSquares - squareOfMean) >> 15U; in arm_var_q15()