How to find phase shift of accelerometer data
5 次查看(过去 30 天)
显示 更早的评论
I am trying to find and plot the phase shift between two accelerometers in time. Below is the basic idea I have been implementing, however it does not seem to be working for me. What am I doing wrong? Thanks for any help.
Y1Axis = DataSet(:,3);
Y2Axis = DataSet(:,4);
Fs = 3200;
N = length(Y1Axis);
ts = 1/Fs;
t = (0:N-1)/Fs;
Y1FFT = fft(Y1Axis);
Y2FFT = fft(Y2Axis);
Phase1 = angle(Y1FFT);
Phase1 = unwrap(Phase1);
Phase2 = angle(Y2FFT);
Phase2 = unwrap(Phase2);
PhaseDif = Phase1-Phase2;
plot(t, Phase1, t, Phase2, t, PhaseDif);
0 个评论
回答(1 个)
Star Strider
2014-12-31
It would help if you attached a .mat file of a relevant excerpt of ‘DataSet’, and a slightly more detailed description of what you’re doing.
See the documentation for xcorr as well. Specifically, under Examples, see ‘Delay Between Two Correlated Signals’. That may be what you want.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spectral Measurements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!