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.

CCS/TMS320F28335: How to read the frequency scale of spectrum from FFT result.

Part Number: TMS320F28335

Tool/software: Code Composer Studio

Hi,

I'm using Code Composer Studio(CCS) 5.3.0.00090
And I find a example project called "F2833x Real FFT with ADC Input (Real-time)" from controlSUITE
Here are the example file(s) for this project:「C:\ti\controlSUITE\libs\dsp\FPU\v120\examples_ccsv4\2833x_RFFT_ADC_RT」

My question is, how to read the ""FFT result " from TI example project.

I mean, When the FFT operation is complete, I can get the input signal's Amplitude and Phase spectrum.
I succeeded getting the spectrum, but I don't know how to read it. The information about FFT from program description is too little.

The FFT project default setting has the information about sampling rate is 48kHz and FFT_Size is 512.
So, What is the relationship between the both information and the spectrum from FFT?

After FFT calculation, I can get 256 result each Amplitude and phase, And what does these result represent's frequency ? 
For example, the Amplitude spectrum has 256 value, the x represent 256 result. 
When x is 0 is mean DC's Magnitude, When x is 1 mean "some frequency" Magnitude, ....., When x is 255 mean "some frequency".
I have 255 different Magnitude representing different frequency. That is the Amplitude spectrum I want, but I didn't know frequency scale.

When x is 1 the frequency mean 5Hz? When x is 2 the frequency mean 10Hz? ...., When x is 255 the frequency mean 1275Hz? I don't know.

So, is there any way to figure it out frequency of "some frequency"?


Thanks for your help!

Best Regards, Chen Yan-Li

  • Chen,

    the library is well documented, the frequency points are dependent on sampling frequency and FFT length.

    For example, if you sample the signal at 50KHz and then do a 512 point FFT, then you get 256 frequency bins.

    Which are evenly split with 25KHz, i.e. first value corresponds to zero frequency, the next to 25Khz/256, the next after thant 25KHz/256 *2 and so forth..
  • Manish,

    Thank you! It's really help me a lot!

    Could you give me another help? I have some questions about changing the sampling frequency and FFT length.

    I want to use Fourier analysis to find the amplitude and phase of both 60Hz and 75Hz, frequency scale is 5 Hz.
    Project default settings sampling rate is 48KHz and 512 point FFT length cannot be used, 24KHz/256 even not integer.
    So, If I can sample the signal at 20480Hz and then do a 4096 point FFT, it's will be fine.

    Changing the sampling frequency part:
    Program description say "The signal is sampled by epwm module and sampling frequency is defined in Lab.h".
    I find the sampling frequency is defined as
    "defineADC_SAMPLE_PERIOD 3124 // 3124 = (3125-1) = 48 KHz sampling w/ 150 MHz SYSCLKOUT".
    It looks like the sampling frequency can only be set to a factor of 150M,
    Is that mean 150M divided by the sampling frequency must be an integer?
    May I set like this "7323.21875 = (7324.21875-1) = 20480Hz sampling w/ 150 MHz SYSCLKOUT"?
    Is there any problem with this setting?(Didn't show any error after compile)

    Changing the FFT length part:
    Program description say "This program shows how to compute a real FFT with 12-bit real-time ADC input and...".
    So, that mean the FFT length can up to 4096 points(12-bit), right?
    After I changed FFT_REAL_STAGES from 9 to 12(This program also defined in Lab.h),
    An error occurred "error: errors encountered during linking; "2833x_RFFT_ADC_RT.out" not built".
    Is there anything wrong with it?


    Thanks for your help!

    Best Regards, Chen Yan-Li