mbed-os 6.10 versione
cmsis_dsp/TransformFunctions/arm_cfft_radix8_f32.c@3:7a284390b0ce, 2013-11-08 (annotated)
- Committer:
- mbed_official
- Date:
- Fri Nov 08 13:45:10 2013 +0000
- Revision:
- 3:7a284390b0ce
Synchronized with git revision e69956aba2f68a2a26ac26b051f8d349deaa1ce8
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 3:7a284390b0ce | 1 | /* ---------------------------------------------------------------------- |
mbed_official | 3:7a284390b0ce | 2 | * Copyright (C) 2010-2013 ARM Limited. All rights reserved. |
mbed_official | 3:7a284390b0ce | 3 | * |
mbed_official | 3:7a284390b0ce | 4 | * $Date: 17. January 2013 |
mbed_official | 3:7a284390b0ce | 5 | * $Revision: V1.4.1 |
mbed_official | 3:7a284390b0ce | 6 | * |
mbed_official | 3:7a284390b0ce | 7 | * Project: CMSIS DSP Library |
mbed_official | 3:7a284390b0ce | 8 | * Title: arm_cfft_radix8_f32.c |
mbed_official | 3:7a284390b0ce | 9 | * |
mbed_official | 3:7a284390b0ce | 10 | * Description: Radix-8 Decimation in Frequency CFFT & CIFFT Floating point processing function |
mbed_official | 3:7a284390b0ce | 11 | * |
mbed_official | 3:7a284390b0ce | 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 |
mbed_official | 3:7a284390b0ce | 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. |
mbed_official | 3:7a284390b0ce | 39 | * -------------------------------------------------------------------- */ |
mbed_official | 3:7a284390b0ce | 40 | |
mbed_official | 3:7a284390b0ce | 41 | #include "arm_math.h" |
mbed_official | 3:7a284390b0ce | 42 | |
mbed_official | 3:7a284390b0ce | 43 | /** |
mbed_official | 3:7a284390b0ce | 44 | * @ingroup groupTransforms |
mbed_official | 3:7a284390b0ce | 45 | */ |
mbed_official | 3:7a284390b0ce | 46 | |
mbed_official | 3:7a284390b0ce | 47 | /** |
mbed_official | 3:7a284390b0ce | 48 | * @defgroup Radix8_CFFT_CIFFT Radix-8 Complex FFT Functions |
mbed_official | 3:7a284390b0ce | 49 | * |
mbed_official | 3:7a284390b0ce | 50 | * \par |
mbed_official | 3:7a284390b0ce | 51 | * Complex Fast Fourier Transform(CFFT) and Complex Inverse Fast Fourier Transform(CIFFT) is an efficient algorithm to compute Discrete Fourier Transform(DFT) and Inverse Discrete Fourier Transform(IDFT). |
mbed_official | 3:7a284390b0ce | 52 | * Computational complexity of CFFT reduces drastically when compared to DFT. |
mbed_official | 3:7a284390b0ce | 53 | * \par |
mbed_official | 3:7a284390b0ce | 54 | * This set of functions implements CFFT/CIFFT |
mbed_official | 3:7a284390b0ce | 55 | * for floating-point data types. The functions operates on in-place buffer which uses same buffer for input and output. |
mbed_official | 3:7a284390b0ce | 56 | * Complex input is stored in input buffer in an interleaved fashion. |
mbed_official | 3:7a284390b0ce | 57 | * |
mbed_official | 3:7a284390b0ce | 58 | * \par |
mbed_official | 3:7a284390b0ce | 59 | * The functions operate on blocks of input and output data and each call to the function processes |
mbed_official | 3:7a284390b0ce | 60 | * <code>2*fftLen</code> samples through the transform. <code>pSrc</code> points to In-place arrays containing <code>2*fftLen</code> values. |
mbed_official | 3:7a284390b0ce | 61 | * \par |
mbed_official | 3:7a284390b0ce | 62 | * The <code>pSrc</code> points to the array of in-place buffer of size <code>2*fftLen</code> and inputs and outputs are stored in an interleaved fashion as shown below. |
mbed_official | 3:7a284390b0ce | 63 | * <pre> {real[0], imag[0], real[1], imag[1],..} </pre> |
mbed_official | 3:7a284390b0ce | 64 | * |
mbed_official | 3:7a284390b0ce | 65 | * \par Lengths supported by the transform: |
mbed_official | 3:7a284390b0ce | 66 | * \par |
mbed_official | 3:7a284390b0ce | 67 | * Internally, the function utilize a Radix-8 decimation in frequency(DIF) algorithm |
mbed_official | 3:7a284390b0ce | 68 | * and the size of the FFT supported are of the lengths [ 64, 512, 4096]. |
mbed_official | 3:7a284390b0ce | 69 | * |
mbed_official | 3:7a284390b0ce | 70 | * |
mbed_official | 3:7a284390b0ce | 71 | * \par Algorithm: |
mbed_official | 3:7a284390b0ce | 72 | * |
mbed_official | 3:7a284390b0ce | 73 | * <b>Complex Fast Fourier Transform:</b> |
mbed_official | 3:7a284390b0ce | 74 | * \par |
mbed_official | 3:7a284390b0ce | 75 | * Input real and imaginary data: |
mbed_official | 3:7a284390b0ce | 76 | * <pre> |
mbed_official | 3:7a284390b0ce | 77 | * x(n) = xa + j * ya |
mbed_official | 3:7a284390b0ce | 78 | * x(n+N/4 ) = xb + j * yb |
mbed_official | 3:7a284390b0ce | 79 | * x(n+N/2 ) = xc + j * yc |
mbed_official | 3:7a284390b0ce | 80 | * x(n+3N 4) = xd + j * yd |
mbed_official | 3:7a284390b0ce | 81 | * </pre> |
mbed_official | 3:7a284390b0ce | 82 | * where N is length of FFT |
mbed_official | 3:7a284390b0ce | 83 | * \par |
mbed_official | 3:7a284390b0ce | 84 | * Output real and imaginary data: |
mbed_official | 3:7a284390b0ce | 85 | * <pre> |
mbed_official | 3:7a284390b0ce | 86 | * X(4r) = xa'+ j * ya' |
mbed_official | 3:7a284390b0ce | 87 | * X(4r+1) = xb'+ j * yb' |
mbed_official | 3:7a284390b0ce | 88 | * X(4r+2) = xc'+ j * yc' |
mbed_official | 3:7a284390b0ce | 89 | * X(4r+3) = xd'+ j * yd' |
mbed_official | 3:7a284390b0ce | 90 | * </pre> |
mbed_official | 3:7a284390b0ce | 91 | * \par |
mbed_official | 3:7a284390b0ce | 92 | * Twiddle factors for Radix-8 FFT: |
mbed_official | 3:7a284390b0ce | 93 | * <pre> |
mbed_official | 3:7a284390b0ce | 94 | * Wn = co1 + j * (- si1) |
mbed_official | 3:7a284390b0ce | 95 | * W2n = co2 + j * (- si2) |
mbed_official | 3:7a284390b0ce | 96 | * W3n = co3 + j * (- si3) |
mbed_official | 3:7a284390b0ce | 97 | * </pre> |
mbed_official | 3:7a284390b0ce | 98 | * |
mbed_official | 3:7a284390b0ce | 99 | * \par |
mbed_official | 3:7a284390b0ce | 100 | * \image html CFFT.gif "Radix-8 Decimation-in Frequency Complex Fast Fourier Transform" |
mbed_official | 3:7a284390b0ce | 101 | * |
mbed_official | 3:7a284390b0ce | 102 | * \par |
mbed_official | 3:7a284390b0ce | 103 | * Output from Radix-8 CFFT Results in Digit reversal order. Interchange middle two branches of every butterfly results in Bit reversed output. |
mbed_official | 3:7a284390b0ce | 104 | * \par |
mbed_official | 3:7a284390b0ce | 105 | * <b> Butterfly CFFT equations:</b> |
mbed_official | 3:7a284390b0ce | 106 | * <pre> |
mbed_official | 3:7a284390b0ce | 107 | * xa' = xa + xb + xc + xd |
mbed_official | 3:7a284390b0ce | 108 | * ya' = ya + yb + yc + yd |
mbed_official | 3:7a284390b0ce | 109 | * xc' = (xa+yb-xc-yd)* co1 + (ya-xb-yc+xd)* (si1) |
mbed_official | 3:7a284390b0ce | 110 | * yc' = (ya-xb-yc+xd)* co1 - (xa+yb-xc-yd)* (si1) |
mbed_official | 3:7a284390b0ce | 111 | * xb' = (xa-xb+xc-xd)* co2 + (ya-yb+yc-yd)* (si2) |
mbed_official | 3:7a284390b0ce | 112 | * yb' = (ya-yb+yc-yd)* co2 - (xa-xb+xc-xd)* (si2) |
mbed_official | 3:7a284390b0ce | 113 | * xd' = (xa-yb-xc+yd)* co3 + (ya+xb-yc-xd)* (si3) |
mbed_official | 3:7a284390b0ce | 114 | * yd' = (ya+xb-yc-xd)* co3 - (xa-yb-xc+yd)* (si3) |
mbed_official | 3:7a284390b0ce | 115 | * </pre> |
mbed_official | 3:7a284390b0ce | 116 | * |
mbed_official | 3:7a284390b0ce | 117 | * \par |
mbed_official | 3:7a284390b0ce | 118 | * where <code>fftLen</code> length of CFFT/CIFFT; <code>ifftFlag</code> Flag for selection of CFFT or CIFFT(Set ifftFlag to calculate CIFFT otherwise calculates CFFT); |
mbed_official | 3:7a284390b0ce | 119 | * <code>bitReverseFlag</code> Flag for selection of output order(Set bitReverseFlag to output in normal order otherwise output in bit reversed order); |
mbed_official | 3:7a284390b0ce | 120 | * <code>pTwiddle</code>points to array of twiddle coefficients; <code>pBitRevTable</code> points to the array of bit reversal table. |
mbed_official | 3:7a284390b0ce | 121 | * <code>twidCoefModifier</code> modifier for twiddle factor table which supports all FFT lengths with same table; |
mbed_official | 3:7a284390b0ce | 122 | * <code>pBitRevTable</code> modifier for bit reversal table which supports all FFT lengths with same table. |
mbed_official | 3:7a284390b0ce | 123 | * <code>onebyfftLen</code> value of 1/fftLen to calculate CIFFT; |
mbed_official | 3:7a284390b0ce | 124 | * |
mbed_official | 3:7a284390b0ce | 125 | * \par Fixed-Point Behavior |
mbed_official | 3:7a284390b0ce | 126 | * Care must be taken when using the fixed-point versions of the CFFT/CIFFT function. |
mbed_official | 3:7a284390b0ce | 127 | * Refer to the function specific documentation below for usage guidelines. |
mbed_official | 3:7a284390b0ce | 128 | */ |
mbed_official | 3:7a284390b0ce | 129 | |
mbed_official | 3:7a284390b0ce | 130 | |
mbed_official | 3:7a284390b0ce | 131 | /* |
mbed_official | 3:7a284390b0ce | 132 | * @brief Core function for the floating-point CFFT butterfly process. |
mbed_official | 3:7a284390b0ce | 133 | * @param[in, out] *pSrc points to the in-place buffer of floating-point data type. |
mbed_official | 3:7a284390b0ce | 134 | * @param[in] fftLen length of the FFT. |
mbed_official | 3:7a284390b0ce | 135 | * @param[in] *pCoef points to the twiddle coefficient buffer. |
mbed_official | 3:7a284390b0ce | 136 | * @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. |
mbed_official | 3:7a284390b0ce | 137 | * @return none. |
mbed_official | 3:7a284390b0ce | 138 | */ |
mbed_official | 3:7a284390b0ce | 139 | |
mbed_official | 3:7a284390b0ce | 140 | void arm_radix8_butterfly_f32( |
mbed_official | 3:7a284390b0ce | 141 | float32_t * pSrc, |
mbed_official | 3:7a284390b0ce | 142 | uint16_t fftLen, |
mbed_official | 3:7a284390b0ce | 143 | const float32_t * pCoef, |
mbed_official | 3:7a284390b0ce | 144 | uint16_t twidCoefModifier) |
mbed_official | 3:7a284390b0ce | 145 | { |
mbed_official | 3:7a284390b0ce | 146 | uint32_t ia1, ia2, ia3, ia4, ia5, ia6, ia7; |
mbed_official | 3:7a284390b0ce | 147 | uint32_t i1, i2, i3, i4, i5, i6, i7, i8; |
mbed_official | 3:7a284390b0ce | 148 | uint32_t id; |
mbed_official | 3:7a284390b0ce | 149 | uint32_t n1, n2, j; |
mbed_official | 3:7a284390b0ce | 150 | |
mbed_official | 3:7a284390b0ce | 151 | float32_t r1, r2, r3, r4, r5, r6, r7, r8; |
mbed_official | 3:7a284390b0ce | 152 | float32_t t1, t2; |
mbed_official | 3:7a284390b0ce | 153 | float32_t s1, s2, s3, s4, s5, s6, s7, s8; |
mbed_official | 3:7a284390b0ce | 154 | float32_t p1, p2, p3, p4; |
mbed_official | 3:7a284390b0ce | 155 | float32_t co2, co3, co4, co5, co6, co7, co8; |
mbed_official | 3:7a284390b0ce | 156 | float32_t si2, si3, si4, si5, si6, si7, si8; |
mbed_official | 3:7a284390b0ce | 157 | const float32_t C81 = 0.70710678118f; |
mbed_official | 3:7a284390b0ce | 158 | |
mbed_official | 3:7a284390b0ce | 159 | n2 = fftLen; |
mbed_official | 3:7a284390b0ce | 160 | |
mbed_official | 3:7a284390b0ce | 161 | do |
mbed_official | 3:7a284390b0ce | 162 | { |
mbed_official | 3:7a284390b0ce | 163 | n1 = n2; |
mbed_official | 3:7a284390b0ce | 164 | n2 = n2 >> 3; |
mbed_official | 3:7a284390b0ce | 165 | i1 = 0; |
mbed_official | 3:7a284390b0ce | 166 | |
mbed_official | 3:7a284390b0ce | 167 | do |
mbed_official | 3:7a284390b0ce | 168 | { |
mbed_official | 3:7a284390b0ce | 169 | i2 = i1 + n2; |
mbed_official | 3:7a284390b0ce | 170 | i3 = i2 + n2; |
mbed_official | 3:7a284390b0ce | 171 | i4 = i3 + n2; |
mbed_official | 3:7a284390b0ce | 172 | i5 = i4 + n2; |
mbed_official | 3:7a284390b0ce | 173 | i6 = i5 + n2; |
mbed_official | 3:7a284390b0ce | 174 | i7 = i6 + n2; |
mbed_official | 3:7a284390b0ce | 175 | i8 = i7 + n2; |
mbed_official | 3:7a284390b0ce | 176 | r1 = pSrc[2 * i1] + pSrc[2 * i5]; |
mbed_official | 3:7a284390b0ce | 177 | r5 = pSrc[2 * i1] - pSrc[2 * i5]; |
mbed_official | 3:7a284390b0ce | 178 | r2 = pSrc[2 * i2] + pSrc[2 * i6]; |
mbed_official | 3:7a284390b0ce | 179 | r6 = pSrc[2 * i2] - pSrc[2 * i6]; |
mbed_official | 3:7a284390b0ce | 180 | r3 = pSrc[2 * i3] + pSrc[2 * i7]; |
mbed_official | 3:7a284390b0ce | 181 | r7 = pSrc[2 * i3] - pSrc[2 * i7]; |
mbed_official | 3:7a284390b0ce | 182 | r4 = pSrc[2 * i4] + pSrc[2 * i8]; |
mbed_official | 3:7a284390b0ce | 183 | r8 = pSrc[2 * i4] - pSrc[2 * i8]; |
mbed_official | 3:7a284390b0ce | 184 | t1 = r1 - r3; |
mbed_official | 3:7a284390b0ce | 185 | r1 = r1 + r3; |
mbed_official | 3:7a284390b0ce | 186 | r3 = r2 - r4; |
mbed_official | 3:7a284390b0ce | 187 | r2 = r2 + r4; |
mbed_official | 3:7a284390b0ce | 188 | pSrc[2 * i1] = r1 + r2; |
mbed_official | 3:7a284390b0ce | 189 | pSrc[2 * i5] = r1 - r2; |
mbed_official | 3:7a284390b0ce | 190 | r1 = pSrc[2 * i1 + 1] + pSrc[2 * i5 + 1]; |
mbed_official | 3:7a284390b0ce | 191 | s5 = pSrc[2 * i1 + 1] - pSrc[2 * i5 + 1]; |
mbed_official | 3:7a284390b0ce | 192 | r2 = pSrc[2 * i2 + 1] + pSrc[2 * i6 + 1]; |
mbed_official | 3:7a284390b0ce | 193 | s6 = pSrc[2 * i2 + 1] - pSrc[2 * i6 + 1]; |
mbed_official | 3:7a284390b0ce | 194 | s3 = pSrc[2 * i3 + 1] + pSrc[2 * i7 + 1]; |
mbed_official | 3:7a284390b0ce | 195 | s7 = pSrc[2 * i3 + 1] - pSrc[2 * i7 + 1]; |
mbed_official | 3:7a284390b0ce | 196 | r4 = pSrc[2 * i4 + 1] + pSrc[2 * i8 + 1]; |
mbed_official | 3:7a284390b0ce | 197 | s8 = pSrc[2 * i4 + 1] - pSrc[2 * i8 + 1]; |
mbed_official | 3:7a284390b0ce | 198 | t2 = r1 - s3; |
mbed_official | 3:7a284390b0ce | 199 | r1 = r1 + s3; |
mbed_official | 3:7a284390b0ce | 200 | s3 = r2 - r4; |
mbed_official | 3:7a284390b0ce | 201 | r2 = r2 + r4; |
mbed_official | 3:7a284390b0ce | 202 | pSrc[2 * i1 + 1] = r1 + r2; |
mbed_official | 3:7a284390b0ce | 203 | pSrc[2 * i5 + 1] = r1 - r2; |
mbed_official | 3:7a284390b0ce | 204 | pSrc[2 * i3] = t1 + s3; |
mbed_official | 3:7a284390b0ce | 205 | pSrc[2 * i7] = t1 - s3; |
mbed_official | 3:7a284390b0ce | 206 | pSrc[2 * i3 + 1] = t2 - r3; |
mbed_official | 3:7a284390b0ce | 207 | pSrc[2 * i7 + 1] = t2 + r3; |
mbed_official | 3:7a284390b0ce | 208 | r1 = (r6 - r8) * C81; |
mbed_official | 3:7a284390b0ce | 209 | r6 = (r6 + r8) * C81; |
mbed_official | 3:7a284390b0ce | 210 | r2 = (s6 - s8) * C81; |
mbed_official | 3:7a284390b0ce | 211 | s6 = (s6 + s8) * C81; |
mbed_official | 3:7a284390b0ce | 212 | t1 = r5 - r1; |
mbed_official | 3:7a284390b0ce | 213 | r5 = r5 + r1; |
mbed_official | 3:7a284390b0ce | 214 | r8 = r7 - r6; |
mbed_official | 3:7a284390b0ce | 215 | r7 = r7 + r6; |
mbed_official | 3:7a284390b0ce | 216 | t2 = s5 - r2; |
mbed_official | 3:7a284390b0ce | 217 | s5 = s5 + r2; |
mbed_official | 3:7a284390b0ce | 218 | s8 = s7 - s6; |
mbed_official | 3:7a284390b0ce | 219 | s7 = s7 + s6; |
mbed_official | 3:7a284390b0ce | 220 | pSrc[2 * i2] = r5 + s7; |
mbed_official | 3:7a284390b0ce | 221 | pSrc[2 * i8] = r5 - s7; |
mbed_official | 3:7a284390b0ce | 222 | pSrc[2 * i6] = t1 + s8; |
mbed_official | 3:7a284390b0ce | 223 | pSrc[2 * i4] = t1 - s8; |
mbed_official | 3:7a284390b0ce | 224 | pSrc[2 * i2 + 1] = s5 - r7; |
mbed_official | 3:7a284390b0ce | 225 | pSrc[2 * i8 + 1] = s5 + r7; |
mbed_official | 3:7a284390b0ce | 226 | pSrc[2 * i6 + 1] = t2 - r8; |
mbed_official | 3:7a284390b0ce | 227 | pSrc[2 * i4 + 1] = t2 + r8; |
mbed_official | 3:7a284390b0ce | 228 | |
mbed_official | 3:7a284390b0ce | 229 | i1 += n1; |
mbed_official | 3:7a284390b0ce | 230 | } while(i1 < fftLen); |
mbed_official | 3:7a284390b0ce | 231 | |
mbed_official | 3:7a284390b0ce | 232 | if(n2 < 8) |
mbed_official | 3:7a284390b0ce | 233 | break; |
mbed_official | 3:7a284390b0ce | 234 | |
mbed_official | 3:7a284390b0ce | 235 | ia1 = 0; |
mbed_official | 3:7a284390b0ce | 236 | j = 1; |
mbed_official | 3:7a284390b0ce | 237 | |
mbed_official | 3:7a284390b0ce | 238 | do |
mbed_official | 3:7a284390b0ce | 239 | { |
mbed_official | 3:7a284390b0ce | 240 | /* index calculation for the coefficients */ |
mbed_official | 3:7a284390b0ce | 241 | id = ia1 + twidCoefModifier; |
mbed_official | 3:7a284390b0ce | 242 | ia1 = id; |
mbed_official | 3:7a284390b0ce | 243 | ia2 = ia1 + id; |
mbed_official | 3:7a284390b0ce | 244 | ia3 = ia2 + id; |
mbed_official | 3:7a284390b0ce | 245 | ia4 = ia3 + id; |
mbed_official | 3:7a284390b0ce | 246 | ia5 = ia4 + id; |
mbed_official | 3:7a284390b0ce | 247 | ia6 = ia5 + id; |
mbed_official | 3:7a284390b0ce | 248 | ia7 = ia6 + id; |
mbed_official | 3:7a284390b0ce | 249 | |
mbed_official | 3:7a284390b0ce | 250 | co2 = pCoef[2 * ia1]; |
mbed_official | 3:7a284390b0ce | 251 | co3 = pCoef[2 * ia2]; |
mbed_official | 3:7a284390b0ce | 252 | co4 = pCoef[2 * ia3]; |
mbed_official | 3:7a284390b0ce | 253 | co5 = pCoef[2 * ia4]; |
mbed_official | 3:7a284390b0ce | 254 | co6 = pCoef[2 * ia5]; |
mbed_official | 3:7a284390b0ce | 255 | co7 = pCoef[2 * ia6]; |
mbed_official | 3:7a284390b0ce | 256 | co8 = pCoef[2 * ia7]; |
mbed_official | 3:7a284390b0ce | 257 | si2 = pCoef[2 * ia1 + 1]; |
mbed_official | 3:7a284390b0ce | 258 | si3 = pCoef[2 * ia2 + 1]; |
mbed_official | 3:7a284390b0ce | 259 | si4 = pCoef[2 * ia3 + 1]; |
mbed_official | 3:7a284390b0ce | 260 | si5 = pCoef[2 * ia4 + 1]; |
mbed_official | 3:7a284390b0ce | 261 | si6 = pCoef[2 * ia5 + 1]; |
mbed_official | 3:7a284390b0ce | 262 | si7 = pCoef[2 * ia6 + 1]; |
mbed_official | 3:7a284390b0ce | 263 | si8 = pCoef[2 * ia7 + 1]; |
mbed_official | 3:7a284390b0ce | 264 | |
mbed_official | 3:7a284390b0ce | 265 | i1 = j; |
mbed_official | 3:7a284390b0ce | 266 | |
mbed_official | 3:7a284390b0ce | 267 | do |
mbed_official | 3:7a284390b0ce | 268 | { |
mbed_official | 3:7a284390b0ce | 269 | /* index calculation for the input */ |
mbed_official | 3:7a284390b0ce | 270 | i2 = i1 + n2; |
mbed_official | 3:7a284390b0ce | 271 | i3 = i2 + n2; |
mbed_official | 3:7a284390b0ce | 272 | i4 = i3 + n2; |
mbed_official | 3:7a284390b0ce | 273 | i5 = i4 + n2; |
mbed_official | 3:7a284390b0ce | 274 | i6 = i5 + n2; |
mbed_official | 3:7a284390b0ce | 275 | i7 = i6 + n2; |
mbed_official | 3:7a284390b0ce | 276 | i8 = i7 + n2; |
mbed_official | 3:7a284390b0ce | 277 | r1 = pSrc[2 * i1] + pSrc[2 * i5]; |
mbed_official | 3:7a284390b0ce | 278 | r5 = pSrc[2 * i1] - pSrc[2 * i5]; |
mbed_official | 3:7a284390b0ce | 279 | r2 = pSrc[2 * i2] + pSrc[2 * i6]; |
mbed_official | 3:7a284390b0ce | 280 | r6 = pSrc[2 * i2] - pSrc[2 * i6]; |
mbed_official | 3:7a284390b0ce | 281 | r3 = pSrc[2 * i3] + pSrc[2 * i7]; |
mbed_official | 3:7a284390b0ce | 282 | r7 = pSrc[2 * i3] - pSrc[2 * i7]; |
mbed_official | 3:7a284390b0ce | 283 | r4 = pSrc[2 * i4] + pSrc[2 * i8]; |
mbed_official | 3:7a284390b0ce | 284 | r8 = pSrc[2 * i4] - pSrc[2 * i8]; |
mbed_official | 3:7a284390b0ce | 285 | t1 = r1 - r3; |
mbed_official | 3:7a284390b0ce | 286 | r1 = r1 + r3; |
mbed_official | 3:7a284390b0ce | 287 | r3 = r2 - r4; |
mbed_official | 3:7a284390b0ce | 288 | r2 = r2 + r4; |
mbed_official | 3:7a284390b0ce | 289 | pSrc[2 * i1] = r1 + r2; |
mbed_official | 3:7a284390b0ce | 290 | r2 = r1 - r2; |
mbed_official | 3:7a284390b0ce | 291 | s1 = pSrc[2 * i1 + 1] + pSrc[2 * i5 + 1]; |
mbed_official | 3:7a284390b0ce | 292 | s5 = pSrc[2 * i1 + 1] - pSrc[2 * i5 + 1]; |
mbed_official | 3:7a284390b0ce | 293 | s2 = pSrc[2 * i2 + 1] + pSrc[2 * i6 + 1]; |
mbed_official | 3:7a284390b0ce | 294 | s6 = pSrc[2 * i2 + 1] - pSrc[2 * i6 + 1]; |
mbed_official | 3:7a284390b0ce | 295 | s3 = pSrc[2 * i3 + 1] + pSrc[2 * i7 + 1]; |
mbed_official | 3:7a284390b0ce | 296 | s7 = pSrc[2 * i3 + 1] - pSrc[2 * i7 + 1]; |
mbed_official | 3:7a284390b0ce | 297 | s4 = pSrc[2 * i4 + 1] + pSrc[2 * i8 + 1]; |
mbed_official | 3:7a284390b0ce | 298 | s8 = pSrc[2 * i4 + 1] - pSrc[2 * i8 + 1]; |
mbed_official | 3:7a284390b0ce | 299 | t2 = s1 - s3; |
mbed_official | 3:7a284390b0ce | 300 | s1 = s1 + s3; |
mbed_official | 3:7a284390b0ce | 301 | s3 = s2 - s4; |
mbed_official | 3:7a284390b0ce | 302 | s2 = s2 + s4; |
mbed_official | 3:7a284390b0ce | 303 | r1 = t1 + s3; |
mbed_official | 3:7a284390b0ce | 304 | t1 = t1 - s3; |
mbed_official | 3:7a284390b0ce | 305 | pSrc[2 * i1 + 1] = s1 + s2; |
mbed_official | 3:7a284390b0ce | 306 | s2 = s1 - s2; |
mbed_official | 3:7a284390b0ce | 307 | s1 = t2 - r3; |
mbed_official | 3:7a284390b0ce | 308 | t2 = t2 + r3; |
mbed_official | 3:7a284390b0ce | 309 | p1 = co5 * r2; |
mbed_official | 3:7a284390b0ce | 310 | p2 = si5 * s2; |
mbed_official | 3:7a284390b0ce | 311 | p3 = co5 * s2; |
mbed_official | 3:7a284390b0ce | 312 | p4 = si5 * r2; |
mbed_official | 3:7a284390b0ce | 313 | pSrc[2 * i5] = p1 + p2; |
mbed_official | 3:7a284390b0ce | 314 | pSrc[2 * i5 + 1] = p3 - p4; |
mbed_official | 3:7a284390b0ce | 315 | p1 = co3 * r1; |
mbed_official | 3:7a284390b0ce | 316 | p2 = si3 * s1; |
mbed_official | 3:7a284390b0ce | 317 | p3 = co3 * s1; |
mbed_official | 3:7a284390b0ce | 318 | p4 = si3 * r1; |
mbed_official | 3:7a284390b0ce | 319 | pSrc[2 * i3] = p1 + p2; |
mbed_official | 3:7a284390b0ce | 320 | pSrc[2 * i3 + 1] = p3 - p4; |
mbed_official | 3:7a284390b0ce | 321 | p1 = co7 * t1; |
mbed_official | 3:7a284390b0ce | 322 | p2 = si7 * t2; |
mbed_official | 3:7a284390b0ce | 323 | p3 = co7 * t2; |
mbed_official | 3:7a284390b0ce | 324 | p4 = si7 * t1; |
mbed_official | 3:7a284390b0ce | 325 | pSrc[2 * i7] = p1 + p2; |
mbed_official | 3:7a284390b0ce | 326 | pSrc[2 * i7 + 1] = p3 - p4; |
mbed_official | 3:7a284390b0ce | 327 | r1 = (r6 - r8) * C81; |
mbed_official | 3:7a284390b0ce | 328 | r6 = (r6 + r8) * C81; |
mbed_official | 3:7a284390b0ce | 329 | s1 = (s6 - s8) * C81; |
mbed_official | 3:7a284390b0ce | 330 | s6 = (s6 + s8) * C81; |
mbed_official | 3:7a284390b0ce | 331 | t1 = r5 - r1; |
mbed_official | 3:7a284390b0ce | 332 | r5 = r5 + r1; |
mbed_official | 3:7a284390b0ce | 333 | r8 = r7 - r6; |
mbed_official | 3:7a284390b0ce | 334 | r7 = r7 + r6; |
mbed_official | 3:7a284390b0ce | 335 | t2 = s5 - s1; |
mbed_official | 3:7a284390b0ce | 336 | s5 = s5 + s1; |
mbed_official | 3:7a284390b0ce | 337 | s8 = s7 - s6; |
mbed_official | 3:7a284390b0ce | 338 | s7 = s7 + s6; |
mbed_official | 3:7a284390b0ce | 339 | r1 = r5 + s7; |
mbed_official | 3:7a284390b0ce | 340 | r5 = r5 - s7; |
mbed_official | 3:7a284390b0ce | 341 | r6 = t1 + s8; |
mbed_official | 3:7a284390b0ce | 342 | t1 = t1 - s8; |
mbed_official | 3:7a284390b0ce | 343 | s1 = s5 - r7; |
mbed_official | 3:7a284390b0ce | 344 | s5 = s5 + r7; |
mbed_official | 3:7a284390b0ce | 345 | s6 = t2 - r8; |
mbed_official | 3:7a284390b0ce | 346 | t2 = t2 + r8; |
mbed_official | 3:7a284390b0ce | 347 | p1 = co2 * r1; |
mbed_official | 3:7a284390b0ce | 348 | p2 = si2 * s1; |
mbed_official | 3:7a284390b0ce | 349 | p3 = co2 * s1; |
mbed_official | 3:7a284390b0ce | 350 | p4 = si2 * r1; |
mbed_official | 3:7a284390b0ce | 351 | pSrc[2 * i2] = p1 + p2; |
mbed_official | 3:7a284390b0ce | 352 | pSrc[2 * i2 + 1] = p3 - p4; |
mbed_official | 3:7a284390b0ce | 353 | p1 = co8 * r5; |
mbed_official | 3:7a284390b0ce | 354 | p2 = si8 * s5; |
mbed_official | 3:7a284390b0ce | 355 | p3 = co8 * s5; |
mbed_official | 3:7a284390b0ce | 356 | p4 = si8 * r5; |
mbed_official | 3:7a284390b0ce | 357 | pSrc[2 * i8] = p1 + p2; |
mbed_official | 3:7a284390b0ce | 358 | pSrc[2 * i8 + 1] = p3 - p4; |
mbed_official | 3:7a284390b0ce | 359 | p1 = co6 * r6; |
mbed_official | 3:7a284390b0ce | 360 | p2 = si6 * s6; |
mbed_official | 3:7a284390b0ce | 361 | p3 = co6 * s6; |
mbed_official | 3:7a284390b0ce | 362 | p4 = si6 * r6; |
mbed_official | 3:7a284390b0ce | 363 | pSrc[2 * i6] = p1 + p2; |
mbed_official | 3:7a284390b0ce | 364 | pSrc[2 * i6 + 1] = p3 - p4; |
mbed_official | 3:7a284390b0ce | 365 | p1 = co4 * t1; |
mbed_official | 3:7a284390b0ce | 366 | p2 = si4 * t2; |
mbed_official | 3:7a284390b0ce | 367 | p3 = co4 * t2; |
mbed_official | 3:7a284390b0ce | 368 | p4 = si4 * t1; |
mbed_official | 3:7a284390b0ce | 369 | pSrc[2 * i4] = p1 + p2; |
mbed_official | 3:7a284390b0ce | 370 | pSrc[2 * i4 + 1] = p3 - p4; |
mbed_official | 3:7a284390b0ce | 371 | |
mbed_official | 3:7a284390b0ce | 372 | i1 += n1; |
mbed_official | 3:7a284390b0ce | 373 | } while(i1 < fftLen); |
mbed_official | 3:7a284390b0ce | 374 | |
mbed_official | 3:7a284390b0ce | 375 | j++; |
mbed_official | 3:7a284390b0ce | 376 | } while(j < n2); |
mbed_official | 3:7a284390b0ce | 377 | |
mbed_official | 3:7a284390b0ce | 378 | twidCoefModifier <<= 3; |
mbed_official | 3:7a284390b0ce | 379 | } while(n2 > 7); |
mbed_official | 3:7a284390b0ce | 380 | } |
mbed_official | 3:7a284390b0ce | 381 | |
mbed_official | 3:7a284390b0ce | 382 | /** |
mbed_official | 3:7a284390b0ce | 383 | * @} end of Radix8_CFFT_CIFFT group |
mbed_official | 3:7a284390b0ce | 384 | */ |