How to find peaks of the given signal and find the phase shift with respect to the Oscillator 1 signal?
23 views (last 30 days)
I have this set of 8 signals, I am trying to find the peaks of each signal with respect to time and also I want to find the phase shift of Oscillator 2 to Oscillator 8 with respect to Oscillator 1 signal. Thanks in advance.
I have also attached the Data.mat file.
Bjorn Gustavsson on 29 Jun 2020
If you had regularly sampled data (it doesn't seem so) this would best be done with spectrogram. That would give you the spectrogram of the function (i.e. the short-time-Fourier-transform). From that you should take the angle of the fundamental component as the phase-shift between the signals. In principal you could do it with the regular fft as well, but your signal seems to be a bit varying with time.
However, you might have to address the time-variation of your sampling first.
Otherwise this is how I'd do it:
[S1,F1,T1] = spectrogram(data(2,:),hanning(1024),216,,Fs);
[S2,F2,T2] = spectrogram(data(3,:),hanning(1024),216,,Fs);
From that you'd have to start to identify the fundamental frequency of your signals, and then take the corresponding phase-shift.