CMSIS DSP library

Dependents:   KL25Z_FFT_Demo Hat_Board_v5_1 KL25Z_FFT_Demo_tony KL25Z_FFT_Demo_tony ... more

Fork of mbed-dsp by mbed official

Committer:
mbed_official
Date:
Fri Nov 08 13:45:10 2013 +0000
Revision:
3:7a284390b0ce
Parent:
2:da51fb522205
Synchronized with git revision e69956aba2f68a2a26ac26b051f8d349deaa1ce8

Who changed what in which revision?

UserRevisionLine numberNew contents of line
emilmont 1:fdd22bb7aa52 1 /* ----------------------------------------------------------------------
mbed_official 3:7a284390b0ce 2 * Copyright (C) 2010-2013 ARM Limited. All rights reserved.
emilmont 1:fdd22bb7aa52 3 *
mbed_official 3:7a284390b0ce 4 * $Date: 17. January 2013
mbed_official 3:7a284390b0ce 5 * $Revision: V1.4.1
emilmont 1:fdd22bb7aa52 6 *
emilmont 2:da51fb522205 7 * Project: CMSIS DSP Library
emilmont 2:da51fb522205 8 * Title: arm_fir_fast_q31.c
emilmont 1:fdd22bb7aa52 9 *
emilmont 2:da51fb522205 10 * Description: Processing function for the Q31 Fast FIR filter.
emilmont 1:fdd22bb7aa52 11 *
emilmont 1:fdd22bb7aa52 12 * Target Processor: Cortex-M4/Cortex-M3
emilmont 1:fdd22bb7aa52 13 *
mbed_official 3:7a284390b0ce 14 * Redistribution and use in source and binary forms, with or without
mbed_official 3:7a284390b0ce 15 * modification, are permitted provided that the following conditions
mbed_official 3:7a284390b0ce 16 * are met:
mbed_official 3:7a284390b0ce 17 * - Redistributions of source code must retain the above copyright
mbed_official 3:7a284390b0ce 18 * notice, this list of conditions and the following disclaimer.
mbed_official 3:7a284390b0ce 19 * - Redistributions in binary form must reproduce the above copyright
mbed_official 3:7a284390b0ce 20 * notice, this list of conditions and the following disclaimer in
mbed_official 3:7a284390b0ce 21 * the documentation and/or other materials provided with the
mbed_official 3:7a284390b0ce 22 * distribution.
mbed_official 3:7a284390b0ce 23 * - Neither the name of ARM LIMITED nor the names of its contributors
mbed_official 3:7a284390b0ce 24 * may be used to endorse or promote products derived from this
mbed_official 3:7a284390b0ce 25 * software without specific prior written permission.
mbed_official 3:7a284390b0ce 26 *
mbed_official 3:7a284390b0ce 27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
mbed_official 3:7a284390b0ce 28 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
mbed_official 3:7a284390b0ce 29 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
mbed_official 3:7a284390b0ce 30 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
mbed_official 3:7a284390b0ce 31 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
mbed_official 3:7a284390b0ce 32 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
mbed_official 3:7a284390b0ce 33 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
mbed_official 3:7a284390b0ce 34 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 3:7a284390b0ce 35 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
mbed_official 3:7a284390b0ce 36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
mbed_official 3:7a284390b0ce 37 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
mbed_official 3:7a284390b0ce 38 * POSSIBILITY OF SUCH DAMAGE.
emilmont 1:fdd22bb7aa52 39 * -------------------------------------------------------------------- */
emilmont 1:fdd22bb7aa52 40
emilmont 1:fdd22bb7aa52 41 #include "arm_math.h"
emilmont 1:fdd22bb7aa52 42
emilmont 1:fdd22bb7aa52 43 /**
emilmont 1:fdd22bb7aa52 44 * @ingroup groupFilters
emilmont 1:fdd22bb7aa52 45 */
emilmont 1:fdd22bb7aa52 46
emilmont 1:fdd22bb7aa52 47 /**
emilmont 1:fdd22bb7aa52 48 * @addtogroup FIR
emilmont 1:fdd22bb7aa52 49 * @{
emilmont 1:fdd22bb7aa52 50 */
emilmont 1:fdd22bb7aa52 51
emilmont 1:fdd22bb7aa52 52 /**
emilmont 1:fdd22bb7aa52 53 * @param[in] *S points to an instance of the Q31 structure.
emilmont 1:fdd22bb7aa52 54 * @param[in] *pSrc points to the block of input data.
emilmont 1:fdd22bb7aa52 55 * @param[out] *pDst points to the block output data.
emilmont 1:fdd22bb7aa52 56 * @param[in] blockSize number of samples to process per call.
emilmont 1:fdd22bb7aa52 57 * @return none.
emilmont 1:fdd22bb7aa52 58 *
emilmont 1:fdd22bb7aa52 59 * <b>Scaling and Overflow Behavior:</b>
emilmont 1:fdd22bb7aa52 60 *
emilmont 1:fdd22bb7aa52 61 * \par
emilmont 1:fdd22bb7aa52 62 * This function is optimized for speed at the expense of fixed-point precision and overflow protection.
emilmont 1:fdd22bb7aa52 63 * The result of each 1.31 x 1.31 multiplication is truncated to 2.30 format.
emilmont 1:fdd22bb7aa52 64 * These intermediate results are added to a 2.30 accumulator.
emilmont 1:fdd22bb7aa52 65 * Finally, the accumulator is saturated and converted to a 1.31 result.
emilmont 1:fdd22bb7aa52 66 * The fast version has the same overflow behavior as the standard version and provides less precision since it discards the low 32 bits of each multiplication result.
emilmont 1:fdd22bb7aa52 67 * In order to avoid overflows completely the input signal must be scaled down by log2(numTaps) bits.
emilmont 1:fdd22bb7aa52 68 *
emilmont 1:fdd22bb7aa52 69 * \par
emilmont 1:fdd22bb7aa52 70 * Refer to the function <code>arm_fir_q31()</code> for a slower implementation of this function which uses a 64-bit accumulator to provide higher precision. Both the slow and the fast versions use the same instance structure.
emilmont 1:fdd22bb7aa52 71 * Use the function <code>arm_fir_init_q31()</code> to initialize the filter structure.
emilmont 1:fdd22bb7aa52 72 */
emilmont 1:fdd22bb7aa52 73
mbed_official 3:7a284390b0ce 74 IAR_ONLY_LOW_OPTIMIZATION_ENTER
emilmont 1:fdd22bb7aa52 75 void arm_fir_fast_q31(
emilmont 1:fdd22bb7aa52 76 const arm_fir_instance_q31 * S,
emilmont 1:fdd22bb7aa52 77 q31_t * pSrc,
emilmont 1:fdd22bb7aa52 78 q31_t * pDst,
emilmont 1:fdd22bb7aa52 79 uint32_t blockSize)
emilmont 1:fdd22bb7aa52 80 {
emilmont 1:fdd22bb7aa52 81 q31_t *pState = S->pState; /* State pointer */
emilmont 1:fdd22bb7aa52 82 q31_t *pCoeffs = S->pCoeffs; /* Coefficient pointer */
emilmont 1:fdd22bb7aa52 83 q31_t *pStateCurnt; /* Points to the current sample of the state */
emilmont 1:fdd22bb7aa52 84 q31_t x0, x1, x2, x3; /* Temporary variables to hold state */
emilmont 1:fdd22bb7aa52 85 q31_t c0; /* Temporary variable to hold coefficient value */
emilmont 1:fdd22bb7aa52 86 q31_t *px; /* Temporary pointer for state */
emilmont 1:fdd22bb7aa52 87 q31_t *pb; /* Temporary pointer for coefficient buffer */
emilmont 1:fdd22bb7aa52 88 q31_t acc0, acc1, acc2, acc3; /* Accumulators */
emilmont 1:fdd22bb7aa52 89 uint32_t numTaps = S->numTaps; /* Number of filter coefficients in the filter */
emilmont 1:fdd22bb7aa52 90 uint32_t i, tapCnt, blkCnt; /* Loop counters */
emilmont 1:fdd22bb7aa52 91
emilmont 1:fdd22bb7aa52 92 /* S->pState points to buffer which contains previous frame (numTaps - 1) samples */
emilmont 1:fdd22bb7aa52 93 /* pStateCurnt points to the location where the new input data should be written */
emilmont 1:fdd22bb7aa52 94 pStateCurnt = &(S->pState[(numTaps - 1u)]);
emilmont 1:fdd22bb7aa52 95
emilmont 1:fdd22bb7aa52 96 /* Apply loop unrolling and compute 4 output values simultaneously.
emilmont 1:fdd22bb7aa52 97 * The variables acc0 ... acc3 hold output values that are being computed:
emilmont 1:fdd22bb7aa52 98 *
emilmont 1:fdd22bb7aa52 99 * acc0 = b[numTaps-1] * x[n-numTaps-1] + b[numTaps-2] * x[n-numTaps-2] + b[numTaps-3] * x[n-numTaps-3] +...+ b[0] * x[0]
emilmont 1:fdd22bb7aa52 100 * acc1 = b[numTaps-1] * x[n-numTaps] + b[numTaps-2] * x[n-numTaps-1] + b[numTaps-3] * x[n-numTaps-2] +...+ b[0] * x[1]
emilmont 1:fdd22bb7aa52 101 * acc2 = b[numTaps-1] * x[n-numTaps+1] + b[numTaps-2] * x[n-numTaps] + b[numTaps-3] * x[n-numTaps-1] +...+ b[0] * x[2]
emilmont 1:fdd22bb7aa52 102 * acc3 = b[numTaps-1] * x[n-numTaps+2] + b[numTaps-2] * x[n-numTaps+1] + b[numTaps-3] * x[n-numTaps] +...+ b[0] * x[3]
emilmont 1:fdd22bb7aa52 103 */
emilmont 1:fdd22bb7aa52 104 blkCnt = blockSize >> 2;
emilmont 1:fdd22bb7aa52 105
emilmont 1:fdd22bb7aa52 106 /* First part of the processing with loop unrolling. Compute 4 outputs at a time.
emilmont 1:fdd22bb7aa52 107 ** a second loop below computes the remaining 1 to 3 samples. */
emilmont 1:fdd22bb7aa52 108 while(blkCnt > 0u)
emilmont 1:fdd22bb7aa52 109 {
emilmont 1:fdd22bb7aa52 110 /* Copy four new input samples into the state buffer */
emilmont 1:fdd22bb7aa52 111 *pStateCurnt++ = *pSrc++;
emilmont 1:fdd22bb7aa52 112 *pStateCurnt++ = *pSrc++;
emilmont 1:fdd22bb7aa52 113 *pStateCurnt++ = *pSrc++;
emilmont 1:fdd22bb7aa52 114 *pStateCurnt++ = *pSrc++;
emilmont 1:fdd22bb7aa52 115
emilmont 1:fdd22bb7aa52 116 /* Set all accumulators to zero */
emilmont 1:fdd22bb7aa52 117 acc0 = 0;
emilmont 1:fdd22bb7aa52 118 acc1 = 0;
emilmont 1:fdd22bb7aa52 119 acc2 = 0;
emilmont 1:fdd22bb7aa52 120 acc3 = 0;
emilmont 1:fdd22bb7aa52 121
emilmont 1:fdd22bb7aa52 122 /* Initialize state pointer */
emilmont 1:fdd22bb7aa52 123 px = pState;
emilmont 1:fdd22bb7aa52 124
emilmont 1:fdd22bb7aa52 125 /* Initialize coefficient pointer */
emilmont 1:fdd22bb7aa52 126 pb = pCoeffs;
emilmont 1:fdd22bb7aa52 127
emilmont 1:fdd22bb7aa52 128 /* Read the first three samples from the state buffer:
emilmont 1:fdd22bb7aa52 129 * x[n-numTaps], x[n-numTaps-1], x[n-numTaps-2] */
emilmont 1:fdd22bb7aa52 130 x0 = *(px++);
emilmont 1:fdd22bb7aa52 131 x1 = *(px++);
emilmont 1:fdd22bb7aa52 132 x2 = *(px++);
emilmont 1:fdd22bb7aa52 133
emilmont 1:fdd22bb7aa52 134 /* Loop unrolling. Process 4 taps at a time. */
emilmont 1:fdd22bb7aa52 135 tapCnt = numTaps >> 2;
emilmont 1:fdd22bb7aa52 136 i = tapCnt;
emilmont 1:fdd22bb7aa52 137
emilmont 1:fdd22bb7aa52 138 while(i > 0u)
emilmont 1:fdd22bb7aa52 139 {
emilmont 1:fdd22bb7aa52 140 /* Read the b[numTaps] coefficient */
emilmont 1:fdd22bb7aa52 141 c0 = *(pb++);
emilmont 1:fdd22bb7aa52 142
emilmont 1:fdd22bb7aa52 143 /* Read x[n-numTaps-3] sample */
emilmont 1:fdd22bb7aa52 144 x3 = *(px++);
emilmont 1:fdd22bb7aa52 145
emilmont 1:fdd22bb7aa52 146 /* acc0 += b[numTaps] * x[n-numTaps] */
mbed_official 3:7a284390b0ce 147 multAcc_32x32_keep32_R(acc0, x0, c0);
emilmont 1:fdd22bb7aa52 148
emilmont 1:fdd22bb7aa52 149 /* acc1 += b[numTaps] * x[n-numTaps-1] */
mbed_official 3:7a284390b0ce 150 multAcc_32x32_keep32_R(acc1, x1, c0);
emilmont 1:fdd22bb7aa52 151
emilmont 1:fdd22bb7aa52 152 /* acc2 += b[numTaps] * x[n-numTaps-2] */
mbed_official 3:7a284390b0ce 153 multAcc_32x32_keep32_R(acc2, x2, c0);
emilmont 1:fdd22bb7aa52 154
emilmont 1:fdd22bb7aa52 155 /* acc3 += b[numTaps] * x[n-numTaps-3] */
mbed_official 3:7a284390b0ce 156 multAcc_32x32_keep32_R(acc3, x3, c0);
emilmont 1:fdd22bb7aa52 157
emilmont 1:fdd22bb7aa52 158 /* Read the b[numTaps-1] coefficient */
emilmont 1:fdd22bb7aa52 159 c0 = *(pb++);
emilmont 1:fdd22bb7aa52 160
emilmont 1:fdd22bb7aa52 161 /* Read x[n-numTaps-4] sample */
emilmont 1:fdd22bb7aa52 162 x0 = *(px++);
emilmont 1:fdd22bb7aa52 163
mbed_official 3:7a284390b0ce 164 /* Perform the multiply-accumulates */
mbed_official 3:7a284390b0ce 165 multAcc_32x32_keep32_R(acc0, x1, c0);
mbed_official 3:7a284390b0ce 166 multAcc_32x32_keep32_R(acc1, x2, c0);
mbed_official 3:7a284390b0ce 167 multAcc_32x32_keep32_R(acc2, x3, c0);
mbed_official 3:7a284390b0ce 168 multAcc_32x32_keep32_R(acc3, x0, c0);
emilmont 1:fdd22bb7aa52 169
emilmont 1:fdd22bb7aa52 170 /* Read the b[numTaps-2] coefficient */
emilmont 1:fdd22bb7aa52 171 c0 = *(pb++);
emilmont 1:fdd22bb7aa52 172
emilmont 1:fdd22bb7aa52 173 /* Read x[n-numTaps-5] sample */
emilmont 1:fdd22bb7aa52 174 x1 = *(px++);
emilmont 1:fdd22bb7aa52 175
mbed_official 3:7a284390b0ce 176 /* Perform the multiply-accumulates */
mbed_official 3:7a284390b0ce 177 multAcc_32x32_keep32_R(acc0, x2, c0);
mbed_official 3:7a284390b0ce 178 multAcc_32x32_keep32_R(acc1, x3, c0);
mbed_official 3:7a284390b0ce 179 multAcc_32x32_keep32_R(acc2, x0, c0);
mbed_official 3:7a284390b0ce 180 multAcc_32x32_keep32_R(acc3, x1, c0);
emilmont 1:fdd22bb7aa52 181
emilmont 1:fdd22bb7aa52 182 /* Read the b[numTaps-3] coefficients */
emilmont 1:fdd22bb7aa52 183 c0 = *(pb++);
emilmont 1:fdd22bb7aa52 184
emilmont 1:fdd22bb7aa52 185 /* Read x[n-numTaps-6] sample */
emilmont 1:fdd22bb7aa52 186 x2 = *(px++);
emilmont 1:fdd22bb7aa52 187
mbed_official 3:7a284390b0ce 188 /* Perform the multiply-accumulates */
mbed_official 3:7a284390b0ce 189 multAcc_32x32_keep32_R(acc0, x3, c0);
mbed_official 3:7a284390b0ce 190 multAcc_32x32_keep32_R(acc1, x0, c0);
mbed_official 3:7a284390b0ce 191 multAcc_32x32_keep32_R(acc2, x1, c0);
mbed_official 3:7a284390b0ce 192 multAcc_32x32_keep32_R(acc3, x2, c0);
emilmont 1:fdd22bb7aa52 193 i--;
emilmont 1:fdd22bb7aa52 194 }
emilmont 1:fdd22bb7aa52 195
emilmont 1:fdd22bb7aa52 196 /* If the filter length is not a multiple of 4, compute the remaining filter taps */
emilmont 1:fdd22bb7aa52 197
emilmont 1:fdd22bb7aa52 198 i = numTaps - (tapCnt * 4u);
emilmont 1:fdd22bb7aa52 199 while(i > 0u)
emilmont 1:fdd22bb7aa52 200 {
emilmont 1:fdd22bb7aa52 201 /* Read coefficients */
emilmont 1:fdd22bb7aa52 202 c0 = *(pb++);
emilmont 1:fdd22bb7aa52 203
emilmont 1:fdd22bb7aa52 204 /* Fetch 1 state variable */
emilmont 1:fdd22bb7aa52 205 x3 = *(px++);
emilmont 1:fdd22bb7aa52 206
mbed_official 3:7a284390b0ce 207 /* Perform the multiply-accumulates */
mbed_official 3:7a284390b0ce 208 multAcc_32x32_keep32_R(acc0, x0, c0);
mbed_official 3:7a284390b0ce 209 multAcc_32x32_keep32_R(acc1, x1, c0);
mbed_official 3:7a284390b0ce 210 multAcc_32x32_keep32_R(acc2, x2, c0);
mbed_official 3:7a284390b0ce 211 multAcc_32x32_keep32_R(acc3, x3, c0);
emilmont 1:fdd22bb7aa52 212
emilmont 1:fdd22bb7aa52 213 /* Reuse the present sample states for next sample */
emilmont 1:fdd22bb7aa52 214 x0 = x1;
emilmont 1:fdd22bb7aa52 215 x1 = x2;
emilmont 1:fdd22bb7aa52 216 x2 = x3;
emilmont 1:fdd22bb7aa52 217
emilmont 1:fdd22bb7aa52 218 /* Decrement the loop counter */
emilmont 1:fdd22bb7aa52 219 i--;
emilmont 1:fdd22bb7aa52 220 }
emilmont 1:fdd22bb7aa52 221
emilmont 1:fdd22bb7aa52 222 /* Advance the state pointer by 4 to process the next group of 4 samples */
emilmont 1:fdd22bb7aa52 223 pState = pState + 4;
emilmont 1:fdd22bb7aa52 224
emilmont 1:fdd22bb7aa52 225 /* The results in the 4 accumulators are in 2.30 format. Convert to 1.31
emilmont 1:fdd22bb7aa52 226 ** Then store the 4 outputs in the destination buffer. */
emilmont 1:fdd22bb7aa52 227 *pDst++ = (q31_t) (acc0 << 1);
emilmont 1:fdd22bb7aa52 228 *pDst++ = (q31_t) (acc1 << 1);
emilmont 1:fdd22bb7aa52 229 *pDst++ = (q31_t) (acc2 << 1);
emilmont 1:fdd22bb7aa52 230 *pDst++ = (q31_t) (acc3 << 1);
emilmont 1:fdd22bb7aa52 231
emilmont 1:fdd22bb7aa52 232 /* Decrement the samples loop counter */
emilmont 1:fdd22bb7aa52 233 blkCnt--;
emilmont 1:fdd22bb7aa52 234 }
emilmont 1:fdd22bb7aa52 235
emilmont 1:fdd22bb7aa52 236
emilmont 1:fdd22bb7aa52 237 /* If the blockSize is not a multiple of 4, compute any remaining output samples here.
emilmont 1:fdd22bb7aa52 238 ** No loop unrolling is used. */
emilmont 1:fdd22bb7aa52 239 blkCnt = blockSize % 4u;
emilmont 1:fdd22bb7aa52 240
emilmont 1:fdd22bb7aa52 241 while(blkCnt > 0u)
emilmont 1:fdd22bb7aa52 242 {
emilmont 1:fdd22bb7aa52 243 /* Copy one sample at a time into state buffer */
emilmont 1:fdd22bb7aa52 244 *pStateCurnt++ = *pSrc++;
emilmont 1:fdd22bb7aa52 245
emilmont 1:fdd22bb7aa52 246 /* Set the accumulator to zero */
emilmont 1:fdd22bb7aa52 247 acc0 = 0;
emilmont 1:fdd22bb7aa52 248
emilmont 1:fdd22bb7aa52 249 /* Initialize state pointer */
emilmont 1:fdd22bb7aa52 250 px = pState;
emilmont 1:fdd22bb7aa52 251
emilmont 1:fdd22bb7aa52 252 /* Initialize Coefficient pointer */
emilmont 1:fdd22bb7aa52 253 pb = (pCoeffs);
emilmont 1:fdd22bb7aa52 254
emilmont 1:fdd22bb7aa52 255 i = numTaps;
emilmont 1:fdd22bb7aa52 256
emilmont 1:fdd22bb7aa52 257 /* Perform the multiply-accumulates */
emilmont 1:fdd22bb7aa52 258 do
emilmont 1:fdd22bb7aa52 259 {
mbed_official 3:7a284390b0ce 260 multAcc_32x32_keep32_R(acc0, (*px++), (*(pb++)));
emilmont 1:fdd22bb7aa52 261 i--;
emilmont 1:fdd22bb7aa52 262 } while(i > 0u);
emilmont 1:fdd22bb7aa52 263
emilmont 1:fdd22bb7aa52 264 /* The result is in 2.30 format. Convert to 1.31
emilmont 1:fdd22bb7aa52 265 ** Then store the output in the destination buffer. */
emilmont 1:fdd22bb7aa52 266 *pDst++ = (q31_t) (acc0 << 1);
emilmont 1:fdd22bb7aa52 267
emilmont 1:fdd22bb7aa52 268 /* Advance state pointer by 1 for the next sample */
emilmont 1:fdd22bb7aa52 269 pState = pState + 1;
emilmont 1:fdd22bb7aa52 270
emilmont 1:fdd22bb7aa52 271 /* Decrement the samples loop counter */
emilmont 1:fdd22bb7aa52 272 blkCnt--;
emilmont 1:fdd22bb7aa52 273 }
emilmont 1:fdd22bb7aa52 274
emilmont 1:fdd22bb7aa52 275 /* Processing is complete.
mbed_official 3:7a284390b0ce 276 ** Now copy the last numTaps - 1 samples to the start of the state buffer.
emilmont 1:fdd22bb7aa52 277 ** This prepares the state buffer for the next function call. */
emilmont 1:fdd22bb7aa52 278
emilmont 1:fdd22bb7aa52 279 /* Points to the start of the state buffer */
emilmont 1:fdd22bb7aa52 280 pStateCurnt = S->pState;
emilmont 1:fdd22bb7aa52 281
emilmont 1:fdd22bb7aa52 282 /* Calculate remaining number of copies */
mbed_official 3:7a284390b0ce 283 tapCnt = (numTaps - 1u);
emilmont 1:fdd22bb7aa52 284
emilmont 1:fdd22bb7aa52 285 /* Copy the remaining q31_t data */
emilmont 1:fdd22bb7aa52 286 while(tapCnt > 0u)
emilmont 1:fdd22bb7aa52 287 {
emilmont 1:fdd22bb7aa52 288 *pStateCurnt++ = *pState++;
emilmont 1:fdd22bb7aa52 289
emilmont 1:fdd22bb7aa52 290 /* Decrement the loop counter */
emilmont 1:fdd22bb7aa52 291 tapCnt--;
emilmont 1:fdd22bb7aa52 292 }
emilmont 1:fdd22bb7aa52 293
emilmont 1:fdd22bb7aa52 294
emilmont 1:fdd22bb7aa52 295 }
mbed_official 3:7a284390b0ce 296 IAR_ONLY_LOW_OPTIMIZATION_EXIT
emilmont 1:fdd22bb7aa52 297 /**
emilmont 1:fdd22bb7aa52 298 * @} end of FIR group
emilmont 1:fdd22bb7aa52 299 */