Continue to Site

# How accurately can the phase of a signal be measured using the FFT algorithm ?

Status
Not open for further replies.

#### MSDhoni

##### Newbie level 4
I have a signal at 11000.085 Hz with amplitude 1V and 150' phase. It is sampled at 1MHz and 50000 datapoints are collected. To find the FFT I'm also using the Hanning window but the measured phase from the FFT is 150.52' which means error of 0.52'. I suspect this error exists as the number of datapoints per cycle of the signal is not an integer.
1) How accurately can the phase be measured using the different windowing functions when number of datapoints per cycle is not integer ?(In my application I would like to have measurement accuracy upto 2nd decimal)
2) If FFT algorithm with windowing function can not measure the phase without the absence of this error then is this error an systematic error which can be calculated ??

#### KlausST

##### Super Moderator
Staff member
Hi,

0.52° isn´t much, for a real circuit. Any stray capacitance may cause this....or the variation of an analog anti-aliasing filter. You know this 0.52° equals to only about 131 ns.

* You didn´t mention data width... but I expect the FFT to calculate way more precise than 0.52°.
* 50000 samples with 1MHz gives a window of 50.000ms. This means you get 550 fullwaves in your window. Be sure that this really is the integer value "550".

****
I wonder how your test circuit looks like.
On the one side it sounds like a true circuit...but what is your reference against you measure your signal? A second channel? An absolute angle? If so, how do you generate it?
If you generate it sychronously to the sample clock, then you don´t need windowing.

Klaus

MSDhoni

### MSDhoni

Points: 2

#### asdf44

If you know your frequency you don’t need an FFT you only need a single DFT at your frequency.

If there is any way to get an integer number of samples that’s preferred.

Also look into least squared - fitting a sin wave to a data sample is equivalent to a DFT but with more flexibility.

In general get set up with a tool like matlab and start running experiments. It’s fairly easy to evaluate the theoretical error of different scenarios (sample frequency, length etc).

MSDhoni

### MSDhoni

Points: 2

#### KlausST

##### Super Moderator
Staff member
Hi,

in case your 11kHz frequency is not derived from the 1MHz sample clock, then I recommend to use just 1000 samples for your calculation.
* with 50000 samples the bandwidth is 20Hz,
* with 1000 samples the bandwidth is 1000Hz
Thus the DFT result with 1000 samples is less critical for frequency errors.

Klaus

MSDhoni

### MSDhoni

Points: 2

#### MSDhoni

##### Newbie level 4
Hi,

0.52° isn´t much, for a real circuit. Any stray capacitance may cause this....or the variation of an analog anti-aliasing filter

Klaus

So, the cause is not clear for the phase drift just that I wanted to measure it accurately using FFT. Here, the frequency bin size for the FFT is 20Hz(i.e. 10⁶/50000) and hence on the signals with frequencies in the multiple of 20 can be resolved accurately in terms of phase, frequency and amplitude using the FFT and for the signal with all other frequencies needs correction for phase, frequency and amplitude. This correction depends upon the type of windowing function used and the correction formula is basically interpolation of amplitudes at frequencies in the frequency spectrum between two bins.(With this correction it can accurately measure the phase as 149.997° now)

About my circuit : I want to compensate the (voltage)amplitude at a particular frequency in the system i.e. measure the amplitude and phase at a particular frequency and provide an anti-signal(180 out of phase wave with the same amplitude) such that I get 50-55dB compensation at that particular frequency. If the phase measurement of the signal at that frequency has an error of 0.52° that is a loss of 5-7dB in compensation, and hence I care for 0.52°. Everthing is generated synchronously using an arbitary waveform generator.

'analog anti-aliasing filter' is a good suggestion to look for in the circuit for the drift though. Thanks !!

#### MSDhoni

##### Newbie level 4
Thanks for the suggestion ! Tried it with numpy, gave much more clarity for the problem.

Status
Not open for further replies.