09-01-2011 07:59 PM
I am using FFT Mag-phase sub.vi to extract the Mag and Phase of a user defined sinusoidal waveform. I have attached the vi here and have saved the default values for the controls. I am interested in getting the amplitude out from the mag waveform and I do that by indexing the mag array by using array-max min. We can also get the index corr. to that maximum mag value and for the same index, I am extracting the phase from the phase waveform.
My goal is to extract the amplitude and the phase at start for the sine wave and I am assuming that the FFT function is a good way to go. I am not sure about this though, since I am not an expert in FFts. Are there better alternatives. A few things that I noticed with FFT Mag-Phase,
- the phase values calculated are off by 90 degrees. I am not sure why is that. Though since it is always off by 90 o, I can add 90 o to the output and get it to zero. The main goal is to have a contast phase.
- secondly, the max magnitude value and the corr. phase values are very sensitive to the number of cycles (number of samples). The values seem to be accurate only for the integer number of cycles. For the default values that are set in the vi, that is attached, five samples will give us one cycle.
How do I get the accurate measurements on amplitude and the phase at t=0?
Thank you,
Deepak
09-02-2011 01:51 AM
One Problem with your solution might be some leakage.. But NI has made a FFT based vi exactly for your needs: extract single tone 🙂 (And if you have more than 11 periodes the result is very good)
Of course the phase depend on the trigger of your waveform capture.