我产生了三个相同的波,每个波都有相移。例如:
t = 1:10800; % generate time vector
fs = 1; % sampling frequency (seconds)
A = 2; % amplitude
P = 1000; % period (seconds), the time it takes for the signal to repeat itself
f1 = 1/P; % number of cycles per second (i.e. how often the signal repeats itself every second).
y1 = A*sin(2*pi*f1*t); % signal 1
phi = 10; % phase shift
y2 = A*sin(2*pi*f1*t + phi); % signal 2
phi = 15; % phase shift
y3 = A*sin(2*pi*f1*t + phi); % signal 3
YY = [y1',y2',y3'];
plot(t,YY)
我现在想使用一种方法来检测波之间的这种相移。这样做的目的是让我最终可以将该方法应用于真实数据并识别信号之间的相移。
到目前为止,我一直在考虑计算每个波和第一个波之间的交叉谱(即没有相移):
for i = 1:3;
[Pxy,Freq] = cpsd(YY(:,1),YY(:,i));
coP = real(Pxy);
quadP = imag(Pxy);
phase(:,i) = atan2(coP,quadP);
end
但我不确定这是否有意义。
有没有其他人做过类似的事情?预期的结果应该分别显示第 2 波和第 3 波在 10 和 15 处的相移。
任何意见,将不胜感激。