/* ********************************************************************************************************* FileName:dsp_asm.h ********************************************************************************************************* */ #ifndef __DSP_ASM_H__ #define __DSP_ASM_H__ ********************************************************************************************************* * FUNCTION PROTOTYPES ********************************************************************************************************* */ void dsp_asm_test(void); void dsp_asm_init(void); #endif /* End of module include. */ /*8888888888888888888888888888888888888888888888888888888888888888*/ /*8888888888888888888888888888888888888888888888888888888888888888*/ /* * FileName:dsp_asm.c * Author:Bobby.Chen *Email:*************** Date:2010-08-11 * Description:This file showes how to use the dsp library in mdk project. * 使用三角函数生成采样点,供 FFT 计算 * 进行 FFT 测试时,按下面顺序调用函数即可: * dsp_asm_init(); * dsp_asm_test(); */ #include "stm32f10x.h" #include "dsp_asm.h" #include "stm32_dsp.h" #include "table_fft.h" #include #include /* ********************************************************************************************************* * LOCAL CONSTANTS ********************************************************************************************************* */ #define PI2 6.28318530717959 // Comment the lines that you don't want to use. // 要模拟FFT,请注释掉其他的预定义 // 此处也可以全部注释掉,在MDK 的工程属性->"C/C++"->"Preprocessor Symbols"-"Define:"中添加NPT_XXX 项目 // 但是这样做法的缺点是每次修改XXX 数据,都会导致MDK 下次编译时会编译全部文件,速度太慢。 //#define NPT_64 64 #define NPT_256 256 //#define NPT_1024 1024 // N=64,Fs/N=50Hz,Max(Valid)=1600Hz // 64 点FFt,采样率 3200Hz,频率分辨率 50Hz,测量最大有效频率 1600Hz #ifdef NPT_64 #de...