简体   繁体   English

Xcorr2的MATLAB解释

[英]MATLAB interpretation of Xcorr2

I have two vectors of matching lengths. 我有两个长度匹配的向量。 They are readings from two different sensors (one is from a smartphone and the other is from a wiimote) of the same hand movement. 它们是来自两个相同手部动作的不同传感器(一个来自智能手机,另一个来自wiimote)的读数。 I am trying to find the time offset between them to synchronise the readings for further processing. 我试图找到它们之间的时间偏移以同步读数以进行进一步处理。 The readings I get are of the format (Time(ms) Value) for accelerations in the X,Y and Z direction. 我得到的读数具有X,Y和Z方向加速度的格式(时间(毫秒)值)。

For the synchronization, I plotted the cross-correlation function xcorr2() between the two sets. 对于同步,我绘制了两组之间的互相关函数xcorr2() I am getting the same graph (a weird triangle peak and a straight line at the bottom) for Accelerations along the x, y and z directions (which I guess is good) but I don't know how to interpret it. 我在x,y和z方向上得到了相同的图形(一个奇怪的三角形峰值和一个底部的直线)加速度(我想很好),但是我不知道如何解释它。 What do the axes in the graph represent? 图中的轴代表什么?

Can anyone explain to me what xcorr2() means in a qualitative sense. 任何人都可以从质上向我解释xcorr2()的含义。 From the correlation function, how do I determine the offset (ie how many seconds is sensor1 behind sensor2)? 通过相关函数,如何确定偏移量(即sensor1在sensor2之后几秒)?

在此处输入图片说明

I concur with the comment made above by Predictor. 我同意Predictor的上述评论。 To align the time series against each-other, I would pick xcorr() without the 2. Consider correlating only the acceleration magnitudes. 为了使时间序列彼此对齐,我选择不带2的xcorr() 。考虑仅关联加速度大小。 For example: 例如:

a_mag_wii = sqrt(a_x_wii.^2 + a_y_wii.^2 + a_z_wii.^2);
a_mag_phone = sqrt(a_x_phone.^2 + a_y_phone.^2 + a_z_phone.^2);
res = xcorr(a_mag_wiimote, a_mag_smartphone);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM