这几天下了DSP library for MSP430 and MSP432 version 1_10_00_10,试着跑了一下例子,DSPLib_1_10_00_10\examples\Transform,试试FFT功能,里面三个例子,使用IAR编译器。三个例子分别是fft_fixed_q15,cmplx_fft_auto_q15,fft_iq31。Debug使用了simulator。可是看不懂FFT变换后的结果。谁能帮忙解释一下。FFT的结果如何看。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
这几天下了DSP library for MSP430 and MSP432 version 1_10_00_10,试着跑了一下例子,DSPLib_1_10_00_10\examples\Transform,试试FFT功能,里面三个例子,使用IAR编译器。三个例子分别是fft_fixed_q15,cmplx_fft_auto_q15,fft_iq31。Debug使用了simulator。可是看不懂FFT变换后的结果。谁能帮忙解释一下。FFT的结果如何看。
例1:fft_fixed_q15:
看程序是先算出了要变换的数据vectorB=0.25*sin(2*pi*250*t)+0.1*sin(2*pi*1000*t),两路正弦波相加。
然后使用status = msp_fft_fixed_q15(&fftParams, vectorB);
不知道这个函数算出来的结果在哪里?256点FFT,vectorB倒是有30个数变化了,可是看不出来和250,1000这两个频率有啥关系。看了函数
| msp_status msp_fft_fixed_q15 | ( | const msp_fft_q15_params * | params, |
| int16_t * | src | ||
| ) |
Real forward FFT function with fixed scaling by two at each stage.
y = fft(real(x)) ./ (N/2)| Length | Input Type | Result Type |
|---|---|---|
| 16 | _q15 | _q12 |
| 32 | _q15 | _q11 |
| 64 | _q15 | _q10 |
| 128 | _q15 | _q9 |
| 256 | _q15 | _q8 |
| 512 | _q15 | _q7 |
| 1024 | _q15 | _q6 |
| 2048 | _q15 | _q5 |
| 4096 | _q15 | _q4 |
| Length | Input Type | Result Type |
|---|---|---|
| 16 | int16_t | (int16_t)(result / 8) |
| 32 | int16_t | (int16_t)(result / 16) |
| 64 | int16_t | (int16_t)(result / 32) |
| 128 | int16_t | (int16_t)(result / 64) |
| 256 | int16_t | (int16_t)(result / 128) |
| 512 | int16_t | (int16_t)(result / 256) |
| 1024 | int16_t | (int16_t)(result / 512) |
| 2048 | int16_t | (int16_t)(result / 1024) |
| 4096 | int16_t | (int16_t)(result / 2048) |
| params | Pointer to the real FFT parameter structure. |
| src | Pointer to the real data array to perform the FFT on. |