TI中文支持网
TI专业的中文技术问题搜集分享网站

DSP library for MSP430 and MSP432 version 1_10_00_10搞不懂,请教问题?

这几天下了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的结果如何看。

user242210:

例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.

DetailsComputes the forward discreet Fourier transform (DFT) of 16-bit real inputs. If the inputs are not already in bit reversed order the bit reversal parameter must be set. The output is scaled by a factor of two for each stage of the DFT.This functions requires half the data storage and consumes roughly half the cycles and energy as running a complex FFT of the same length. When transforming purely real inputs, such as samples from an ADC or analog sensor, it is recommended to use the real FFT functions.When using LEASC the twiddle table pointer can be set to NULL (zero) and the source data must be aligned to LENGTH*2 bytes. For example, a 256 point real FFT must be aligned to a 512 byte address in shared LEA memory.Pseudo codey = fft(real(x)) ./ (N/2)ScalingEach stage of the real FFT, with the exception of the final split stage, scales the result by a factor of 0.5. The output format can either be interpreted as the same type with (N/2) scaling or a different fixed point data type. This can be helpful when using the IQmathLib to process the results of the FFT, such as computing the magnitude or phase angle of the complex result.

LengthInput TypeResult 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

The following table lists the applied scaling factor and resulting data type when the input is a 16-bit integer.

LengthInput TypeResult 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)

Parameters

params
Pointer to the real FFT parameter structure.

src
Pointer to the real data array to perform the FFT on.

ReturnsStatus of the operation.还是一头雾水。谁能帮帮我。

Maka Luo:

mathlib还是DSP library?

xiaoqiang sun:

回复 user242210:

请问楼主解决了没有,我现在同样遇到这个问题,脑子疼

赞(0)
未经允许不得转载:TI中文支持网 » DSP library for MSP430 and MSP432 version 1_10_00_10搞不懂,请教问题?
分享到: 更多 (0)