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.

TMS320C5505: phase angle is not consistent using FFT

Part Number: TMS320C5505


Dear,

I need to find the phase difference between two sinewaves. so i took two signalson different channel on adc (inbuilt adc of tms320c5505) channels and applied hwafft 1024pt fft on it.

i generated phase diffenece as 45 degree btween two waves and calculated from fft using atan2(I,R); and took the difference.

but that is not consistent.

i want first two digits constant even after decimal point two digits shoul be constant but i m getting 2-3 degeree of tolerance and my application has to achieve the tolerance of 0.001 degree.

what do i do..am i on the right track or do i need to handle it by the different method.

getting the following results:

Waiting...

PhaseDiff= 25.614349 angCH3= 169.229996 angCH5= 143.615646
PhaseDiff= 10.573380 angCH3= 28.442928 angCH5= 17.869549
PhaseDiff= 46.029144 angCH3= 49.624153 angCH5= 3.595009
PhaseDiff= 43.395103 angCH3= 73.300751 angCH5= 116.695854
PhaseDiff= 44.637218 angCH3= 85.851105 angCH5= 41.213886
PhaseDiff= 44.199585 angCH3= 92.905930 angCH5= 137.105515
PhaseDiff= 44.823826 angCH3= 76.607498 angCH5= 31.783672
PhaseDiff= 19.226471 angCH3= 146.811783 angCH5= 166.038254
PhaseDiff= 46.101280 angCH3= 121.568977 angCH5= 167.670258
PhaseDiff= 44.542313 angCH3= 126.869896 angCH5= 82.327583
PhaseDiff= 44.386841 angCH3= 118.562927 angCH5= 74.176086
PhaseDiff= 44.405777 angCH3= 119.228050 angCH5= 74.822273
PhaseDiff= 46.471062 angCH3= 164.771820 angCH5= 118.300758
PhaseDiff= 45.348824 angCH3= 71.378418 angCH5= 26.029593
PhaseDiff= 16.850811 angCH3= 14.620873 angCH5= 31.471685
PhaseDiff= 43.428123 angCH3= 60.326920 angCH5= 103.755043
PhaseDiff= 44.739712 angCH3= 81.073593 angCH5= 36.333881
PhaseDiff= 45.940216 angCH3= 121.065170 angCH5= 167.005386
PhaseDiff= 43.614326 angCH3= 69.545845 angCH5= 113.160172
PhaseDiff= 44.212692 angCH3= 33.854004 angCH5= 78.066696
PhaseDiff= 44.533012 angCH3= 122.355904 angCH5= 77.822891
PhaseDiff= 46.881042 angCH3= 171.652039 angCH5= 124.770996
PhaseDiff= 45.216850 angCH3= 71.378418 angCH5= 26.161566
PhaseDiff= 45.274117 angCH3= 18.811888 angCH5= 64.086006
PhaseDiff= 43.733025 angCH3= 86.224525 angCH5= 129.957550
PhaseDiff= 45.228737 angCH3= 110.932533 angCH5= 156.161270
PhaseDiff= 20.766644 angCH3= 12.430923 angCH5= 33.197567
PhaseDiff= 47.267426 angCH3= 172.874985 angCH5= 125.607559
PhaseDiff= 40.135849 angCH3= 136.479630 angCH5= 176.615479
PhaseDiff= 44.224106 angCH3= 113.080612 angCH5= 68.856506
PhaseDiff= 20.099136 angCH3= 166.409058 angCH5= 146.309921
PhaseDiff= 46.086517 angCH3= 159.050293 angCH5= 112.963776
PhaseDiff= 43.896973 angCH3= 89.418335 angCH5= 133.315308
PhaseDiff= 4.593699 angCH3= 20.907980 angCH5= 25.501678

one more thing is the highlighed part..if i add two angles i get the expected result. but i am not getting what kind of logic should i apply?

  • I've notified the sw team. They will post their feedback directly here.

    Please share which CSL version are you using.

    Best Regards,
    Yordan
  • waiting for reply..

  • hello,

    plz give me some suggestion..do i use external high speed and high resolution adc to improve the result??

  • Hi Kanchan,

    Any progress on your problem?

    I recommend you try to isolate where error is coming from.
    Is it coming from ADC samples?
    Try graphing the signals that are being passed to the FFT to look for anomalies.
    Perhaps some windowing of the input signal will reduce the effects you are seeing.

    Is it coming from precision of fixed point FFT?
    Is the FFT finding harmonics?
    Does it change if you increase the sampling frequency or use a slightly different one?

    Is it coming from the post processing after FFT processing - ie the arctan calculation? Is there any saturation or overflow happening?

    Perhaps you could use Matlab or floating point C on a PC to compare results with fixed point C55

    Or can your software do some analysis of the noisy results to throw out outliers?

    Maybe you could attempt to solve the phase shift problem in the time domain. See if the correlation of a known sine wave fits the sine wave you have sampled . then shift phase of the known sine wave until the best correlation is found.
    Or measure the time between zero crossings of the two signals.
    There has got to be a solution in the DSP literature out there.

    Here are some links
    http://techmind.org/dsp/
    stackoverflow.com/.../how-to-determine-phase-shift-of-a-sine-waveform

    Hope this helps,
    Mark

  • hello sir,

    1)the phase diff get changes when i change the sampling frequency.

    2) i found the phase in time domain too...but my application demands more accuracy so i shifted to frequency domain.

    3)i am using rectangular window for plotting the graphs..i am not getting what u said about window can u plz elaborate it.

    4)yes ! i am performing post processing of fft.after collecting adc samples.

    5)i have applied the correlation too but dont know the after process to find phase diff using correlation.