这是一个有趣的问题。如果您可以确定在整个600 s测量过程中发生的几个峰,并且两个信号中都存在这些峰,我认为实际上很容易优雅地解决。
在信号A中说您有时会发现五个峰
ta_peaks = [51 90 200 306 510];
and you see those same peaks in signal B, but in signal B they appear to occur at
tb_peaks = [49 89 200 307 515];
Start by fitting a relationship between ta and tb:
plot(ta_peaks,tb_peaks,'o')
抓住on
XLABEL“峰时间”
ylabel“时间B峰”
%将时间B与时间a相关联:
p = polyfit(ta_peaks,tb_peaks,2);% quadratic fit
tb_fit = polyVal(p,ta_peaks);
情节(ta_peaks,tb_fit)
现在时钟之间的关系和clock B, you can use
Interp1
将信号插入信号A时钟的时机。
b_interp = interp1(tb,b,polyval(p,ta));
现在,b_interp的峰和整体时间应与信号A保持一致。