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.

Calculating THD with 25 ADC samples

Other Parts Discussed in Thread: TMS320F2808, C2000WARE

WiIl I be able to calculate THD using 25 numbers of ADC samples?

I have a memeory constraint with my design and now  I can store only 25 numbers of ADC samples for each channel (and there are 84 channel to be handled).

Whether I can use "CFFT32_brev1(ipcb_pntr,ipcb,N)"

Where, N = 25, NUM_MAX_HARMONIC = 25,ipcb is a buffer with size 25

and CFFT32 fft = CFFT32_128P_DEFAULTS.

Please let me know whether this will give result for THD?

  • Dheeraj,
    Can you provide the C2000 MCU part number for the MCU you are using? From the function name this is for a fixed point device, but I would like to confirm the exact PN.

    As to your question, I believe it is more theoretical in nature, rather than applying to the function you listed. In terms of signal processing so long as you have observed The Nyquist theorem on sampling/re-creating of 2x the fundamental you will converge on an answer. I say converge because as we take more data points the FFT will return a more precise re-creation of the waveform and your THD(and SNR/SINAD/etc) will be more precise.

    Finally, observing Nyquist doesn't take into account other requirements like digital filtering, which depending on the order of the filter, may have a larger sample requirement than 25.

    Best,
    Matthew
  • Thanks Matthew Pate  for the reply.

    the part number I am using is "TMS320F2808" with 100MHz clock speed.

    Could you please let me know the time taking for an FFT conversion if I am using "fft.h" library 

    My bufffer size is 128 

    Num of max harmonic 64

    CFFT32 fft = CFFT32_128P_DEFAULTS;

    CFFT32_brev(ipcbsrc, ipcb, N);

  • Dheeraj,

    The information on cycle counts for common buffer sizes is listed in the DSP library documentation, for fixed point FFT the path is:

    C:\ti\c2000\C2000Ware_1_00_04_00\libraries\dsp\FixedPoint\c28\docs\FIXEDPT_SW_LIB_UG.pdf

    If you don't yet have it installed C2000 ware can be doanloaded here: 

    http://www.ti.com/tool/C2000WARE  

    For the function in question CFFT32_brev() for 128 deep buffer it will take 1050 cycles, for a single invocation.  According to the manual, this function will need to be called twice to work on both the real and imaginary parts.

    Best,
    Matthew

  • Thanks Matthew for the information.