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/CCSTUDIO-C2000: Why the phase changes when TMS320F280049 performs the same FFT?

Part Number: CCSTUDIO-C2000
Other Parts Discussed in Thread: TMS320F280049

Tool/software: Code Composer Studio

Hi ,

We give TMS320F280049 the same signal(50Hz sine wave for example),and we give it the same impulse wave synchronized with the signal so that it can start sampling on the same falling edge of the impulse wave.What's more, the sampling cycles are also same.After FFT, we get the results including amplitude and phase.The amp is always stable and right,but the phase sometimes changes. The phase mostly changes 90 degrees,and sometimes a random degree.

Is that because we didn't define a 0 degree phase? Or the FFT sometimes calculate with sin() sometimes with cos()?

If it is caused by the 0 degree phase,then what shall we do in the code?

Thanks a lot.

  • Hi,

    How are you providing sinusoid signal to the controller ? And how are the synchronizing the trigger signal (which is impulse in your case) with the sinusoid ?

    Basically there is a possibility that at the falling edge of impulse, the input might be non-zero rather will have some random value, that's why you are observing random phase.

    If my reply answers your question please click on "This resolved my issue" button located at the bottom of my post.

    Regards

    Himanshu

  • Hi,

    I use the signal generator equipment to provide the sinusoid signal,and I have a key phase equipment to synchronize the trigger signal.The signal and the impulse are observed on the oscilloscope,which are as required.

    At the falling edge of impulse, the input is indeed non-zero,but every time the falling edge corresponds to the same phase position on the sinusoid signal. So,after FFT, the result of phase should be the same, not random.

    Thanks a lot.
  • Hi,

    Okay still just to be fully sure I would like you to share those CRO screenshots showing synchronization between impulse signal and sinusoid.


    Another thing is ADC conversion also takes some time from the time it being triggered but ideally that is also supposed to be fixed. But maybe if you you have enabled various other interrupts other than ADC then this might be reason of variable offsets as there is a possibility that ADC interrupt would be handled at different times depending on the other interrupts.

    Regards
    Himanshu
  • Hi,

    CRO screenshots are as below.

     ADC conversion is always working, we get the data through interrupt. As for the interrupts, ADC interrupt is in every 16us, and we have a capture interrupt which counts the time of impulse cycle,so the capture interrupt time equals the impulse cycle. These interrupts take about 10ns every time,so I think their influence can be ignored.What do you think?

    Thanks a lot.

  • Hi,

    I undertand that the capture interrupt takes 10ns but actually there are some significant cycles required before reaching the ISR from the time of trigger which includes saving context etc. Maybe this latency is not ignorable.

    Can you share the complete code, I would like to have a look at it to find the root cause.

    Regards

    Himanshu

  • Hi,

    Have you seen  my code?

    Thanks a lot.

  • Hi,

    You haven't shared your code yet with me, can you just upload here so that I can have a look.

    Regards

    Himanshu