标签:signal https cross diff wave ase func csharp osi
find the phase difference between two singnals
matlab code
% phase lag of sine and cosine function % https://www.mathworks.com/help/signal/ug/cross-correlation-of-phase-lagged-sine-wave.html rng default t = 0:99; x = cos(2*pi*1/12*t); % 12 samples in one periods y = sin(2*pi*1/12*t); [xc,lags] = xcorr(y,x,24,‘coeff‘); % ‘24‘ equal to 2 periods stem(lags(25:end),xc(25:end),‘filled‘) hold on plot (t,x) %plot (t,y) plot([2.5 2.55],[-1 1]) ax = gca; ax.XTick = 0:2.5:20;
标签:signal https cross diff wave ase func csharp osi
原文地址:https://www.cnblogs.com/code-saturne/p/12694333.html