The CMSIS DSP 5 library

Dependents:   Nucleo-Heart-Rate ejercicioVrms2 PROYECTOFINAL ejercicioVrms ... more

Committer:
xorjoep
Date:
Thu Jun 21 11:56:27 2018 +0000
Revision:
3:4098b9d3d571
Parent:
1:24714b45cd1b
headers is a folder not a library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
xorjoep 1:24714b45cd1b 1 /* ----------------------------------------------------------------------
xorjoep 1:24714b45cd1b 2 * Project: CMSIS DSP Library
xorjoep 1:24714b45cd1b 3 * Title: arm_cfft_q15.c
xorjoep 1:24714b45cd1b 4 * Description: Combined Radix Decimation in Q15 Frequency CFFT processing function
xorjoep 1:24714b45cd1b 5 *
xorjoep 1:24714b45cd1b 6 * $Date: 27. January 2017
xorjoep 1:24714b45cd1b 7 * $Revision: V.1.5.1
xorjoep 1:24714b45cd1b 8 *
xorjoep 1:24714b45cd1b 9 * Target Processor: Cortex-M cores
xorjoep 1:24714b45cd1b 10 * -------------------------------------------------------------------- */
xorjoep 1:24714b45cd1b 11 /*
xorjoep 1:24714b45cd1b 12 * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved.
xorjoep 1:24714b45cd1b 13 *
xorjoep 1:24714b45cd1b 14 * SPDX-License-Identifier: Apache-2.0
xorjoep 1:24714b45cd1b 15 *
xorjoep 1:24714b45cd1b 16 * Licensed under the Apache License, Version 2.0 (the License); you may
xorjoep 1:24714b45cd1b 17 * not use this file except in compliance with the License.
xorjoep 1:24714b45cd1b 18 * You may obtain a copy of the License at
xorjoep 1:24714b45cd1b 19 *
xorjoep 1:24714b45cd1b 20 * www.apache.org/licenses/LICENSE-2.0
xorjoep 1:24714b45cd1b 21 *
xorjoep 1:24714b45cd1b 22 * Unless required by applicable law or agreed to in writing, software
xorjoep 1:24714b45cd1b 23 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
xorjoep 1:24714b45cd1b 24 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
xorjoep 1:24714b45cd1b 25 * See the License for the specific language governing permissions and
xorjoep 1:24714b45cd1b 26 * limitations under the License.
xorjoep 1:24714b45cd1b 27 */
xorjoep 1:24714b45cd1b 28
xorjoep 1:24714b45cd1b 29 #include "arm_math.h"
xorjoep 1:24714b45cd1b 30
xorjoep 1:24714b45cd1b 31 extern void arm_radix4_butterfly_q15(
xorjoep 1:24714b45cd1b 32 q15_t * pSrc,
xorjoep 1:24714b45cd1b 33 uint32_t fftLen,
xorjoep 1:24714b45cd1b 34 q15_t * pCoef,
xorjoep 1:24714b45cd1b 35 uint32_t twidCoefModifier);
xorjoep 1:24714b45cd1b 36
xorjoep 1:24714b45cd1b 37 extern void arm_radix4_butterfly_inverse_q15(
xorjoep 1:24714b45cd1b 38 q15_t * pSrc,
xorjoep 1:24714b45cd1b 39 uint32_t fftLen,
xorjoep 1:24714b45cd1b 40 q15_t * pCoef,
xorjoep 1:24714b45cd1b 41 uint32_t twidCoefModifier);
xorjoep 1:24714b45cd1b 42
xorjoep 1:24714b45cd1b 43 extern void arm_bitreversal_16(
xorjoep 1:24714b45cd1b 44 uint16_t * pSrc,
xorjoep 1:24714b45cd1b 45 const uint16_t bitRevLen,
xorjoep 1:24714b45cd1b 46 const uint16_t * pBitRevTable);
xorjoep 1:24714b45cd1b 47
xorjoep 1:24714b45cd1b 48 void arm_cfft_radix4by2_q15(
xorjoep 1:24714b45cd1b 49 q15_t * pSrc,
xorjoep 1:24714b45cd1b 50 uint32_t fftLen,
xorjoep 1:24714b45cd1b 51 const q15_t * pCoef);
xorjoep 1:24714b45cd1b 52
xorjoep 1:24714b45cd1b 53 void arm_cfft_radix4by2_inverse_q15(
xorjoep 1:24714b45cd1b 54 q15_t * pSrc,
xorjoep 1:24714b45cd1b 55 uint32_t fftLen,
xorjoep 1:24714b45cd1b 56 const q15_t * pCoef);
xorjoep 1:24714b45cd1b 57
xorjoep 1:24714b45cd1b 58 /**
xorjoep 1:24714b45cd1b 59 * @ingroup groupTransforms
xorjoep 1:24714b45cd1b 60 */
xorjoep 1:24714b45cd1b 61
xorjoep 1:24714b45cd1b 62 /**
xorjoep 1:24714b45cd1b 63 * @addtogroup ComplexFFT
xorjoep 1:24714b45cd1b 64 * @{
xorjoep 1:24714b45cd1b 65 */
xorjoep 1:24714b45cd1b 66
xorjoep 1:24714b45cd1b 67 /**
xorjoep 1:24714b45cd1b 68 * @details
xorjoep 1:24714b45cd1b 69 * @brief Processing function for the Q15 complex FFT.
xorjoep 1:24714b45cd1b 70 * @param[in] *S points to an instance of the Q15 CFFT structure.
xorjoep 1:24714b45cd1b 71 * @param[in, out] *p1 points to the complex data buffer of size <code>2*fftLen</code>. Processing occurs in-place.
xorjoep 1:24714b45cd1b 72 * @param[in] ifftFlag flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform.
xorjoep 1:24714b45cd1b 73 * @param[in] bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output.
xorjoep 1:24714b45cd1b 74 * @return none.
xorjoep 1:24714b45cd1b 75 */
xorjoep 1:24714b45cd1b 76
xorjoep 1:24714b45cd1b 77 void arm_cfft_q15(
xorjoep 1:24714b45cd1b 78 const arm_cfft_instance_q15 * S,
xorjoep 1:24714b45cd1b 79 q15_t * p1,
xorjoep 1:24714b45cd1b 80 uint8_t ifftFlag,
xorjoep 1:24714b45cd1b 81 uint8_t bitReverseFlag)
xorjoep 1:24714b45cd1b 82 {
xorjoep 1:24714b45cd1b 83 uint32_t L = S->fftLen;
xorjoep 1:24714b45cd1b 84
xorjoep 1:24714b45cd1b 85 if (ifftFlag == 1U)
xorjoep 1:24714b45cd1b 86 {
xorjoep 1:24714b45cd1b 87 switch (L)
xorjoep 1:24714b45cd1b 88 {
xorjoep 1:24714b45cd1b 89 case 16:
xorjoep 1:24714b45cd1b 90 case 64:
xorjoep 1:24714b45cd1b 91 case 256:
xorjoep 1:24714b45cd1b 92 case 1024:
xorjoep 1:24714b45cd1b 93 case 4096:
xorjoep 1:24714b45cd1b 94 arm_radix4_butterfly_inverse_q15 ( p1, L, (q15_t*)S->pTwiddle, 1 );
xorjoep 1:24714b45cd1b 95 break;
xorjoep 1:24714b45cd1b 96
xorjoep 1:24714b45cd1b 97 case 32:
xorjoep 1:24714b45cd1b 98 case 128:
xorjoep 1:24714b45cd1b 99 case 512:
xorjoep 1:24714b45cd1b 100 case 2048:
xorjoep 1:24714b45cd1b 101 arm_cfft_radix4by2_inverse_q15 ( p1, L, S->pTwiddle );
xorjoep 1:24714b45cd1b 102 break;
xorjoep 1:24714b45cd1b 103 }
xorjoep 1:24714b45cd1b 104 }
xorjoep 1:24714b45cd1b 105 else
xorjoep 1:24714b45cd1b 106 {
xorjoep 1:24714b45cd1b 107 switch (L)
xorjoep 1:24714b45cd1b 108 {
xorjoep 1:24714b45cd1b 109 case 16:
xorjoep 1:24714b45cd1b 110 case 64:
xorjoep 1:24714b45cd1b 111 case 256:
xorjoep 1:24714b45cd1b 112 case 1024:
xorjoep 1:24714b45cd1b 113 case 4096:
xorjoep 1:24714b45cd1b 114 arm_radix4_butterfly_q15 ( p1, L, (q15_t*)S->pTwiddle, 1 );
xorjoep 1:24714b45cd1b 115 break;
xorjoep 1:24714b45cd1b 116
xorjoep 1:24714b45cd1b 117 case 32:
xorjoep 1:24714b45cd1b 118 case 128:
xorjoep 1:24714b45cd1b 119 case 512:
xorjoep 1:24714b45cd1b 120 case 2048:
xorjoep 1:24714b45cd1b 121 arm_cfft_radix4by2_q15 ( p1, L, S->pTwiddle );
xorjoep 1:24714b45cd1b 122 break;
xorjoep 1:24714b45cd1b 123 }
xorjoep 1:24714b45cd1b 124 }
xorjoep 1:24714b45cd1b 125
xorjoep 1:24714b45cd1b 126 if ( bitReverseFlag )
xorjoep 1:24714b45cd1b 127 arm_bitreversal_16((uint16_t*)p1,S->bitRevLength,S->pBitRevTable);
xorjoep 1:24714b45cd1b 128 }
xorjoep 1:24714b45cd1b 129
xorjoep 1:24714b45cd1b 130 /**
xorjoep 1:24714b45cd1b 131 * @} end of ComplexFFT group
xorjoep 1:24714b45cd1b 132 */
xorjoep 1:24714b45cd1b 133
xorjoep 1:24714b45cd1b 134 void arm_cfft_radix4by2_q15(
xorjoep 1:24714b45cd1b 135 q15_t * pSrc,
xorjoep 1:24714b45cd1b 136 uint32_t fftLen,
xorjoep 1:24714b45cd1b 137 const q15_t * pCoef)
xorjoep 1:24714b45cd1b 138 {
xorjoep 1:24714b45cd1b 139 uint32_t i;
xorjoep 1:24714b45cd1b 140 uint32_t n2;
xorjoep 1:24714b45cd1b 141 q15_t p0, p1, p2, p3;
xorjoep 1:24714b45cd1b 142 #if defined (ARM_MATH_DSP)
xorjoep 1:24714b45cd1b 143 q31_t T, S, R;
xorjoep 1:24714b45cd1b 144 q31_t coeff, out1, out2;
xorjoep 1:24714b45cd1b 145 const q15_t *pC = pCoef;
xorjoep 1:24714b45cd1b 146 q15_t *pSi = pSrc;
xorjoep 1:24714b45cd1b 147 q15_t *pSl = pSrc + fftLen;
xorjoep 1:24714b45cd1b 148 #else
xorjoep 1:24714b45cd1b 149 uint32_t ia, l;
xorjoep 1:24714b45cd1b 150 q15_t xt, yt, cosVal, sinVal;
xorjoep 1:24714b45cd1b 151 #endif
xorjoep 1:24714b45cd1b 152
xorjoep 1:24714b45cd1b 153 n2 = fftLen >> 1;
xorjoep 1:24714b45cd1b 154
xorjoep 1:24714b45cd1b 155 #if defined (ARM_MATH_DSP)
xorjoep 1:24714b45cd1b 156
xorjoep 1:24714b45cd1b 157 for (i = n2; i > 0; i--)
xorjoep 1:24714b45cd1b 158 {
xorjoep 1:24714b45cd1b 159 coeff = _SIMD32_OFFSET(pC);
xorjoep 1:24714b45cd1b 160 pC += 2;
xorjoep 1:24714b45cd1b 161
xorjoep 1:24714b45cd1b 162 T = _SIMD32_OFFSET(pSi);
xorjoep 1:24714b45cd1b 163 T = __SHADD16(T, 0); // this is just a SIMD arithmetic shift right by 1
xorjoep 1:24714b45cd1b 164
xorjoep 1:24714b45cd1b 165 S = _SIMD32_OFFSET(pSl);
xorjoep 1:24714b45cd1b 166 S = __SHADD16(S, 0); // this is just a SIMD arithmetic shift right by 1
xorjoep 1:24714b45cd1b 167
xorjoep 1:24714b45cd1b 168 R = __QSUB16(T, S);
xorjoep 1:24714b45cd1b 169
xorjoep 1:24714b45cd1b 170 _SIMD32_OFFSET(pSi) = __SHADD16(T, S);
xorjoep 1:24714b45cd1b 171 pSi += 2;
xorjoep 1:24714b45cd1b 172
xorjoep 1:24714b45cd1b 173 #ifndef ARM_MATH_BIG_ENDIAN
xorjoep 1:24714b45cd1b 174
xorjoep 1:24714b45cd1b 175 out1 = __SMUAD(coeff, R) >> 16;
xorjoep 1:24714b45cd1b 176 out2 = __SMUSDX(coeff, R);
xorjoep 1:24714b45cd1b 177
xorjoep 1:24714b45cd1b 178 #else
xorjoep 1:24714b45cd1b 179
xorjoep 1:24714b45cd1b 180 out1 = __SMUSDX(R, coeff) >> 16U;
xorjoep 1:24714b45cd1b 181 out2 = __SMUAD(coeff, R);
xorjoep 1:24714b45cd1b 182
xorjoep 1:24714b45cd1b 183 #endif // #ifndef ARM_MATH_BIG_ENDIAN
xorjoep 1:24714b45cd1b 184
xorjoep 1:24714b45cd1b 185 _SIMD32_OFFSET(pSl) =
xorjoep 1:24714b45cd1b 186 (q31_t) ((out2) & 0xFFFF0000) | (out1 & 0x0000FFFF);
xorjoep 1:24714b45cd1b 187 pSl += 2;
xorjoep 1:24714b45cd1b 188 }
xorjoep 1:24714b45cd1b 189
xorjoep 1:24714b45cd1b 190 #else // #if defined (ARM_MATH_DSP)
xorjoep 1:24714b45cd1b 191
xorjoep 1:24714b45cd1b 192 ia = 0;
xorjoep 1:24714b45cd1b 193 for (i = 0; i < n2; i++)
xorjoep 1:24714b45cd1b 194 {
xorjoep 1:24714b45cd1b 195 cosVal = pCoef[ia * 2];
xorjoep 1:24714b45cd1b 196 sinVal = pCoef[(ia * 2) + 1];
xorjoep 1:24714b45cd1b 197 ia++;
xorjoep 1:24714b45cd1b 198
xorjoep 1:24714b45cd1b 199 l = i + n2;
xorjoep 1:24714b45cd1b 200
xorjoep 1:24714b45cd1b 201 xt = (pSrc[2 * i] >> 1U) - (pSrc[2 * l] >> 1U);
xorjoep 1:24714b45cd1b 202 pSrc[2 * i] = ((pSrc[2 * i] >> 1U) + (pSrc[2 * l] >> 1U)) >> 1U;
xorjoep 1:24714b45cd1b 203
xorjoep 1:24714b45cd1b 204 yt = (pSrc[2 * i + 1] >> 1U) - (pSrc[2 * l + 1] >> 1U);
xorjoep 1:24714b45cd1b 205 pSrc[2 * i + 1] =
xorjoep 1:24714b45cd1b 206 ((pSrc[2 * l + 1] >> 1U) + (pSrc[2 * i + 1] >> 1U)) >> 1U;
xorjoep 1:24714b45cd1b 207
xorjoep 1:24714b45cd1b 208 pSrc[2U * l] = (((int16_t) (((q31_t) xt * cosVal) >> 16)) +
xorjoep 1:24714b45cd1b 209 ((int16_t) (((q31_t) yt * sinVal) >> 16)));
xorjoep 1:24714b45cd1b 210
xorjoep 1:24714b45cd1b 211 pSrc[2U * l + 1U] = (((int16_t) (((q31_t) yt * cosVal) >> 16)) -
xorjoep 1:24714b45cd1b 212 ((int16_t) (((q31_t) xt * sinVal) >> 16)));
xorjoep 1:24714b45cd1b 213 }
xorjoep 1:24714b45cd1b 214
xorjoep 1:24714b45cd1b 215 #endif // #if defined (ARM_MATH_DSP)
xorjoep 1:24714b45cd1b 216
xorjoep 1:24714b45cd1b 217 // first col
xorjoep 1:24714b45cd1b 218 arm_radix4_butterfly_q15( pSrc, n2, (q15_t*)pCoef, 2U);
xorjoep 1:24714b45cd1b 219 // second col
xorjoep 1:24714b45cd1b 220 arm_radix4_butterfly_q15( pSrc + fftLen, n2, (q15_t*)pCoef, 2U);
xorjoep 1:24714b45cd1b 221
xorjoep 1:24714b45cd1b 222 for (i = 0; i < fftLen >> 1; i++)
xorjoep 1:24714b45cd1b 223 {
xorjoep 1:24714b45cd1b 224 p0 = pSrc[4*i+0];
xorjoep 1:24714b45cd1b 225 p1 = pSrc[4*i+1];
xorjoep 1:24714b45cd1b 226 p2 = pSrc[4*i+2];
xorjoep 1:24714b45cd1b 227 p3 = pSrc[4*i+3];
xorjoep 1:24714b45cd1b 228
xorjoep 1:24714b45cd1b 229 p0 <<= 1;
xorjoep 1:24714b45cd1b 230 p1 <<= 1;
xorjoep 1:24714b45cd1b 231 p2 <<= 1;
xorjoep 1:24714b45cd1b 232 p3 <<= 1;
xorjoep 1:24714b45cd1b 233
xorjoep 1:24714b45cd1b 234 pSrc[4*i+0] = p0;
xorjoep 1:24714b45cd1b 235 pSrc[4*i+1] = p1;
xorjoep 1:24714b45cd1b 236 pSrc[4*i+2] = p2;
xorjoep 1:24714b45cd1b 237 pSrc[4*i+3] = p3;
xorjoep 1:24714b45cd1b 238 }
xorjoep 1:24714b45cd1b 239 }
xorjoep 1:24714b45cd1b 240
xorjoep 1:24714b45cd1b 241 void arm_cfft_radix4by2_inverse_q15(
xorjoep 1:24714b45cd1b 242 q15_t * pSrc,
xorjoep 1:24714b45cd1b 243 uint32_t fftLen,
xorjoep 1:24714b45cd1b 244 const q15_t * pCoef)
xorjoep 1:24714b45cd1b 245 {
xorjoep 1:24714b45cd1b 246 uint32_t i;
xorjoep 1:24714b45cd1b 247 uint32_t n2;
xorjoep 1:24714b45cd1b 248 q15_t p0, p1, p2, p3;
xorjoep 1:24714b45cd1b 249 #if defined (ARM_MATH_DSP)
xorjoep 1:24714b45cd1b 250 q31_t T, S, R;
xorjoep 1:24714b45cd1b 251 q31_t coeff, out1, out2;
xorjoep 1:24714b45cd1b 252 const q15_t *pC = pCoef;
xorjoep 1:24714b45cd1b 253 q15_t *pSi = pSrc;
xorjoep 1:24714b45cd1b 254 q15_t *pSl = pSrc + fftLen;
xorjoep 1:24714b45cd1b 255 #else
xorjoep 1:24714b45cd1b 256 uint32_t ia, l;
xorjoep 1:24714b45cd1b 257 q15_t xt, yt, cosVal, sinVal;
xorjoep 1:24714b45cd1b 258 #endif
xorjoep 1:24714b45cd1b 259
xorjoep 1:24714b45cd1b 260 n2 = fftLen >> 1;
xorjoep 1:24714b45cd1b 261
xorjoep 1:24714b45cd1b 262 #if defined (ARM_MATH_DSP)
xorjoep 1:24714b45cd1b 263
xorjoep 1:24714b45cd1b 264 for (i = n2; i > 0; i--)
xorjoep 1:24714b45cd1b 265 {
xorjoep 1:24714b45cd1b 266 coeff = _SIMD32_OFFSET(pC);
xorjoep 1:24714b45cd1b 267 pC += 2;
xorjoep 1:24714b45cd1b 268
xorjoep 1:24714b45cd1b 269 T = _SIMD32_OFFSET(pSi);
xorjoep 1:24714b45cd1b 270 T = __SHADD16(T, 0); // this is just a SIMD arithmetic shift right by 1
xorjoep 1:24714b45cd1b 271
xorjoep 1:24714b45cd1b 272 S = _SIMD32_OFFSET(pSl);
xorjoep 1:24714b45cd1b 273 S = __SHADD16(S, 0); // this is just a SIMD arithmetic shift right by 1
xorjoep 1:24714b45cd1b 274
xorjoep 1:24714b45cd1b 275 R = __QSUB16(T, S);
xorjoep 1:24714b45cd1b 276
xorjoep 1:24714b45cd1b 277 _SIMD32_OFFSET(pSi) = __SHADD16(T, S);
xorjoep 1:24714b45cd1b 278 pSi += 2;
xorjoep 1:24714b45cd1b 279
xorjoep 1:24714b45cd1b 280 #ifndef ARM_MATH_BIG_ENDIAN
xorjoep 1:24714b45cd1b 281
xorjoep 1:24714b45cd1b 282 out1 = __SMUSD(coeff, R) >> 16;
xorjoep 1:24714b45cd1b 283 out2 = __SMUADX(coeff, R);
xorjoep 1:24714b45cd1b 284 #else
xorjoep 1:24714b45cd1b 285
xorjoep 1:24714b45cd1b 286 out1 = __SMUADX(R, coeff) >> 16U;
xorjoep 1:24714b45cd1b 287 out2 = __SMUSD(__QSUB(0, coeff), R);
xorjoep 1:24714b45cd1b 288
xorjoep 1:24714b45cd1b 289 #endif // #ifndef ARM_MATH_BIG_ENDIAN
xorjoep 1:24714b45cd1b 290
xorjoep 1:24714b45cd1b 291 _SIMD32_OFFSET(pSl) =
xorjoep 1:24714b45cd1b 292 (q31_t) ((out2) & 0xFFFF0000) | (out1 & 0x0000FFFF);
xorjoep 1:24714b45cd1b 293 pSl += 2;
xorjoep 1:24714b45cd1b 294 }
xorjoep 1:24714b45cd1b 295
xorjoep 1:24714b45cd1b 296 #else // #if defined (ARM_MATH_DSP)
xorjoep 1:24714b45cd1b 297
xorjoep 1:24714b45cd1b 298 ia = 0;
xorjoep 1:24714b45cd1b 299 for (i = 0; i < n2; i++)
xorjoep 1:24714b45cd1b 300 {
xorjoep 1:24714b45cd1b 301 cosVal = pCoef[ia * 2];
xorjoep 1:24714b45cd1b 302 sinVal = pCoef[(ia * 2) + 1];
xorjoep 1:24714b45cd1b 303 ia++;
xorjoep 1:24714b45cd1b 304
xorjoep 1:24714b45cd1b 305 l = i + n2;
xorjoep 1:24714b45cd1b 306 xt = (pSrc[2 * i] >> 1U) - (pSrc[2 * l] >> 1U);
xorjoep 1:24714b45cd1b 307 pSrc[2 * i] = ((pSrc[2 * i] >> 1U) + (pSrc[2 * l] >> 1U)) >> 1U;
xorjoep 1:24714b45cd1b 308
xorjoep 1:24714b45cd1b 309 yt = (pSrc[2 * i + 1] >> 1U) - (pSrc[2 * l + 1] >> 1U);
xorjoep 1:24714b45cd1b 310 pSrc[2 * i + 1] =
xorjoep 1:24714b45cd1b 311 ((pSrc[2 * l + 1] >> 1U) + (pSrc[2 * i + 1] >> 1U)) >> 1U;
xorjoep 1:24714b45cd1b 312
xorjoep 1:24714b45cd1b 313 pSrc[2U * l] = (((int16_t) (((q31_t) xt * cosVal) >> 16)) -
xorjoep 1:24714b45cd1b 314 ((int16_t) (((q31_t) yt * sinVal) >> 16)));
xorjoep 1:24714b45cd1b 315
xorjoep 1:24714b45cd1b 316 pSrc[2U * l + 1U] = (((int16_t) (((q31_t) yt * cosVal) >> 16)) +
xorjoep 1:24714b45cd1b 317 ((int16_t) (((q31_t) xt * sinVal) >> 16)));
xorjoep 1:24714b45cd1b 318 }
xorjoep 1:24714b45cd1b 319
xorjoep 1:24714b45cd1b 320 #endif // #if defined (ARM_MATH_DSP)
xorjoep 1:24714b45cd1b 321
xorjoep 1:24714b45cd1b 322 // first col
xorjoep 1:24714b45cd1b 323 arm_radix4_butterfly_inverse_q15( pSrc, n2, (q15_t*)pCoef, 2U);
xorjoep 1:24714b45cd1b 324 // second col
xorjoep 1:24714b45cd1b 325 arm_radix4_butterfly_inverse_q15( pSrc + fftLen, n2, (q15_t*)pCoef, 2U);
xorjoep 1:24714b45cd1b 326
xorjoep 1:24714b45cd1b 327 for (i = 0; i < fftLen >> 1; i++)
xorjoep 1:24714b45cd1b 328 {
xorjoep 1:24714b45cd1b 329 p0 = pSrc[4*i+0];
xorjoep 1:24714b45cd1b 330 p1 = pSrc[4*i+1];
xorjoep 1:24714b45cd1b 331 p2 = pSrc[4*i+2];
xorjoep 1:24714b45cd1b 332 p3 = pSrc[4*i+3];
xorjoep 1:24714b45cd1b 333
xorjoep 1:24714b45cd1b 334 p0 <<= 1;
xorjoep 1:24714b45cd1b 335 p1 <<= 1;
xorjoep 1:24714b45cd1b 336 p2 <<= 1;
xorjoep 1:24714b45cd1b 337 p3 <<= 1;
xorjoep 1:24714b45cd1b 338
xorjoep 1:24714b45cd1b 339 pSrc[4*i+0] = p0;
xorjoep 1:24714b45cd1b 340 pSrc[4*i+1] = p1;
xorjoep 1:24714b45cd1b 341 pSrc[4*i+2] = p2;
xorjoep 1:24714b45cd1b 342 pSrc[4*i+3] = p3;
xorjoep 1:24714b45cd1b 343 }
xorjoep 1:24714b45cd1b 344 }
xorjoep 1:24714b45cd1b 345