Phase angle between two harmnic orders 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.
Absolute phase is rarely meaningful since is it's highly dependent on your exact definition of your time reference, i.e. what exactly does  $t=0$ mean.
Since your time reference changes from frame to frame, so does the phase.
If you know the fundamental frequency EXACTLY and it's phase locked to your sample clock, you can fix this simply by making the hop size (and the frame size) an integer multiple of the fundamental period.
If it's not phase locked, you can try lining up the start of your frames to the &quot;best&quot; zero crossing in your signal and get the frame length as close to an integer multiple as possible. If your signal is reasonably well behaved and fairly noise free, that should work ok.
If none of these work, ask again. There are more options, but they are also more complicated.