I am trying to get the phase angle between 5th harmonic and the fundamental harmonic of a 50Hz current signal sampled @10kHz. I am doing the following:
1- take a window of 200ms and apply matlab function fft
. I get here complex values.
2- Calculate the angle of every harmonic order using matlab function angle()
.
3- Substract 5th order phase from 1st order.
The issue is I am getting a rotating phase difference as shown below.
Is there any way I can get a non-rotating difference between the two harmonics. I understand that they are of different frequencies, but I am trying to get such angle according to IEC standard as shown below:
Edit This is a snapshot of the signal I am trying to analyse. The snapshot start from the closest point of zero crossing, the size of fft window is 200ms which is 10 times the signal frequency.
After running fft of the entier period in the snapshot, 150 fft windows could be obtained with the angles of fundamental and 5th order shown below.