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: RFFT implementation on the signal with 512 values

Part Number: TMS320F28335


Tool/software: Code Composer Studio

I used the standard FFT library for getting 512 point FFT values. According to FFT code it should be giving symmetrical graph but it does not seem to give symmetrical graph.

  • Thanks for the question. I will ask an expert in this area to respond. Please bear with us.
    Regards,
    Richard
  • Hi,

    What is the input to the FFT, and the sampling rate? 

  •  My input is CFL current load and my sampling frequency is 5kHz. I have attached the waveform of the input below

  • It looks like you are getting peaks in the right bins. Since you have about 6 and a quarter cycles in the 512 point buffer - not an integer number of cycles - you will see spreading of the peak among adjacent bins.

    For an input of f_in=60 Hz, f_s=5KHz, you should see peaks in the 6th bin and 506th bin. I cant explain why the 506th bin has a larger peak than the 6th bin. They should be close.

    Can you send me a data dump of this 512 point buffer. I can try running the same data through MATLAB to see what I get.
  • The input frequency is 50kHz here.

    I have given the 512 samples- 

    source[]={ 2867
    , 2539.52
    , 2539.52
    , 2703.36
    , 2703.36
    , 2621.44
    , 2621.44
    , 2703.36
    , 2621.44
    , 2703.36
    , 2703.36
    , 2867.2
    , 2867.2
    , 3031.04
    , 3031.04
    , 2949.12
    , 2867.2
    , 2949.12
    , 2867.2
    , 2703.36
    , 2785.28
    , 2621.44
    , 2621.44
    , 2375.2704
    , 2539.52
    , 2457.6
    , 2539.52
    , 2457.6
    , 2375.2704
    , 2539.52
    , 2539.52
    , 2375.2704
    , 2539.52
    , 2048
    , 1966.08
    , 2211.84
    , 2048
    , 2211.84
    , 2129.92
    , 2129.92
    , 2129.92
    , 2211.84
    , 2129.92
    , 2129.92
    , 2211.84
    , 2048
    , 2129.92
    , 2048
    , 2129.92
    , 2048
    , 1392.64
    , 1884.16
    , 1720.7296
    , 1556.48
    , 1720.7296
    , 1638.4
    , 1720.7296
    , 1556.48
    , 1720.7296
    , 1556.48
    , 1556.48
    , 1474.56
    , 1474.56
    , 1392.64
    , 1392.64
    , 1474.56
    , 1474.56
    , 1392.64
    , 1474.56
    , 1556.48
    , 1556.48
    , 1720.7296
    , 1720.7296
    , 1720.7296
    , 1802.24
    , 1720.7296
    , 1802.24
    , 1720.7296
    , 1802.24
    , 1884.16
    , 1802.24
    , 1884.16
    , 1802.24
    , 2375.2704
    , 2048
    , 2375.2704
    , 2375.2704
    , 2129.92
    , 2211.84
    , 2293.76
    , 2211.84
    , 2129.92
    , 2129.92
    , 2293.76
    , 2211.84
    , 2129.92
    , 2129.92
    , 2293.76
    , 2129.92
    , 2375.2704
    , 2539.52
    , 2867.2
    , 2539.52
    , 2703.36
    , 2703.36
    , 2539.52
    , 2703.36
    , 2539.52
    , 2621.44
    , 2785.28
    , 2703.36
    , 2949.12
    , 2867.2
    , 3031.04
    , 3031.04
    , 2949.12
    , 2949.12
    , 2785.28
    , 2867.2
    , 2703.36
    , 2703.36
    , 2621.44
    , 2703.36
    , 2457.6
    , 2539.52
    , 2539.52
    , 2457.6
    , 2539.52
    , 2457.6
    , 2539.52
    , 2539.52
    , 2375.2704
    , 2457.6
    , 1966.08
    , 2211.84
    , 2048
    , 2129.92
    , 2048
    , 2129.92
    , 2048
    , 2048
    , 2211.84
    , 2048
    , 2129.92
    , 2048
    , 2129.92
    , 2048
    , 2211.84
    , 2129.92
    , 1802.24
    , 1392.64
    , 1802.24
    , 1720.7296
    , 1638.4
    , 1720.7296
    , 1638.4
    , 1720.7296
    , 1638.4
    , 1720.7296
    , 1556.48
    , 1556.48
    , 1474.56
    , 1392.64
    , 1556.48
    , 1310.72
    , 1392.64
    , 1392.64
    , 1556.48
    , 1392.64
    , 1720.7296
    , 1556.48
    , 1720.7296
    , 1720.7296
    , 1720.7296
    , 1720.7296
    , 1884.16
    , 1720.7296
    , 1884.16
    , 1966.08
    , 1720.7296
    , 1802.24
    , 1884.16
    , 1802.24
    , 2375.2704
    , 2375.2704
    , 2048
    , 2211.84
    , 2129.92
    , 2211.84
    , 2211.84
    , 2211.84
    , 2129.92
    , 2129.92
    , 2211.84
    , 2211.84
    , 2211.84
    , 2211.84
    , 2211.84
    , 2211.84
    , 2375.2704
    , 2539.52
    , 3031.04
    , 2539.52
    , 2703.36
    , 2703.36
    , 2539.52
    , 2703.36
    , 2539.52
    , 2703.36
    , 2867.2
    , 2703.36
    , 2867.2
    , 2867.2
    , 3031.04
    , 3031.04
    , 3031.04
    , 2949.12
    , 2867.2
    , 2867.2
    , 2703.36
    , 2785.28
    , 2621.44
    , 2703.36
    , 2539.52
    , 2539.52
    , 2457.6
    , 2457.6
    , 2539.52
    , 2457.6
    , 2539.52
    , 2457.6
    , 2539.52
    , 2539.52
    , 1884.16
    , 2211.84
    , 2048
    , 2048
    , 2211.84
    , 2211.84
    , 2048
    , 2129.92
    , 2048
    , 2048
    , 2293.76
    , 2129.92
    , 2129.92
    , 2129.92
    , 2211.84
    , 2129.92
    , 1802.24
    , 1474.56
    , 1802.24
    , 1720.7296
    , 1556.48
    , 1720.7296
    , 1720.7296
    , 1720.7296
    , 1638.4
    , 1720.7296
    , 1556.48
    , 1556.48
    , 1474.56
    , 1474.56
    , 1392.64
    , 1392.64
    , 1310.72
    , 1392.64
    , 1556.48
    , 1556.48
    , 1474.56
    , 1556.48
    , 1720.7296
    , 1720.7296
    , 1720.7296
    , 1720.7296
    , 1802.24
    , 1802.24
    , 1884.16
    , 1884.16
    , 1720.7296
    , 1802.24
    , 1884.16
    , 1802.24
    , 2375.2704
    , 2048
    , 2293.76
    , 2211.84
    , 2129.92
    , 2211.84
    , 2211.84
    , 2211.84
    , 2375.2704
    , 2211.84
    , 2129.92
    , 2211.84
    , 2293.76
    , 2211.84
    , 2211.84
    , 2211.84
    , 2539.52
    , 2949.12
    , 2539.52
    , 2539.52
    , 2703.36
    , 2785.28
    , 2621.44
    , 2703.36
    , 2539.52
    , 2621.44
    , 2703.36
    , 2703.36
    , 2867.2
    , 2867.2
    , 3031.04
    , 3031.04
    , 2949.12
    , 2867.2
    , 2785.28
    , 2867.2
    , 2703.36
    , 2703.36
    , 2621.44
    , 2703.36
    , 2539.52
    , 2539.52
    , 2457.6
    , 2457.6
    , 2539.52
    , 2539.52
    , 2375.2704
    , 2457.6
    , 2375.2704
    , 2539.52
    , 1966.08
    , 2211.84
    , 2048
    , 2129.92
    , 2048
    , 2129.92
    , 2048
    , 2129.92
    , 2048
    , 2129.92
    , 2048
    , 2211.84
    , 2048
    , 2048
    , 2129.92
    , 2129.92
    , 1884.16
    , 1392.64
    , 1802.24
    , 1720.7296
    , 1556.48
    , 1720.7296
    , 1638.4
    , 1638.4
    , 1720.7296
    , 1720.7296
    , 1556.48
    , 1556.48
    , 1392.64
    , 1474.56
    , 1392.64
    , 1392.64
    , 1228.8
    , 1392.64
    , 1474.56
    , 1556.48
    , 1474.56
    , 1556.48
    , 1720.7296
    , 1720.7296
    , 1720.7296
    , 1720.7296
    , 1884.16
    , 1802.24
    , 1802.24
    , 1802.24
    , 1884.16
    , 1802.24
    , 1720.7296
    , 1802.24
    , 2375.2704
    , 2048
    , 2457.6
    , 2211.84
    , 2129.92
    , 2211.84
    , 2129.92
    , 2211.84
    , 2293.76
    , 2211.84
    , 2211.84
    , 2211.84
    , 2211.84
    , 2211.84
    , 2129.92
    , 2211.84
    , 2457.6
    , 2949.12
    , 2539.52
    , 2539.52
    , 2785.28
    , 2703.36
    , 2539.52
    , 2703.36
    , 2539.52
    , 2539.52
    , 2785.28
    , 2703.36
    , 2867.2
    , 2867.2
    , 3031.04
    , 3031.04
    , 2867.2
    , 2949.12
    , 2785.28
    , 2867.2
    , 2703.36
    , 2703.36
    , 2539.52
    , 2703.36
    , 2539.52
    , 2457.6
    , 2539.52
    , 2457.6
    , 2539.52
    , 2539.52
    , 2457.6
    , 2457.6
    , 2539.52
    , 2539.52
    , 1884.16
    , 2211.84
    , 2048
    , 2211.84
    , 2048
    , 2129.92
    , 2129.92
    , 2129.92
    , 2048
    , 2129.92
    , 2048
    , 2129.92
    , 2048
    , 2129.92
    , 2048
    , 2129.92
    , 1720.7296
    , 1392.64
    , 1802.24
    , 1720.7296
    , 1556.48
    , 1720.7296
    , 1638.4
    , 1720.7296
    , 1556.48
    , 1720.7296
    , 1556.48
    , 1556.48
    , 1474.56
    , 1392.64
    , 1474.56
    , 1310.72
    , 1474.56
    , 1392.64
    , 1474.56
    , 1474.56
    , 1556.48
    , 1556.48
    , 1720.7296
    , 1638.4
    , 1802.24
    , 1720.7296
    , 1884.16
    , 1720.7296
    , 1884.16
    , 1802.24
    , 1884.16
    , 1802.24
    , 1884.16
    , 1802.24
    , 2293.76
    , 2129.92
    , 2375.2704
    , 2293.76
    , 2211.84
    , 2211.84
    , 2129.92
    , 2211.84
    , 2211.84
    , 2211.84
    , 2129.92
    , 2211.84
    , 2293.76
    , 2211.84
    , 2375.2704
    , 2211.84
    , 2375.2704
    , 2949.12
    , 2539.52
    , 2539.52
    , 2703.36
    , 2703.36
    , 2539.52
    , 2703.36
    , 2539.52
    , 2621.44
    , 2785.28
    , 2785.28
    , 2949.12

    };

  • Sorry, the frequency is 50Hz (mentioned 50kHz by mistake)