MDK-ARM平台  
- #include "arm_math.h"
- #include "arm_const_structs.h"
-
- #define N 128
-
- float32_t testInput[N][2]={0};
- float32_t FFT_Output[N]={0};
-
- int main(void)
- {
- /*
- ST固件库中的启动文件已经执行了 SystemInit() 函数,该函数在 system_stm32f4xx.c 文件,主要功能是
- 配置CPU系统的时钟,内部Flash访问时序,配置FSMC用于外部SRAM
- */
- bsp_Init(); /* 硬件初始化 */
-
- printf("start\r\n");
-
- for(int i=0;i<N/4;i++)
- {
- testInput[4*i][0]=1;
- testInput[4*i+1][0]=0;
- testInput[4*i+2][0]=-1;
- testInput[4*i+3][0]=0;
- }
-
- arm_cfft_f32(&arm_cfft_sR_f32_len128,(float32_t *)testInput,0, 1);
-
- arm_cmplx_mag_f32((float32_t *)testInput, FFT_Output, N);
-
- for(int i=0;i<N;i++)
- {
- printf("%d: %f\r\n",i,FFT_Output[i]);
- }
-
- /* 主程序大循环 */
- while (1)
- {
-
- }
- }
|