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.

关于FFT库的物理意义?

Other Parts Discussed in Thread: CONTROLSUITE

我用的是C:\ti\controlSUITE\libs\dsp\FPU\v120\examples_ccsv4\2833x_RFFT_ADC例程,其中输入的是ADC的二进制代码 还没有转换成实际的AD采集的电压,输入FFT中的BUFER,然后FFT输出为FFTReal_Magnitude[i],请问FFTReal_Magnitude代表频谱的幅度吗? 单位是什么? 为什么不把ADC采集的数据buf转换成实际电压再进行FFT呢?

  • 是的,FFTReal_Magnitude代表幅度,FFTReal_Magnitude/2/采样点,等于幅度。

    比如,0.67sin(a)的幅度是0.67

  • 您好,我想请教一下,我的信号是用函数生成的

    然后用了FFTReal_Magnitude求幅度谱,最后的结果是,在直流处和基频处有相同大小的幅值,请问这是为什么?

    #include "MainRun.h"

    #define SAMPLENUMBER 512
    #define FFT_STAGES 9
    #define PI 3.1415926536

    float32 fWaveR[SAMPLENUMBER];
    #pragma DATA_SECTION(fWaveR,"INBUF");
    float32 OutBuffer[SAMPLENUMBER];
    float32 TwiddleBuffer[SAMPLENUMBER];
    float32 MagBuffer[SAMPLENUMBER/2];
    float32 PhaseBuffer[SAMPLENUMBER/2];
    RFFT_F32_STRUCT fft;

    void MakeWave(double,double,double);
    float32 FindFrqn(void);

    void main(void)
    {

    float32 theta1,theta2,deltaTheta;

    InitSysCtrl();

    MakeWave(1.0,32.0,0.0);

    fft.InBuf=fWaveR;
    fft.OutBuf=OutBuffer;
    fft.CosSinBuf=TwiddleBuffer;
    fft.FFTSize=SAMPLENUMBER;
    fft.FFTStages=FFT_STAGES;
    fft.MagBuf=MagBuffer;
    fft.PhaseBuf=PhaseBuffer;
    RFFT_f32_sincostable(&fft);

    theta1=FindFrqn();

    MakeWave(1.0,32.0,PI/7);

    theta2=FindFrqn();
    deltaTheta=theta1-theta2;

    for(;;);
    }


    void MakeWave(double amplitude,double frequency,double phase)
    {
    int i;

    for ( i=0;i<SAMPLENUMBER;i++ )
    {
    fWaveR[i]=amplitude*cos(PI*2*i/1024*frequency+phase);
    }
    }

    float32 FindFrqn(void)
    {
    float *large,*small;
    Uint16 frqn,i;//frqn´ú±íFFT·ùÖµ×î´óµÄµãµÄºá×ø±ê

    RFFT_f32(&fft);
    RFFT_f32_mag(&fft);
    RFFT_f32_phase(&fft);
    large=MagBuffer;

    for(i=0;i<SAMPLENUMBER/2-1;i++ )
    {
    small=&MagBuffer[i+1];
    if(*large<*small)
    {
    *large=*small;
    frqn=i+1;
    }
    }

    return PhaseBuffer[frqn];
    }