STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
arm_rfft_fast_init_f32.c
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------
2 * Copyright (C) 2010-2014 ARM Limited. All rights reserved.
3 *
4 * $Date: 19. March 2015
5 * $Revision: V.1.4.5
6 *
7 * Project: CMSIS DSP Library
8 * Title: arm_cfft_init_f32.c
9 *
10 * Description: Split Radix Decimation in Frequency CFFT Floating point processing function
11 *
12 * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 * - Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * - Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in
21 * the documentation and/or other materials provided with the
22 * distribution.
23 * - Neither the name of ARM LIMITED nor the names of its contributors
24 * may be used to endorse or promote products derived from this
25 * software without specific prior written permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
30 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
31 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
32 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
33 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
34 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
35 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 * POSSIBILITY OF SUCH DAMAGE.
39 * -------------------------------------------------------------------- */
40 
41 #include "arm_math.h"
42 #include "arm_common_tables.h"
43 
67  uint16_t fftLen)
68 {
69  arm_cfft_instance_f32 * Sint;
70  /* Initialise the default arm status */
72  /* Initialise the FFT length */
73  Sint = &(S->Sint);
74  Sint->fftLen = fftLen/2;
75  S->fftLenRFFT = fftLen;
76 
77  /* Initializations of structure parameters depending on the FFT length */
78  switch (Sint->fftLen)
79  {
80  case 2048u:
81  /* Initializations of structure parameters for 2048 point FFT */
82  /* Initialise the bit reversal table length */
84  /* Initialise the bit reversal table pointer */
85  Sint->pBitRevTable = (uint16_t *)armBitRevIndexTable2048;
86  /* Initialise the Twiddle coefficient pointers */
89  break;
90  case 1024u:
92  Sint->pBitRevTable = (uint16_t *)armBitRevIndexTable1024;
95  break;
96  case 512u:
98  Sint->pBitRevTable = (uint16_t *)armBitRevIndexTable512;
101  break;
102  case 256u:
104  Sint->pBitRevTable = (uint16_t *)armBitRevIndexTable256;
105  Sint->pTwiddle = (float32_t *) twiddleCoef_256;
107  break;
108  case 128u:
110  Sint->pBitRevTable = (uint16_t *)armBitRevIndexTable128;
111  Sint->pTwiddle = (float32_t *) twiddleCoef_128;
113  break;
114  case 64u:
116  Sint->pBitRevTable = (uint16_t *)armBitRevIndexTable64;
117  Sint->pTwiddle = (float32_t *) twiddleCoef_64;
119  break;
120  case 32u:
122  Sint->pBitRevTable = (uint16_t *)armBitRevIndexTable32;
123  Sint->pTwiddle = (float32_t *) twiddleCoef_32;
125  break;
126  case 16u:
128  Sint->pBitRevTable = (uint16_t *)armBitRevIndexTable16;
129  Sint->pTwiddle = (float32_t *) twiddleCoef_16;
131  break;
132  default:
133  /* Reporting argument error if fftSize is not valid value */
134  status = ARM_MATH_ARGUMENT_ERROR;
135  break;
136  }
137 
138  return (status);
139 }
140 
const float32_t twiddleCoef_rfft_1024[1024]
#define ARMBITREVINDEXTABLE_512_TABLE_LENGTH
#define ARMBITREVINDEXTABLE2048_TABLE_LENGTH
const uint16_t armBitRevIndexTable16[ARMBITREVINDEXTABLE__16_TABLE_LENGTH]
#define ARMBITREVINDEXTABLE_256_TABLE_LENGTH
arm_status arm_rfft_fast_init_f32(arm_rfft_fast_instance_f32 *S, uint16_t fftLen)
Initialization function for the floating-point real FFT.
float float32_t
32-bit floating-point type definition.
Definition: arm_math.h:407
arm_cfft_instance_f32 Sint
Definition: arm_math.h:2237
#define ARMBITREVINDEXTABLE1024_TABLE_LENGTH
Instance structure for the floating-point RFFT/RIFFT function.
Definition: arm_math.h:2235
const uint16_t * pBitRevTable
Definition: arm_math.h:2145
const float32_t twiddleCoef_64[128]
Instance structure for the floating-point CFFT/CIFFT function.
Definition: arm_math.h:2141
const float32_t twiddleCoef_1024[2048]
const float32_t twiddleCoef_rfft_64[64]
#define ARMBITREVINDEXTABLE_128_TABLE_LENGTH
const float32_t twiddleCoef_2048[4096]
const float32_t twiddleCoef_rfft_2048[2048]
const float32_t twiddleCoef_rfft_32[32]
const uint16_t armBitRevIndexTable32[ARMBITREVINDEXTABLE__32_TABLE_LENGTH]
const uint16_t armBitRevIndexTable256[ARMBITREVINDEXTABLE_256_TABLE_LENGTH]
#define ARMBITREVINDEXTABLE__64_TABLE_LENGTH
const float32_t twiddleCoef_rfft_4096[4096]
const float32_t twiddleCoef_rfft_256[256]
const uint16_t armBitRevIndexTable64[ARMBITREVINDEXTABLE__64_TABLE_LENGTH]
const float32_t twiddleCoef_32[64]
const uint16_t armBitRevIndexTable128[ARMBITREVINDEXTABLE_128_TABLE_LENGTH]
const uint16_t armBitRevIndexTable512[ARMBITREVINDEXTABLE_512_TABLE_LENGTH]
#define ARMBITREVINDEXTABLE__16_TABLE_LENGTH
const float32_t twiddleCoef_256[512]
#define ARMBITREVINDEXTABLE__32_TABLE_LENGTH
const float32_t * pTwiddle
Definition: arm_math.h:2144
const float32_t twiddleCoef_16[32]
const uint16_t armBitRevIndexTable2048[ARMBITREVINDEXTABLE2048_TABLE_LENGTH]
const float32_t twiddleCoef_rfft_512[512]
const uint16_t armBitRevIndexTable1024[ARMBITREVINDEXTABLE1024_TABLE_LENGTH]
const float32_t twiddleCoef_rfft_128[128]
arm_status
Error status returned by some functions in the library.
Definition: arm_math.h:373
const float32_t twiddleCoef_512[1024]
const float32_t twiddleCoef_128[256]