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
arm_fir_f32.c
00001 /* ---------------------------------------------------------------------- 00002 * Copyright (C) 2010-2013 ARM Limited. All rights reserved. 00003 * 00004 * $Date: 17. January 2013 00005 * $Revision: V1.4.1 00006 * 00007 * Project: CMSIS DSP Library 00008 * Title: arm_fir_f32.c 00009 * 00010 * Description: Floating-point FIR filter processing function. 00011 * 00012 * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 00013 * 00014 * Redistribution and use in source and binary forms, with or without 00015 * modification, are permitted provided that the following conditions 00016 * are met: 00017 * - Redistributions of source code must retain the above copyright 00018 * notice, this list of conditions and the following disclaimer. 00019 * - Redistributions in binary form must reproduce the above copyright 00020 * notice, this list of conditions and the following disclaimer in 00021 * the documentation and/or other materials provided with the 00022 * distribution. 00023 * - Neither the name of ARM LIMITED nor the names of its contributors 00024 * may be used to endorse or promote products derived from this 00025 * software without specific prior written permission. 00026 * 00027 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00028 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00029 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00030 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00031 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00032 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00033 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00034 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00035 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00036 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00037 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00038 * POSSIBILITY OF SUCH DAMAGE. 00039 * -------------------------------------------------------------------- */ 00040 00041 #include "arm_math.h" 00042 00043 /** 00044 * @ingroup groupFilters 00045 */ 00046 00047 /** 00048 * @defgroup FIR Finite Impulse Response (FIR) Filters 00049 * 00050 * This set of functions implements Finite Impulse Response (FIR) filters 00051 * for Q7, Q15, Q31, and floating-point data types. Fast versions of Q15 and Q31 are also provided. 00052 * The functions operate on blocks of input and output data and each call to the function processes 00053 * <code>blockSize</code> samples through the filter. <code>pSrc</code> and 00054 * <code>pDst</code> points to input and output arrays containing <code>blockSize</code> values. 00055 * 00056 * \par Algorithm: 00057 * The FIR filter algorithm is based upon a sequence of multiply-accumulate (MAC) operations. 00058 * Each filter coefficient <code>b[n]</code> is multiplied by a state variable which equals a previous input sample <code>x[n]</code>. 00059 * <pre> 00060 * y[n] = b[0] * x[n] + b[1] * x[n-1] + b[2] * x[n-2] + ...+ b[numTaps-1] * x[n-numTaps+1] 00061 * </pre> 00062 * \par 00063 * \image html FIR.gif "Finite Impulse Response filter" 00064 * \par 00065 * <code>pCoeffs</code> points to a coefficient array of size <code>numTaps</code>. 00066 * Coefficients are stored in time reversed order. 00067 * \par 00068 * <pre> 00069 * {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]} 00070 * </pre> 00071 * \par 00072 * <code>pState</code> points to a state array of size <code>numTaps + blockSize - 1</code>. 00073 * Samples in the state buffer are stored in the following order. 00074 * \par 00075 * <pre> 00076 * {x[n-numTaps+1], x[n-numTaps], x[n-numTaps-1], x[n-numTaps-2]....x[0], x[1], ..., x[blockSize-1]} 00077 * </pre> 00078 * \par 00079 * Note that the length of the state buffer exceeds the length of the coefficient array by <code>blockSize-1</code>. 00080 * The increased state buffer length allows circular addressing, which is traditionally used in the FIR filters, 00081 * to be avoided and yields a significant speed improvement. 00082 * The state variables are updated after each block of data is processed; the coefficients are untouched. 00083 * \par Instance Structure 00084 * The coefficients and state variables for a filter are stored together in an instance data structure. 00085 * A separate instance structure must be defined for each filter. 00086 * Coefficient arrays may be shared among several instances while state variable arrays cannot be shared. 00087 * There are separate instance structure declarations for each of the 4 supported data types. 00088 * 00089 * \par Initialization Functions 00090 * There is also an associated initialization function for each data type. 00091 * The initialization function performs the following operations: 00092 * - Sets the values of the internal structure fields. 00093 * - Zeros out the values in the state buffer. 00094 * To do this manually without calling the init function, assign the follow subfields of the instance structure: 00095 * numTaps, pCoeffs, pState. Also set all of the values in pState to zero. 00096 * 00097 * \par 00098 * Use of the initialization function is optional. 00099 * However, if the initialization function is used, then the instance structure cannot be placed into a const data section. 00100 * To place an instance structure into a const data section, the instance structure must be manually initialized. 00101 * Set the values in the state buffer to zeros before static initialization. 00102 * The code below statically initializes each of the 4 different data type filter instance structures 00103 * <pre> 00104 *arm_fir_instance_f32 S = {numTaps, pState, pCoeffs}; 00105 *arm_fir_instance_q31 S = {numTaps, pState, pCoeffs}; 00106 *arm_fir_instance_q15 S = {numTaps, pState, pCoeffs}; 00107 *arm_fir_instance_q7 S = {numTaps, pState, pCoeffs}; 00108 * </pre> 00109 * 00110 * where <code>numTaps</code> is the number of filter coefficients in the filter; <code>pState</code> is the address of the state buffer; 00111 * <code>pCoeffs</code> is the address of the coefficient buffer. 00112 * 00113 * \par Fixed-Point Behavior 00114 * Care must be taken when using the fixed-point versions of the FIR filter functions. 00115 * In particular, the overflow and saturation behavior of the accumulator used in each function must be considered. 00116 * Refer to the function specific documentation below for usage guidelines. 00117 */ 00118 00119 /** 00120 * @addtogroup FIR 00121 * @{ 00122 */ 00123 00124 /** 00125 * 00126 * @param[in] *S points to an instance of the floating-point FIR filter structure. 00127 * @param[in] *pSrc points to the block of input data. 00128 * @param[out] *pDst points to the block of output data. 00129 * @param[in] blockSize number of samples to process per call. 00130 * @return none. 00131 * 00132 */ 00133 00134 #ifndef ARM_MATH_CM0_FAMILY 00135 00136 /* Run the below code for Cortex-M4 and Cortex-M3 */ 00137 00138 void arm_fir_f32( 00139 const arm_fir_instance_f32 * S, 00140 float32_t * pSrc, 00141 float32_t * pDst, 00142 uint32_t blockSize) 00143 { 00144 float32_t *pState = S->pState; /* State pointer */ 00145 float32_t *pCoeffs = S->pCoeffs; /* Coefficient pointer */ 00146 float32_t *pStateCurnt; /* Points to the current sample of the state */ 00147 float32_t *px, *pb; /* Temporary pointers for state and coefficient buffers */ 00148 float32_t acc0, acc1, acc2, acc3, acc4, acc5, acc6, acc7; /* Accumulators */ 00149 float32_t x0, x1, x2, x3, x4, x5, x6, x7, c0; /* Temporary variables to hold state and coefficient values */ 00150 uint32_t numTaps = S->numTaps; /* Number of filter coefficients in the filter */ 00151 uint32_t i, tapCnt, blkCnt; /* Loop counters */ 00152 float32_t p0,p1,p2,p3,p4,p5,p6,p7; /* Temporary product values */ 00153 00154 /* S->pState points to state array which contains previous frame (numTaps - 1) samples */ 00155 /* pStateCurnt points to the location where the new input data should be written */ 00156 pStateCurnt = &(S->pState[(numTaps - 1u)]); 00157 00158 /* Apply loop unrolling and compute 8 output values simultaneously. 00159 * The variables acc0 ... acc7 hold output values that are being computed: 00160 * 00161 * 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] 00162 * 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] 00163 * 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] 00164 * 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] 00165 */ 00166 blkCnt = blockSize >> 3; 00167 00168 /* First part of the processing with loop unrolling. Compute 8 outputs at a time. 00169 ** a second loop below computes the remaining 1 to 7 samples. */ 00170 while(blkCnt > 0u) 00171 { 00172 /* Copy four new input samples into the state buffer */ 00173 *pStateCurnt++ = *pSrc++; 00174 *pStateCurnt++ = *pSrc++; 00175 *pStateCurnt++ = *pSrc++; 00176 *pStateCurnt++ = *pSrc++; 00177 00178 /* Set all accumulators to zero */ 00179 acc0 = 0.0f; 00180 acc1 = 0.0f; 00181 acc2 = 0.0f; 00182 acc3 = 0.0f; 00183 acc4 = 0.0f; 00184 acc5 = 0.0f; 00185 acc6 = 0.0f; 00186 acc7 = 0.0f; 00187 00188 /* Initialize state pointer */ 00189 px = pState; 00190 00191 /* Initialize coeff pointer */ 00192 pb = (pCoeffs); 00193 00194 /* This is separated from the others to avoid 00195 * a call to __aeabi_memmove which would be slower 00196 */ 00197 *pStateCurnt++ = *pSrc++; 00198 *pStateCurnt++ = *pSrc++; 00199 *pStateCurnt++ = *pSrc++; 00200 *pStateCurnt++ = *pSrc++; 00201 00202 /* Read the first seven samples from the state buffer: x[n-numTaps], x[n-numTaps-1], x[n-numTaps-2] */ 00203 x0 = *px++; 00204 x1 = *px++; 00205 x2 = *px++; 00206 x3 = *px++; 00207 x4 = *px++; 00208 x5 = *px++; 00209 x6 = *px++; 00210 00211 /* Loop unrolling. Process 8 taps at a time. */ 00212 tapCnt = numTaps >> 3u; 00213 00214 /* Loop over the number of taps. Unroll by a factor of 8. 00215 ** Repeat until we've computed numTaps-8 coefficients. */ 00216 while(tapCnt > 0u) 00217 { 00218 /* Read the b[numTaps-1] coefficient */ 00219 c0 = *(pb++); 00220 00221 /* Read x[n-numTaps-3] sample */ 00222 x7 = *(px++); 00223 00224 /* acc0 += b[numTaps-1] * x[n-numTaps] */ 00225 p0 = x0 * c0; 00226 00227 /* acc1 += b[numTaps-1] * x[n-numTaps-1] */ 00228 p1 = x1 * c0; 00229 00230 /* acc2 += b[numTaps-1] * x[n-numTaps-2] */ 00231 p2 = x2 * c0; 00232 00233 /* acc3 += b[numTaps-1] * x[n-numTaps-3] */ 00234 p3 = x3 * c0; 00235 00236 /* acc4 += b[numTaps-1] * x[n-numTaps-4] */ 00237 p4 = x4 * c0; 00238 00239 /* acc1 += b[numTaps-1] * x[n-numTaps-5] */ 00240 p5 = x5 * c0; 00241 00242 /* acc2 += b[numTaps-1] * x[n-numTaps-6] */ 00243 p6 = x6 * c0; 00244 00245 /* acc3 += b[numTaps-1] * x[n-numTaps-7] */ 00246 p7 = x7 * c0; 00247 00248 /* Read the b[numTaps-2] coefficient */ 00249 c0 = *(pb++); 00250 00251 /* Read x[n-numTaps-4] sample */ 00252 x0 = *(px++); 00253 00254 acc0 += p0; 00255 acc1 += p1; 00256 acc2 += p2; 00257 acc3 += p3; 00258 acc4 += p4; 00259 acc5 += p5; 00260 acc6 += p6; 00261 acc7 += p7; 00262 00263 00264 /* Perform the multiply-accumulate */ 00265 p0 = x1 * c0; 00266 p1 = x2 * c0; 00267 p2 = x3 * c0; 00268 p3 = x4 * c0; 00269 p4 = x5 * c0; 00270 p5 = x6 * c0; 00271 p6 = x7 * c0; 00272 p7 = x0 * c0; 00273 00274 /* Read the b[numTaps-3] coefficient */ 00275 c0 = *(pb++); 00276 00277 /* Read x[n-numTaps-5] sample */ 00278 x1 = *(px++); 00279 00280 acc0 += p0; 00281 acc1 += p1; 00282 acc2 += p2; 00283 acc3 += p3; 00284 acc4 += p4; 00285 acc5 += p5; 00286 acc6 += p6; 00287 acc7 += p7; 00288 00289 /* Perform the multiply-accumulates */ 00290 p0 = x2 * c0; 00291 p1 = x3 * c0; 00292 p2 = x4 * c0; 00293 p3 = x5 * c0; 00294 p4 = x6 * c0; 00295 p5 = x7 * c0; 00296 p6 = x0 * c0; 00297 p7 = x1 * c0; 00298 00299 /* Read the b[numTaps-4] coefficient */ 00300 c0 = *(pb++); 00301 00302 /* Read x[n-numTaps-6] sample */ 00303 x2 = *(px++); 00304 00305 acc0 += p0; 00306 acc1 += p1; 00307 acc2 += p2; 00308 acc3 += p3; 00309 acc4 += p4; 00310 acc5 += p5; 00311 acc6 += p6; 00312 acc7 += p7; 00313 00314 /* Perform the multiply-accumulates */ 00315 p0 = x3 * c0; 00316 p1 = x4 * c0; 00317 p2 = x5 * c0; 00318 p3 = x6 * c0; 00319 p4 = x7 * c0; 00320 p5 = x0 * c0; 00321 p6 = x1 * c0; 00322 p7 = x2 * c0; 00323 00324 /* Read the b[numTaps-4] coefficient */ 00325 c0 = *(pb++); 00326 00327 /* Read x[n-numTaps-6] sample */ 00328 x3 = *(px++); 00329 00330 acc0 += p0; 00331 acc1 += p1; 00332 acc2 += p2; 00333 acc3 += p3; 00334 acc4 += p4; 00335 acc5 += p5; 00336 acc6 += p6; 00337 acc7 += p7; 00338 00339 /* Perform the multiply-accumulates */ 00340 p0 = x4 * c0; 00341 p1 = x5 * c0; 00342 p2 = x6 * c0; 00343 p3 = x7 * c0; 00344 p4 = x0 * c0; 00345 p5 = x1 * c0; 00346 p6 = x2 * c0; 00347 p7 = x3 * c0; 00348 00349 /* Read the b[numTaps-4] coefficient */ 00350 c0 = *(pb++); 00351 00352 /* Read x[n-numTaps-6] sample */ 00353 x4 = *(px++); 00354 00355 acc0 += p0; 00356 acc1 += p1; 00357 acc2 += p2; 00358 acc3 += p3; 00359 acc4 += p4; 00360 acc5 += p5; 00361 acc6 += p6; 00362 acc7 += p7; 00363 00364 /* Perform the multiply-accumulates */ 00365 p0 = x5 * c0; 00366 p1 = x6 * c0; 00367 p2 = x7 * c0; 00368 p3 = x0 * c0; 00369 p4 = x1 * c0; 00370 p5 = x2 * c0; 00371 p6 = x3 * c0; 00372 p7 = x4 * c0; 00373 00374 /* Read the b[numTaps-4] coefficient */ 00375 c0 = *(pb++); 00376 00377 /* Read x[n-numTaps-6] sample */ 00378 x5 = *(px++); 00379 00380 acc0 += p0; 00381 acc1 += p1; 00382 acc2 += p2; 00383 acc3 += p3; 00384 acc4 += p4; 00385 acc5 += p5; 00386 acc6 += p6; 00387 acc7 += p7; 00388 00389 /* Perform the multiply-accumulates */ 00390 p0 = x6 * c0; 00391 p1 = x7 * c0; 00392 p2 = x0 * c0; 00393 p3 = x1 * c0; 00394 p4 = x2 * c0; 00395 p5 = x3 * c0; 00396 p6 = x4 * c0; 00397 p7 = x5 * c0; 00398 00399 /* Read the b[numTaps-4] coefficient */ 00400 c0 = *(pb++); 00401 00402 /* Read x[n-numTaps-6] sample */ 00403 x6 = *(px++); 00404 00405 acc0 += p0; 00406 acc1 += p1; 00407 acc2 += p2; 00408 acc3 += p3; 00409 acc4 += p4; 00410 acc5 += p5; 00411 acc6 += p6; 00412 acc7 += p7; 00413 00414 /* Perform the multiply-accumulates */ 00415 p0 = x7 * c0; 00416 p1 = x0 * c0; 00417 p2 = x1 * c0; 00418 p3 = x2 * c0; 00419 p4 = x3 * c0; 00420 p5 = x4 * c0; 00421 p6 = x5 * c0; 00422 p7 = x6 * c0; 00423 00424 tapCnt--; 00425 00426 acc0 += p0; 00427 acc1 += p1; 00428 acc2 += p2; 00429 acc3 += p3; 00430 acc4 += p4; 00431 acc5 += p5; 00432 acc6 += p6; 00433 acc7 += p7; 00434 } 00435 00436 /* If the filter length is not a multiple of 8, compute the remaining filter taps */ 00437 tapCnt = numTaps % 0x8u; 00438 00439 while(tapCnt > 0u) 00440 { 00441 /* Read coefficients */ 00442 c0 = *(pb++); 00443 00444 /* Fetch 1 state variable */ 00445 x7 = *(px++); 00446 00447 /* Perform the multiply-accumulates */ 00448 p0 = x0 * c0; 00449 p1 = x1 * c0; 00450 p2 = x2 * c0; 00451 p3 = x3 * c0; 00452 p4 = x4 * c0; 00453 p5 = x5 * c0; 00454 p6 = x6 * c0; 00455 p7 = x7 * c0; 00456 00457 /* Reuse the present sample states for next sample */ 00458 x0 = x1; 00459 x1 = x2; 00460 x2 = x3; 00461 x3 = x4; 00462 x4 = x5; 00463 x5 = x6; 00464 x6 = x7; 00465 00466 acc0 += p0; 00467 acc1 += p1; 00468 acc2 += p2; 00469 acc3 += p3; 00470 acc4 += p4; 00471 acc5 += p5; 00472 acc6 += p6; 00473 acc7 += p7; 00474 00475 /* Decrement the loop counter */ 00476 tapCnt--; 00477 } 00478 00479 /* Advance the state pointer by 8 to process the next group of 8 samples */ 00480 pState = pState + 8; 00481 00482 /* The results in the 8 accumulators, store in the destination buffer. */ 00483 *pDst++ = acc0; 00484 *pDst++ = acc1; 00485 *pDst++ = acc2; 00486 *pDst++ = acc3; 00487 *pDst++ = acc4; 00488 *pDst++ = acc5; 00489 *pDst++ = acc6; 00490 *pDst++ = acc7; 00491 00492 blkCnt--; 00493 } 00494 00495 /* If the blockSize is not a multiple of 8, compute any remaining output samples here. 00496 ** No loop unrolling is used. */ 00497 blkCnt = blockSize % 0x8u; 00498 00499 while(blkCnt > 0u) 00500 { 00501 /* Copy one sample at a time into state buffer */ 00502 *pStateCurnt++ = *pSrc++; 00503 00504 /* Set the accumulator to zero */ 00505 acc0 = 0.0f; 00506 00507 /* Initialize state pointer */ 00508 px = pState; 00509 00510 /* Initialize Coefficient pointer */ 00511 pb = (pCoeffs); 00512 00513 i = numTaps; 00514 00515 /* Perform the multiply-accumulates */ 00516 do 00517 { 00518 acc0 += *px++ * *pb++; 00519 i--; 00520 00521 } while(i > 0u); 00522 00523 /* The result is store in the destination buffer. */ 00524 *pDst++ = acc0; 00525 00526 /* Advance state pointer by 1 for the next sample */ 00527 pState = pState + 1; 00528 00529 blkCnt--; 00530 } 00531 00532 /* Processing is complete. 00533 ** Now copy the last numTaps - 1 samples to the start of the state buffer. 00534 ** This prepares the state buffer for the next function call. */ 00535 00536 /* Points to the start of the state buffer */ 00537 pStateCurnt = S->pState; 00538 00539 tapCnt = (numTaps - 1u) >> 2u; 00540 00541 /* copy data */ 00542 while(tapCnt > 0u) 00543 { 00544 *pStateCurnt++ = *pState++; 00545 *pStateCurnt++ = *pState++; 00546 *pStateCurnt++ = *pState++; 00547 *pStateCurnt++ = *pState++; 00548 00549 /* Decrement the loop counter */ 00550 tapCnt--; 00551 } 00552 00553 /* Calculate remaining number of copies */ 00554 tapCnt = (numTaps - 1u) % 0x4u; 00555 00556 /* Copy the remaining q31_t data */ 00557 while(tapCnt > 0u) 00558 { 00559 *pStateCurnt++ = *pState++; 00560 00561 /* Decrement the loop counter */ 00562 tapCnt--; 00563 } 00564 } 00565 00566 #else 00567 00568 void arm_fir_f32( 00569 const arm_fir_instance_f32 * S, 00570 float32_t * pSrc, 00571 float32_t * pDst, 00572 uint32_t blockSize) 00573 { 00574 float32_t *pState = S->pState; /* State pointer */ 00575 float32_t *pCoeffs = S->pCoeffs; /* Coefficient pointer */ 00576 float32_t *pStateCurnt; /* Points to the current sample of the state */ 00577 float32_t *px, *pb; /* Temporary pointers for state and coefficient buffers */ 00578 uint32_t numTaps = S->numTaps; /* Number of filter coefficients in the filter */ 00579 uint32_t i, tapCnt, blkCnt; /* Loop counters */ 00580 00581 /* Run the below code for Cortex-M0 */ 00582 00583 float32_t acc; 00584 00585 /* S->pState points to state array which contains previous frame (numTaps - 1) samples */ 00586 /* pStateCurnt points to the location where the new input data should be written */ 00587 pStateCurnt = &(S->pState[(numTaps - 1u)]); 00588 00589 /* Initialize blkCnt with blockSize */ 00590 blkCnt = blockSize; 00591 00592 while(blkCnt > 0u) 00593 { 00594 /* Copy one sample at a time into state buffer */ 00595 *pStateCurnt++ = *pSrc++; 00596 00597 /* Set the accumulator to zero */ 00598 acc = 0.0f; 00599 00600 /* Initialize state pointer */ 00601 px = pState; 00602 00603 /* Initialize Coefficient pointer */ 00604 pb = pCoeffs; 00605 00606 i = numTaps; 00607 00608 /* Perform the multiply-accumulates */ 00609 do 00610 { 00611 /* acc = 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] */ 00612 acc += *px++ * *pb++; 00613 i--; 00614 00615 } while(i > 0u); 00616 00617 /* The result is store in the destination buffer. */ 00618 *pDst++ = acc; 00619 00620 /* Advance state pointer by 1 for the next sample */ 00621 pState = pState + 1; 00622 00623 blkCnt--; 00624 } 00625 00626 /* Processing is complete. 00627 ** Now copy the last numTaps - 1 samples to the starting of the state buffer. 00628 ** This prepares the state buffer for the next function call. */ 00629 00630 /* Points to the start of the state buffer */ 00631 pStateCurnt = S->pState; 00632 00633 /* Copy numTaps number of values */ 00634 tapCnt = numTaps - 1u; 00635 00636 /* Copy data */ 00637 while(tapCnt > 0u) 00638 { 00639 *pStateCurnt++ = *pState++; 00640 00641 /* Decrement the loop counter */ 00642 tapCnt--; 00643 } 00644 00645 } 00646 00647 #endif /* #ifndef ARM_MATH_CM0_FAMILY */ 00648 00649 /** 00650 * @} end of FIR group 00651 */
Generated on Tue Jul 12 2022 12:36:55 by 1.7.2