Effacer les filtres
Effacer les filtres

I have one timeseries input signal of variable frequency, and corresponding output signal. I want to measure phase shift between the two signals?

4 vues (au cours des 30 derniers jours)
Input signal has variable frequency throughout the timeseries data. The output signal has the same frequency of input data as well as another autonomous frequency. I am expecting the phase shift between these two signals at some point. I want to accurately estimate the phase angle between the two signals.

Réponses (1)

Prathamesh
Prathamesh le 27 Juil 2023
Hi,
I understand that you want to know how to calculate phase shift between input and output signals with timeseries data.
You can use “FFT” to calculate the phase shift of the timeseries data. “FFT” will convert the time domain signal into frequency domain and then you can just subtract the phases of input and output signals to get phase shift.
t = 0:0.1:10;
f = 10 + sin(t);
x = sin(2*pi*f.*t);
tsx = timeseries(y,t);
y = sin(2*pi*f.*t + pi/4);
tsy = timeseries(x,t);
X = fft(tsx.Data);
Y = fft(tsy.Data);
phase_shift = angle(Y) - angle(X);
Refer to the documentation attached to get more information on “fft” and frequency domain analysis.
I hope this resolve your issue.

Catégories

En savoir plus sur Fourier Analysis and Filtering dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by