[go: up one dir, main page]

CN104142624A - Time synchronization method and system based on waveform matching - Google Patents

Time synchronization method and system based on waveform matching Download PDF

Info

Publication number
CN104142624A
CN104142624A CN201410403983.3A CN201410403983A CN104142624A CN 104142624 A CN104142624 A CN 104142624A CN 201410403983 A CN201410403983 A CN 201410403983A CN 104142624 A CN104142624 A CN 104142624A
Authority
CN
China
Prior art keywords
data
time
matched
bias
reference data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201410403983.3A
Other languages
Chinese (zh)
Other versions
CN104142624B (en
Inventor
牛小骥
李青丽
班亚龙
张全
龚琳琳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan University WHU
Original Assignee
Wuhan University WHU
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan University WHU filed Critical Wuhan University WHU
Priority to CN201410403983.3A priority Critical patent/CN104142624B/en
Publication of CN104142624A publication Critical patent/CN104142624A/en
Application granted granted Critical
Publication of CN104142624B publication Critical patent/CN104142624B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Position Fixing By Use Of Radio Waves (AREA)

Abstract

本发明提出了一种基于波形匹配的时间同步系统及方法,本发明利用一组含参考时间的数据,通过相关性原理,为一组不含时间标或含错误时间标的数据同步精确的时间信息。本发明首先将待匹配数据进行分段,各段分别与参考数据的不同的子段进行相关性求解,相关系数最大时,计算此段数据与参考数据之间的时间差,从而得到所有段的时间差序列;然后以时间差序列为观测值,时间差及时标漂移因子为待估参数,最小二乘平差,求解出待估参数;最后,利用时间差和时标漂移因子,为待匹配数据同步精确时间。本发明可广泛应用于多传感器数据融合时的时间同步,还可应用于检测利用其他方法进行时间同步的正确性。

The present invention proposes a time synchronization system and method based on waveform matching. The present invention uses a set of data containing reference time to synchronize accurate time information for a set of data without time stamps or with wrong time stamps through the principle of correlation. . In the present invention, the data to be matched is segmented first, and the correlation between each segment and different sub-segments of the reference data is solved. When the correlation coefficient is the largest, the time difference between the data of this segment and the reference data is calculated, thereby obtaining the time difference of all segments Then, the time difference sequence is used as the observation value, the time difference and time scale drift factor are the parameters to be estimated, and the least squares adjustment is used to solve the parameters to be estimated; finally, the time difference and time scale drift factor are used to synchronize the precise time for the data to be matched. The present invention can be widely applied to time synchronization during multi-sensor data fusion, and can also be used to detect the correctness of time synchronization by other methods.

Description

一种基于波形匹配的时间同步方法及系统A time synchronization method and system based on waveform matching

技术领域technical field

本发明涉及传感器应用领域,具体的为一种基于波形匹配的时间同步方法及系统。The invention relates to the field of sensor applications, in particular to a time synchronization method and system based on waveform matching.

背景技术Background technique

目前,多传感器数据融合技术研究方兴未艾,有些成熟的技术已经应用到了实际工程中,并取得了较好的效果。多传感器数据融合技术的应用不仅可以提高系统的精度和可靠性,还可以提高系统的测量范围,增加系统的可信度,缩短系统的反应时间。但多传感器数据融合是一个复杂的不确定信息处理过程,能够进行融合的前提条件是从每个传感器得到的信息是必须是对同一目标的同一时刻的描述。这包括两个方面,首先要保证每个传感器得到的信息是对同一目标的同一参量进行的描述。其次,要保证进行融合的数据的时间信息是同步的。在动态工作环境中,时间同步问题表现的尤为突出。At present, the research on multi-sensor data fusion technology is in the ascendant, and some mature technologies have been applied to practical projects and achieved good results. The application of multi-sensor data fusion technology can not only improve the accuracy and reliability of the system, but also improve the measurement range of the system, increase the reliability of the system, and shorten the reaction time of the system. However, multi-sensor data fusion is a complex uncertain information processing process. The prerequisite for fusion is that the information obtained from each sensor must be a description of the same target at the same time. This includes two aspects. First, it is necessary to ensure that the information obtained by each sensor is a description of the same parameter of the same target. Second, it is necessary to ensure that the time information of the data to be fused is synchronized. In a dynamic work environment, time synchronization issues are particularly prominent.

在不同的工程实践中,出现了针对具体问题的时间同步方法。例如,利用曲线拟合的方法进行时间同步的算法,利用序列的方法来解决时变观测的时间同步算法,和采用平滑滤波算法,将各传感器之间的测量数据对应的时间同步等方法。这些算法应用前,各传感器均在开始测量时打上相同时标,之后根据各自采样率进行计时。然而,对于整个测量过程,各传感器均不存在相同时标,或者本身进行计时的处理器因温度特性等因素的影响而发生频标漂移的现象,以上算法均不能正确实现多传感器之间的时间同步。In different engineering practices, problem-specific time synchronization methods have emerged. For example, the time synchronization algorithm using the curve fitting method, the time synchronization algorithm using the sequence method to solve the time-varying observation, and the smoothing filter algorithm to synchronize the time synchronization of the measurement data between the sensors. Before these algorithms are applied, each sensor is time-stamped with the same time stamp at the beginning of the measurement, and then clocked according to its respective sampling rate. However, for the entire measurement process, each sensor does not have the same time scale, or the frequency scale drift of the processor itself due to the influence of temperature characteristics and other factors, the above algorithms cannot correctly realize the time between multiple sensors Synchronize.

多传感器数据融合比较典型的例子就是GPS(Global Positioning System,全球定位系统)与INS(Inertial Navigation System,惯性导航系统)组成的组合导航系统。其中GPS搭载有较高精度的原子钟为其提供精确的时间,而INS只能通过设定的频率进行计数器计时,且INS频标经常发生漂移现象。GPS/INS组合导航系统通常采用卡尔曼滤波进行数据融合,只有GPS及INS子系统数据在同一时间点上时,组合导航才具有实际的意义。目前最通用、有效的作法是利用GPS秒脉冲信号作为组合导航系统的时间同步基准,一体化结构设计实现时间同步。然而,当一款新出的IMU(Inertial Measurement Unit,惯性测量单元)需进行组合导航测试时,上述方法虽精度高,但复杂度高,成本大,需软硬件支持,不适用。在实际测试过程中,常搭载一组较高精度的组合导航系统作为参考系统,其中的INS已打上高精度的GPS时标。A typical example of multi-sensor data fusion is the integrated navigation system composed of GPS (Global Positioning System, Global Positioning System) and INS (Inertial Navigation System, Inertial Navigation System). Among them, GPS is equipped with a high-precision atomic clock to provide accurate time, while INS can only count time through the set frequency, and the INS frequency standard often drifts. GPS/INS integrated navigation system usually adopts Kalman filter for data fusion, only when GPS and INS subsystem data are at the same time point, integrated navigation has practical significance. At present, the most common and effective method is to use the GPS second pulse signal as the time synchronization reference of the integrated navigation system, and the integrated structure design realizes time synchronization. However, when a new IMU (Inertial Measurement Unit, Inertial Measurement Unit) needs to be tested for integrated navigation, although the above method has high precision, it has high complexity, high cost, and requires hardware and software support, so it is not applicable. In the actual test process, a set of high-precision integrated navigation system is often used as a reference system, and the INS has been marked with high-precision GPS time scale.

组合导航系统中的INS时标可作为参考时间系统,只需设计适当的算法,即可实现待测试IMU与参考系统之间的时间同步,这种算法不仅适用于惯性传感器之间的时间同步,还可应用于其他具有参考时标的传感器间的时间同步。The INS time scale in the integrated navigation system can be used as a reference time system. It only needs to design an appropriate algorithm to realize the time synchronization between the IMU to be tested and the reference system. This algorithm is not only suitable for time synchronization between inertial sensors, It can also be applied to time synchronization between other sensors with a reference time scale.

发明内容Contents of the invention

本发明针对上述问题,设计了一种基于波形匹配的时间同步方法及系统;此方法及系统对不同传感器数据原有的时间系统是否相同没有限制,并且操作简单、运算快速,成本低;Aiming at the above problems, the present invention designs a time synchronization method and system based on waveform matching; this method and system have no restrictions on whether the original time systems of different sensor data are the same, and the operation is simple, the operation is fast, and the cost is low;

本发明的技术方案是:一种基于波形匹配的时间同步方法,包括如下步骤:The technical solution of the present invention is: a time synchronization method based on waveform matching, comprising the following steps:

步骤1:读取参考数据R0及待匹配数据T0Step 1: Read the reference data R 0 and the data to be matched T 0 ;

步骤2:统一参考数据R0及待匹配数据T0的数据处理格式,提取出转换后的参考数据R1及待匹配数据T1Step 2: Unify the data processing format of the reference data R 0 and the data to be matched T 0 , and extract the converted reference data R 1 and the data to be matched T 1 ;

步骤3:分别对R1和T1降采样,对降采样后的参考数据R2及待匹配数据T2进行互相关序列求解,取互相关序列最大值时对应的间隔,求出此时的粗时间差int_bias;Step 3: Downsample R 1 and T 1 respectively, solve the cross-correlation sequence for the down-sampled reference data R 2 and the data to be matched T 2 , take the interval corresponding to the maximum value of the cross-correlation sequence, and find the current coarse time difference int_bias;

步骤4:根据求得的粗时间差int_bias,使参考数据R2的时间段覆盖待匹配数据T2的时间段,且前后各超出待匹配数据T2一定长度,截取参考数据R2及待匹配数据T2;进入步骤5;Step 4: According to the obtained rough time difference int_bias, make the time period of the reference data R 2 cover the time period of the data to be matched T 2 , and each exceed a certain length of the data to be matched T 2 , intercept the reference data R 2 and the data to be matched T 2 ; enter step 5;

步骤5:统一R2和T2采样率,得到相同采样率的参考数据R3和待匹配数据T3Step 5: Unify the sampling rates of R 2 and T 2 to obtain the reference data R 3 and the data to be matched T 3 of the same sampling rate;

步骤6:求得R3和T3的最优时间差bias及时标漂移因子k。Step 6: Calculate the optimal time difference bias and time scale drift factor k between R 3 and T 3 .

步骤7:根据最佳bias及k组合,更新待匹配数据T0时间,并存储;Step 7: According to the best combination of bias and k, update the time T 0 of the data to be matched, and store it;

步骤8:结束。Step 8: End.

所述的步骤2中统一参考数据R0及待匹配数据T0的数据处理格式的公式如下:The formula for the data processing format of the unified reference data R0 and the data to be matched T0 in the step 2 is as follows:

v=Δs/Δts v=Δs/Δt s

其中,Δs为前后两个采样之间陀螺或加速度计所测量的增量值,Δts为前后两个采样之间的时间间隔,v为Δs对应的速率值;Among them, Δs is the incremental value measured by the gyro or accelerometer between the two samples before and after, Δt s is the time interval between the two samples before and after, and v is the rate value corresponding to Δs;

所述的转换后参考数据R1及待匹配数据T1是以转换后的时间列及进行波形匹配的一轴数据组成;The converted reference data R1 and the data to be matched T1 are composed of converted time series and one-axis data for waveform matching;

所述的步骤3中包括如下步骤:Described step 3 comprises the following steps:

步骤3.1:分别对R1和T1降采样,得到降采样后的参考数据R2及待匹配数据T2Step 3.1: Downsample R1 and T1 respectively to obtain the downsampled reference data R2 and the data to be matched T2 ;

步骤3.2:对降采样后R2和T2之中较短的序列后补零,直到两者长度相等;Step 3.2: After the downsampling, the shorter sequence of R 2 and T 2 is zero-filled until the two lengths are equal;

步骤3.3:计算R2与T2的互相关序列;互相关序列计算公式如下:Step 3.3: Calculate the cross-correlation sequence of R 2 and T 2 ; the calculation formula of the cross-correlation sequence is as follows:

RR ^^ xyxy (( mm )) == &Sigma;&Sigma; KK == 00 NN -- mm -- 11 xx KK ++ mm ythe y mm mm &GreaterEqual;&Greater Equal; 00 RR ^^ xyxy (( -- mm )) mm << 00

其中,x和y为进行相关性处理的序列,x和y长度均为N,K和m分别用于表示序列x和y中的值的序数,m取值为-(N-1)到+(N-1);Among them, x and y are the sequences for correlation processing, the lengths of x and y are both N, K and m are used to represent the ordinal numbers of the values in the sequence x and y respectively, and the value of m is -(N-1) to + (N-1);

步骤3.4:取互相关序列最大值m时对应的间隔,求出此时的粗时间差int_bias,则粗时间差可利用下式求得:Step 3.4: Take the cross-correlation sequence The interval corresponding to the maximum value m, and the rough time difference int_bias at this time is calculated, then the rough time difference can be obtained using the following formula:

int_bias=R2(t0)-T2(t0)-T2_interval×mint_bias=R 2 (t 0 )-T 2 (t 0 )-T 2 _interval×m

其中,R2(t0)为R2开始时间,T2(t0)为T2开始时间,T2_interval为错开的间隔所代表的时间长度,为T2的采样间隔,则T2_interval×m为两列数据错开的时间;Among them, R 2 (t 0 ) is the start time of R 2 , T 2 (t 0 ) is the start time of T 2 , T 2 _interval is the time length represented by the staggered interval, which is the sampling interval of T 2 , then T 2 _interval ×m is the staggered time of two columns of data;

所述的步骤6.15中,包括如下子步骤:In the described step 6.15, the following sub-steps are included:

步骤6.1:计算亚采样间隔时间T_inter;Step 6.1: Calculate the sub-sampling interval T_inter;

步骤6.2:以T_inter为倍数因子,计算待匹配数据向右平移距离的δs;Step 6.2: Using T_inter as the multiple factor, calculate the δs of the translation distance to the right of the data to be matched;

步骤6.3:判断δs是否为采样间隔的正整数倍;若是,转到步骤S6.15,若不是,转到步骤S6.4;Step 6.3: Determine whether δs is a positive integer multiple of the sampling interval; if so, go to step S6.15, if not, go to step S6.4;

步骤6.4:将待匹配数据数据T3平移δs得到T4Step 6.4: Translating the data T 3 to be matched by δs to obtain T 4 ;

步骤6.5:以Δt为窗口长度,将T4分为有限n段,取当前段数据T4(i),1≤i≤n;Step 6.5: Take Δt as the window length, divide T 4 into finite n segments, and take the current segment data T 4 (i), 1≤i≤n;

步骤6.6:判断待匹配数据是否提取到第n段;若是,转到步骤S6.13;若不是,转到步骤S6.7;Step 6.6: Determine whether the data to be matched is extracted to the nth segment; if so, go to step S6.13; if not, go to step S6.7;

步骤6.7:设定滑动窗口W1,窗长为Δt,起始点为当前段开始时刻;Step 6.7: Set the sliding window W 1 , the window length is Δt, and the starting point is the starting time of the current segment;

步骤6.8:判断窗口滑动距离是否大于设定长度σs;如若是,转到步骤S6.11;否则,以W1为窗口,取参考数据R3(W1);Step 6.8: Determine whether the sliding distance of the window is greater than the set length σ s ; if yes, go to step S6.11; otherwise, take W 1 as the window and take the reference data R 3 (W 1 );

步骤6.9:计算T4(i)与R3(W1)之间的皮尔森相关系数;皮尔森相关系数计算如下式:Step 6.9: Calculate the Pearson correlation coefficient between T 4 (i) and R 3 (W 1 ); the Pearson correlation coefficient is calculated as follows:

rr == &Sigma;&Sigma; ii == 11 NN (( xx ii -- xx &OverBar;&OverBar; )) (( ythe y ii -- ythe y &OverBar;&OverBar; )) &Sigma;&Sigma; ii == 11 NN (( xx ii -- xx &OverBar;&OverBar; )) 22 &CenterDot;&Center Dot; &Sigma;&Sigma; ii == 11 NN (( ythe y ii -- ythe y &OverBar;&OverBar; )) 22

其中为x序列均值,为y序列均值,N为序列x和y的长度,r为序列x和y之间的皮尔森相关系数;in is the mean value of the x series, is the mean value of the y sequence, N is the length of the sequence x and y, and r is the Pearson correlation coefficient between the sequence x and y;

步骤6.10:判断参考数据是否读到最后一位,若是,转到步骤S6.11;否则,将窗口W1向后滑动一个参考数据的采样间隔后,转到步骤S6.8;Step 6.10: Determine whether the reference data has read the last bit, if so, go to step S6.11; otherwise, slide the window W 1 backward for a sampling interval of the reference data, and then go to step S6.8;

步骤6.11:计算此段时间差Bias(i)及对应的时间time(i);Step 6.11: Calculate the time difference Bias(i) and the corresponding time time(i);

步骤6.12:提取下一段待匹配数据。取下一段T4(i),转到步骤6.6;Step 6.12: Extract the next segment of data to be matched. Take the next segment T 4 (i) and go to step 6.6;

步骤6.13:用最小二乘平差求时间差bias及时标漂移因子k;以bias及k作为待估参数,Bias(i)为观测值,观测方程如下:Step 6.13: Use the least squares adjustment to find the time difference bias and time scale drift factor k; take bias and k as the parameters to be estimated, Bias(i) as the observed value, and the observation equation is as follows:

Bias(i)=k×[time(i)-t0]+biasBias(i)=k×[time(i)-t 0 ]+bias

其中bias的初值Bias0为Bias(i)序列中值,对应的时间即为t0,k的初值为0;Among them, the initial value of bias, Bias0, is the median value of the Bias(i) sequence, and the corresponding time is t 0 , and the initial value of k is 0;

步骤6.14:判断δs是否大于一个采样间隔,若是,则转到步骤S6.15;否则,将δs增加一倍T_inter,转到步骤S6.3;Step 6.14: Determine whether δs is greater than a sampling interval, if so, go to step S6.15; otherwise, double δs by T_inter, go to step S6.3;

步骤6.15:选择最佳bias及k组合;利用不同组bias及k,得到不同时间同步后的待匹配数据;Step 6.15: Select the best combination of bias and k; use different sets of bias and k to obtain data to be matched after synchronization at different times;

所述的步骤6.15中,若数据为单轴,则选择协方差最大时的那组bias和k作为最佳bias和k组合;若数据为多轴,选择最可信的一轴数据进行协方差求解,选择最佳bias和k组合。In the step 6.15, if the data is uniaxial, select the set of bias and k with the largest covariance as the best combination of bias and k; if the data is multi-axial, select the most credible one-axis data for covariance Solve, choose the best combination of bias and k.

所述的步骤7中利用下式计算更新T0时间:In described step 7, utilize following formula to calculate and update T 0 time:

t′=(t-t0)×k+bias+tt'=(tt 0 )×k+bias+t

其中,t为T0的时间列,t0为步骤6.12中选择的时间差初值对应的时间,k为时标漂移因子,bias为时间差,t′为t更新后时间。Among them, t is the time column of T 0 , t 0 is the time corresponding to the initial value of the time difference selected in step 6.12, k is the time scale drift factor, bias is the time difference, and t′ is the time after t is updated.

一种基于波形匹配的时间同步系统,其特征在于,包括如下模块:A time synchronization system based on waveform matching, characterized in that it includes the following modules:

读取模块:用于读取参考数据R0及待匹配数据T0Reading module: used to read reference data R 0 and data to be matched T 0 ;

数据处理格式模块:用于统一参考数据R0及待匹配数据T0的数据处理格式,提取出转换后的参考数据R1及待匹配数据T1Data processing format module: used to unify the data processing format of the reference data R 0 and the data T 0 to be matched, and extract the converted reference data R 1 and the data T 1 to be matched;

降采样模块:用于分别对R1和T1降采样,对降采样后的参考数据R2及待匹配数据T2进行互相关序列求解,取互相关序列最大值时对应的间隔,求出此时的粗时间差int_bias;Downsampling module: it is used to downsample R1 and T1 respectively, solve the cross-correlation sequence for the reference data R2 after downsampling and the data T2 to be matched, and obtain the corresponding interval when the maximum value of the cross-correlation sequence is obtained. The coarse time difference int_bias at this time;

粗时间差模块:用于根据求得的粗时间差int_bias,使参考数据R2的时间段覆盖待匹配数据T2的时间段,且前后各超出待匹配数据T2一定长度,截取参考数据R2及待匹配数据T2Coarse time difference module: used to make the time period of the reference data R2 cover the time period of the data to be matched T2 according to the obtained rough time difference int_bias, and each of the front and rear exceeds a certain length of the data to be matched T2 , intercepting the reference data R2 and Data to be matched T 2 ;

采样率计算模块:用于统一R2和T2采样率,得到相同采样率的参考数据R3和待匹配数据T3Sampling rate calculation module: used to unify the sampling rates of R 2 and T 2 to obtain reference data R 3 and data to be matched T 3 of the same sampling rate;

计算模块:用于求得R3和T3的最优时间差bias及时标漂移因子k;Calculation module: used to obtain the optimal time difference bias and time scale drift factor k of R 3 and T 3 ;

更新模块:用于根据最佳bias及k组合,更新待匹配数据T0时间,并存储。Update module: used to update the data to be matched T 0 time according to the best bias and k combination, and store it.

附图说明Description of drawings

图1是本发明的流程示意图;Fig. 1 is a schematic flow sheet of the present invention;

图2是本发明步骤6的流程示意图;Fig. 2 is the schematic flow chart of step 6 of the present invention;

图3-1是EPSON陀螺垂向方向角速率波形示意图;Figure 3-1 is a schematic diagram of the angular rate waveform in the vertical direction of the EPSON gyroscope;

图3-2是FSAS陀螺垂向方向角速率波形示意图;Figure 3-2 is a schematic diagram of the angular rate waveform in the vertical direction of the FSAS gyroscope;

图4-1是EPSON陀螺三个轴分段求得的最大相关系数示意图;Figure 4-1 is a schematic diagram of the maximum correlation coefficient obtained by segmenting the three axes of the EPSON gyroscope;

图4-2是EPSON加速度计三个轴分段求得的最大相关系数示意图;Figure 4-2 is a schematic diagram of the maximum correlation coefficient obtained by segmenting the three axes of the EPSON accelerometer;

图5-1是EPSON陀螺三个轴分段求解出的时标差序列示意图;Figure 5-1 is a schematic diagram of the time scale difference sequence solved by the three axes of the EPSON gyroscope;

图5-2是EPSON加速度计三个轴分段求解出的时标差序列示意图;Figure 5-2 is a schematic diagram of the time scale difference sequence solved by the three axes of the EPSON accelerometer;

图6是陀螺垂向方向时间匹配结果示意图;Fig. 6 is a schematic diagram of the time matching result in the vertical direction of the gyroscope;

图7是陀螺垂向方向时间匹配结果局部示意图;Fig. 7 is a partial schematic diagram of the time matching result in the vertical direction of the gyroscope;

图8是本发明的系统结构示意图。Fig. 8 is a schematic diagram of the system structure of the present invention.

具体实施方式Detailed ways

下面结合附图及实施例,对本发明作进一步详细的描述。The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments.

实施例以惯性传感器采集的数据进行说明,惯性传感器可采集多轴数据,本实施例即以多轴数据处理为例。The embodiment is described by taking data collected by an inertial sensor. The inertial sensor can collect multi-axis data. This embodiment takes multi-axis data processing as an example.

实施例中数据来源:在车载测试时,同时搭载低精度IMU EPSON与含高精度IMU FSAS的GPS/INS组合导航系统,其中EPSON采集到的数据中以计数器计时,组合导航系统中FSAS经过与GPS一体化设计,已经被打上精确的GPS时间。Data source in the embodiment: during on-vehicle test, carry the GPS/INS integrated navigation system of low-accuracy IMU EPSON and containing high-accuracy IMU FSAS simultaneously, wherein in the data that EPSON gathers with counter timing, FSAS passes through and GPS in the integrated navigation system Integrated design, has been marked with accurate GPS time.

实施例中数据格式:EPSON采样率为125Hz,数据含7列,其中第一列为时间列,第2~4列为陀螺仪采集的三列角速率,分别为前向、右向和垂向,第5~7列为加速度计采集的三列加速度,分别为前向、右向和垂向;FSAS采样率为200Hz,第一列为时间列,第2~4列为陀螺仪采集的三列角速度增量,分别为前向、右向和垂向,第5~7列为加速度计采集的三列加速度增量,分别为前向、右向和垂向。Data format in the embodiment: EPSON sampling rate is 125Hz, the data contains 7 columns, the first column is the time column, and the 2nd to 4th columns are the three columns of angular rates collected by the gyroscope, which are forward, right and vertical respectively , the 5th to 7th columns are the three columns of acceleration collected by the accelerometer, which are forward, right and vertical; Columns of angular velocity increments are forward, right and vertical, respectively. Columns 5 to 7 are three columns of acceleration increments collected by the accelerometer, which are forward, right and vertical.

本发明可为无时间标或时间标不准的数据同步精确的时间信息。其实现步骤如图1所示,图2为图1中最优时间差及时标漂移因子求解步骤。The present invention can synchronize accurate time information for data without a time mark or with an inaccurate time mark. The implementation steps are shown in Figure 1, and Figure 2 shows the steps for solving the optimal time difference and time scale drift factor in Figure 1.

S1:读取参考数据R0及待匹配数据T0。其中FSAS数据作为参考数据R0,EPSON数据作为待匹配数据T0S1: Read reference data R 0 and data to be matched T 0 . The FSAS data is used as the reference data R 0 , and the EPSON data is used as the data to be matched T 0 .

S2:统一参考数据R0及待匹配数据T0的数据处理格式,提取出转换后的参考数据R1及待匹配数据T1(有用数据列);根据已有先验信息,判断R0与T0所表示的参量是否相同。若不同,则根据参量间的相互关系进行转换,最终以常用数据格式为准。此例中,EPSON为速率形式,而FSAS为增量格式,常用的数据处理格式为速率格式。增量转换为速率的公式如下:S2: Unify the data processing format of the reference data R 0 and the data to be matched T 0 , extract the converted reference data R 1 and the data to be matched T 1 (useful data column); judge the relationship between R 0 and Whether the parameters represented by T 0 are the same. If they are different, the conversion will be performed according to the relationship between the parameters, and finally the commonly used data format shall prevail. In this example, EPSON is the rate format, while FSAS is the incremental format, and the commonly used data processing format is the rate format. The formula for converting increments to rates is as follows:

v=Δs/Δts v=Δs/Δt s

其中,Δs为前后两个采样之间陀螺或加速度计所测量的增量值,Δts为前后两个采样之间的时间间隔,v为Δs对应的速率值。Among them, Δs is the incremental value measured by the gyro or accelerometer between the two samples before and after, Δt s is the time interval between the two samples before and after, and v is the velocity value corresponding to Δs.

利用上式对R0进行转换,相应的时间为前后两个采样时间的均值。若以其中一轴数据进行波形匹配,则提取出转换后的时间列及当轴数据组成新的参考数据R1。此例中,对6个轴的数据均进行波形匹配,最终FSAS数据R1为R0转化后数据,EPSON数据T1为T0Use the above formula to convert R 0 , and the corresponding time is the mean value of the two sampling times before and after. If one of the axis data is used for waveform matching, the converted time series and current axis data are extracted to form new reference data R 1 . In this example, waveform matching is performed on the data of the 6 axes, the final FSAS data R 1 is the converted data of R 0 , and the EPSON data T 1 is T 0 .

如图3-1和图3-2所示为R1与T1第4列垂向陀螺数据波形,从图中可看出,两波形具有高度一致性,其他轴也有相同特征,这样即可根据两数据的相关系数来进行波形匹配。Figure 3-1 and Figure 3-2 show the vertical gyro data waveforms in the fourth column of R 1 and T 1. It can be seen from the figure that the two waveforms are highly consistent, and other axes also have the same characteristics, so that Waveform matching is performed according to the correlation coefficient of the two data.

S3:对R1和T1降采样,对降采样后的参考数据R2及待匹配数据T2进行互相关序列求解,取互相关序列最大值时对应的间隔,求出此时的粗时间差int_bias;S3: Downsample R 1 and T 1 , solve the cross-correlation sequence for the down-sampled reference data R 2 and the data to be matched T 2 , take the interval corresponding to the maximum value of the cross-correlation sequence, and find the rough time difference at this time int_bias;

首先,对待匹配数据及参考数据进行降采样处理,降采样后频率为两组数据原始频率的公因数,在满足粗时间差精度的基础上,越小越好。实施例中将R1和T1降采样为5Hz,对降采样后FSAS数据R2及EPSON数据T2进行互相关序列求解,取互相关序列最大值时对应的间隔,求出此时的粗时间差int_bias。具体步骤如下:First, the matching data and reference data are down-sampled. The frequency after down-sampling is the common factor of the original frequency of the two sets of data. On the basis of meeting the accuracy of the coarse time difference, the smaller the better. In the embodiment, R1 and T1 are down-sampled to 5 Hz, and the cross-correlation sequence is solved for the FSAS data R2 and EPSON data T2 after the down-sampling, and the corresponding interval when the maximum value of the cross-correlation sequence is taken is obtained to obtain the rough Time difference int_bias. Specific steps are as follows:

S3.1:对R1和T1降采样,得到降采样后的参考数据R2及待匹配数据T2S3.1: down-sampling R 1 and T 1 to obtain reference data R 2 after down-sampling and data T 2 to be matched;

S3.2:在R2和T2较短的序列后补零直到两者长度相等;S3.2: Pad zero after the shorter sequence of R 2 and T 2 until the two lengths are equal;

S3.3:计算R2与T2的互相关序列。互相关序列计算一般原理公式如下:S3.3: Calculate the cross-correlation sequence of R 2 and T 2 . The general principle formula of cross-correlation sequence calculation is as follows:

RR ^^ xyxy (( mm )) == &Sigma;&Sigma; KK == 00 NN -- mm -- 11 xx KK ++ mm ythe y mm mm &GreaterEqual;&Greater Equal; 00 RR ^^ xyxy (( -- mm )) mm << 00

其中x和y为进行相关性处理的序列,x和y长度均为N,下标K和m用于表示序列x和y中的值的序数,m取值为-(N-1)到+(N-1)。为互相关序列,为m小于零时,利用m大于零的公式计算出来的互相关序列。当m取-(N-1)到+(N-1)中不同的值时,都可利用上式计算求得一个互相关值最终,得到矢量长度为2×N-1的互相关函数序列值。Where x and y are sequences for correlation processing, the lengths of x and y are both N, the subscripts K and m are used to represent the ordinal numbers of the values in the sequences x and y, and m ranges from -(N-1) to + (N-1). is a cross-correlation sequence, When m is less than zero, use the formula of m greater than zero to calculate the cross-correlation sequence. When m takes different values from -(N-1) to +(N-1), the above formula can be used to calculate a cross-correlation value Finally, a sequence value of the cross-correlation function with a vector length of 2×N-1 is obtained.

步骤3.4:取互相关序列最大值m时对应的间隔,求出此时的粗时间差int_bias,本例中,经末尾补零长度相等后的R2与T2的第四列即为需进行相关性处理的序列x和y,利用上式计算求得互相关序列值值最大时对应的m,即为两列数据相关性最大时,错开的间隔。则粗时间差可利用下式求得:Step 3.4: Take the cross-correlation sequence The corresponding interval when the maximum value is m, and calculate the rough time difference int_bias at this time. In this example, the fourth column of R 2 and T 2 after padding at the end and equal length is the sequence x and y that need to be correlated , using the above formula to calculate the cross-correlation sequence value The m corresponding to the maximum value is the staggered interval when the correlation between the two columns of data is maximum. Then the rough time difference can be obtained by using the following formula:

int_bias=R2(t0)-T2(t0)-T2_interval×mint_bias=R 2 (t 0 )-T 2 (t 0 )-T 2 _interval×m

R2(t0)为R2开始时间,T2(t0)为T2开始时间,T2_interval为错开的间隔所代表的时间长度,此例中为T2的采样间隔,则T2_interval×m为两列数据错开的时间。R 2 (t 0 ) is the start time of R 2 , T 2 (t 0 ) is the start time of T 2 , T 2 _interval is the time length represented by the staggered interval, in this example it is the sampling interval of T 2 , then T 2 _interval×m is the time when two columns of data are staggered.

S4:根据求得的粗时间差int_bias,使参考数据R2的时间段覆盖待匹配数据T2的时间段,且前后各超出待匹配数据T2一定长度,截取参考数据R2及待匹配数据T2。此步的目的是依据粗时间差,找到待匹配数据T2与参考数据R2之间对应的时间段,使参考数据R2包含待匹配数据T2,且前后各超出待匹配数据T2一定长度的原则,截取参考数据R2及待匹配数据T2。本实施例中,求得的粗匹配时间精度为1秒级,故在取FSAS数据时,使得其前后各超出FSAS数据0.5秒,进入S5。S4: According to the obtained rough time difference int_bias, make the time period of the reference data R 2 cover the time period of the data to be matched T 2 , and each exceed a certain length of the data to be matched T 2 before and after, and intercept the reference data R 2 and the data to be matched T 2 2 . The purpose of this step is to find the corresponding time period between the data to be matched T 2 and the reference data R 2 based on the rough time difference, so that the reference data R 2 contains the data to be matched T 2 , and each exceeds the data to be matched T 2 by a certain length According to the principle, the reference data R 2 and the data to be matched T 2 are intercepted. In this embodiment, the obtained rough matching time accuracy is at the level of 1 second, so when fetching the FSAS data, the front and rear are respectively exceeded by 0.5 seconds to enter S5.

S5:统一R2和T2采样率,得到相同采样率的参考数据R3和待匹配数据T3;FSAS采样率为200Hz,EPSON采样率为125Hz,最终对T0进行线性内插,使其采样率为200Hz。S5: Unify the sampling rate of R 2 and T 2 to obtain the reference data R 3 and the data to be matched T 3 with the same sampling rate; the sampling rate of FSAS is 200Hz, the sampling rate of EPSON is 125Hz, and finally perform linear interpolation on T 0 to make it The sampling rate is 200Hz.

经上述所有步骤后,FSAS数据为R3,EPSON数据为T3After all the above steps, the FSAS data is R 3 , and the EPSON data is T 3 .

S6:求得R3和T3的最优时间差bias及时标漂移因子k;时间差及时标漂移因子的求解是本算法的核心,计算量最大,同时也是最复杂的一步。S6: Obtain the optimal time difference bias between R 3 and T 3 and the scale drift factor k; the calculation of the time difference and time scale drift factor is the core of this algorithm, and it is the most computationally intensive and most complicated step.

S6.1:计算亚采样间隔时间T_inter,以采样间隔的1/10~1/2之间为宜。亚采样间隔定义为低于采样间隔的任意值,具体实施中,以用户精度要求为准则,适当取值。T_inter过小,精度有提高,但准确度没有提高,且计算量增大;T_inter过大,达不到提高精度的要求。例如,本例中R3与T3的采样间隔时间为0.005秒,则亚采样间隔T_inter定义为采样间隔的1/5秒。S6.1: Calculate the sub-sampling interval T_inter, preferably between 1/10 and 1/2 of the sampling interval. The sub-sampling interval is defined as any value lower than the sampling interval. In the specific implementation, the user's accuracy requirements are taken as the criterion, and the appropriate value is selected. If T_inter is too small, the accuracy is improved, but the accuracy is not improved, and the amount of calculation is increased; if T_inter is too large, it cannot meet the requirement of improving accuracy. For example, in this example, the sampling interval between R 3 and T 3 is 0.005 second, and the sub-sampling interval T_inter is defined as 1/5 second of the sampling interval.

S6.2:以T_inter为倍数因子,计算待匹配数据向右平移距离的δs。在第一次循环时,δs为0倍T_inter,即δs=0×T_inter=0。S6.2: Using T_inter as the multiple factor, calculate the δs of the translation distance to the right of the data to be matched. In the first cycle, δs is 0 times T_inter, that is, δs=0×T_inter=0.

S6.3:判断δs是否为采样间隔的正整数倍。若是,转到步骤S6.15若不是,转到步骤S6.4。S6.3: Determine whether δs is a positive integer multiple of the sampling interval. If yes, go to step S6.15; if not, go to step S6.4.

S6.4:将EPSON数据平移δs。先将T3的时间列进行向右平移,平移距离为δs,平移后时间列作为内插点,将其他列数据线性内插出新的数值T4。例如存在原始时间t1、t2,对应的数值为val1、val2,则对于新的时间t3(t1<t3<t2),对应的数值val3由下式线性内插出来:S6.4: Translate the EPSON data by δs. First, the time column of T 3 is shifted to the right, and the translation distance is δs. After the shift, the time column is used as the interpolation point, and the data of other columns are linearly interpolated to obtain a new value T 4 . For example, there are original times t 1 and t 2 , and the corresponding values are val 1 and val 2 , then for the new time t 3 (t 1 <t 3 <t 2 ), the corresponding value val 3 is linearly interpolated by the following formula :

valval 33 == valval 11 ++ (( tt 33 -- tt 11 )) &times;&times; valval 22 -- valval 11 tt 22 -- tt 11

S6.5:以Δt为窗口长度,将T4分为有限的n段,取当前段数据T4(i),1≤i≤n。Δt窗口长度内,应能包含丰富的动态信息,以克制随机噪声的影响。本例中,Δt取为60秒,T4被分为61段,取第一段T4(1)。S6.5: Take Δt as the window length, divide T 4 into n limited segments, and take the current segment data T 4 (i), 1≤i≤n. Within the window length of Δt, it should be able to contain rich dynamic information to restrain the influence of random noise. In this example, Δt is taken as 60 seconds, T 4 is divided into 61 sections, and the first section T 4 (1) is taken.

S6.6:判断待匹配数据是否提取到第n段。若是,转到步骤S6.13。若不是,转到步骤S6.7。S6.6: Determine whether the data to be matched is extracted to the nth segment. If yes, go to step S6.13. If not, go to step S6.7.

S6.7:设定滑动窗口W1,窗长为Δt,起始点为当前段开始时刻。窗长与S6.5中的窗长一样为60秒,W1每次沿时间轴向后平移一个采样间隔取参考数据,窗口滑动距离为W1向后平移总时间,计算方式为:W1向后平移采样间隔数乘以采样间隔时间。S6.7: Set the sliding window W 1 , the window length is Δt, and the starting point is the starting time of the current segment. The window length is the same as the window length in S6.5, which is 60 seconds. W 1 shifts one sampling interval backward along the time axis each time to obtain reference data. The sliding distance of the window is the total time of backward shifting by W 1 , and the calculation method is: W 1 Shift backwards by the number of sample intervals multiplied by the sample interval time.

S6.8:判断窗口滑动距离是否大于设定长度σss依据粗匹配时间精度而定,约为两倍粗匹配时间精度),如若是,转到步骤S6.11。否则,以W1为窗口,取参考数据R3(W1)。本例中,σs为1秒。S6.8: Determine whether the sliding distance of the window is greater than the set length σ ss depends on the rough matching time precision, which is about twice the rough matching time precision), if yes, go to step S6.11. Otherwise, take W 1 as the window, and take the reference data R 3 (W 1 ). In this example, σ s is 1 second.

S6.9:计算T4(i)与R3(W1)之间的皮尔森相关系数。皮尔森相关系数计算原理如下式:S6.9: Calculate the Pearson correlation coefficient between T 4 (i) and R 3 (W 1 ). The calculation principle of Pearson correlation coefficient is as follows:

rr == &Sigma;&Sigma; ii == 11 NN (( xx ii -- xx &OverBar;&OverBar; )) (( ythe y ii -- ythe y &OverBar;&OverBar; )) &Sigma;&Sigma; ii == 11 NN (( xx ii -- xx &OverBar;&OverBar; )) 22 &CenterDot;&Center Dot; &Sigma;&Sigma; ii == 11 NN (( ythe y ii -- ythe y &OverBar;&OverBar; )) 22

其中为x序列均值,为y序列均值,N为序列x和y的长度,r为序列x和y之间的皮尔森相关系数。此例中,T4(i)与R3(W1)各含六列数据,各对应列数据依据上式单独进行相关系数求解,每一对应轴均得到一个相关系数,共六个。in is the mean value of the x series, is the mean value of the y sequence, N is the length of the sequence x and y, and r is the Pearson correlation coefficient between the sequence x and y. In this example, T 4 (i) and R 3 (W 1 ) each contain six columns of data, and the correlation coefficients of each corresponding column of data are calculated independently according to the above formula, and each corresponding axis obtains a correlation coefficient, a total of six.

S6.10:判断参考数据是否读到最后一位,若是,转到步骤S6.11。否则,将窗口W1向后滑动一个参考数据的采样间隔后,转到步骤S6.8。S6.10: Determine whether the last digit of the reference data has been read, if so, go to step S6.11. Otherwise, after sliding the window W 1 backward by one sampling interval of the reference data, go to step S6.8.

S6.11:计算此段时间差Bias(i)及对应的时间time(i)。对于此段EPSON数据,W1的滑动过程中,T4(i)与R3(W1)每一对应列数据之间均可得相应的相关系数列。对其中一组对应列数据而言,当相关系数最大时,两列数据波形最佳匹配,此时的最大相关系数max_corr,W1向右滑动的采样间隔数为num。则此轴可用下式计算出一个Bias(i),其他轴同理。S6.11: Calculate the time difference Bias(i) and the corresponding time time(i). For this segment of EPSON data, during the sliding process of W 1 , the corresponding correlation coefficient series can be obtained between each corresponding column data of T 4 (i) and R 3 (W 1 ). For one set of corresponding column data, when the correlation coefficient is the largest, the waveforms of the two columns of data match best. At this time, the maximum correlation coefficient max_corr, the number of sampling intervals W 1 slides to the right is num. Then this axis can use the following formula to calculate a Bias(i), and the other axes are the same.

Bias(i)=R3(t0)-T4(t0)+R3_interval×numBias(i)=R 3 (t 0 )-T 4 (t 0 )+R 3 _interval×num

R3(t0)为R3开始时间,T4(t0)为T4开始时间,R3_interval为W1右向移动一个采样间隔所代表的时间,此例为R3的采样间隔,则R3_interval×num为W1向右滑动总时长。R 3 (t 0 ) is the start time of R 3 , T 4 (t 0 ) is the start time of T 4 , and R 3 _interval is the time represented by W 1 moving to the right by one sampling interval. This example is the sampling interval of R 3 , Then R 3 _interval×num is the total duration of W 1 sliding to the right.

计算得到六个轴的Bias(i)后,以各轴max_corr为权重,加权平均得到T4(i)唯一的Bias(i),此段的max_corr(i)为各轴max_corr的算术平均值,time(i)为T4(i)的中间时刻时间。After calculating the Bias(i) of the six axes, take the max_corr of each axis as the weight, and obtain the unique Bias(i) of T 4 (i) on a weighted average. The max_corr(i) of this section is the arithmetic mean of the max_corr of each axis. time(i) is the middle time of T 4 (i).

此段待匹配数据与参考数据之间的时间差已计算完毕。The time difference between the data to be matched and the reference data in this period has been calculated.

S6.12:提取下一段待匹配数据。取下一段T4(i),转到步骤6.6。S6.12: Extract the next segment of data to be matched. Take the next segment of T 4 (i) and go to step 6.6.

如图4-1和4-2所示,为EPSON六个轴所有段求得的最大相关系数。相关系数越大,数据波形匹配程度越高。从图中也可看出,在第16段之后,相关系数接近于1,表明EPSON与FSAS数据波形一致性较高,且能由此方法识别出最佳匹配段。As shown in Figure 4-1 and 4-2, the maximum correlation coefficient obtained for all segments of the six axes of EPSON. The larger the correlation coefficient, the higher the matching degree of the data waveform. It can also be seen from the figure that after the 16th segment, the correlation coefficient is close to 1, indicating that the waveform consistency of EPSON and FSAS data is high, and the best matching segment can be identified by this method.

如图5-1和5-2所示,由各段最大相关系数计算得到的时间差序列,选取相关系数较大时的时段。由图中可看出此方法不仅能计算出EPSON的时间差,还可发现EPSON的频标存在漂移。As shown in Figures 5-1 and 5-2, for the time difference sequence calculated from the maximum correlation coefficient of each segment, select the period when the correlation coefficient is relatively large. It can be seen from the figure that this method can not only calculate the time difference of EPSON, but also find that the frequency standard of EPSON drifts.

S6.13:最小二乘平差求时间差bias及时标漂移因子k。以bias及k作为待估参数,Bias(i)为观测值,观测方程如下:S6.13: Calculate the time difference bias and time scale drift factor k by least squares adjustment. Taking bias and k as the parameters to be estimated, and Bias(i) as the observed value, the observation equation is as follows:

Bias(i)=k×[time(i)-t0]+biasBias(i)=k×[time(i)-t 0 ]+bias

其中bias的初值Bias0为Bias(i)序列中值,对应的时间即为t0,k的初值为0。The initial value of bias, Bias0, is the median value of the Bias(i) sequence, and the corresponding time is t 0 , and the initial value of k is 0.

Bias(i)的权为max_corr(i)。为去除观测值中的粗差,设定一个相关系数阈值σr,此例中,σr为0.9。只有当max_corr(i)大于0.9时,观测值才代入观测方程,进行最小二乘平差求解,求得一组bias及k。The weight of Bias(i) is max_corr(i). In order to remove gross errors in the observed values, set a correlation coefficient threshold σ r , in this example, σ r is 0.9. Only when max_corr(i) is greater than 0.9, the observed value is substituted into the observation equation, and the least squares adjustment is performed to obtain a set of bias and k.

S6.14:判断δs是否大于一个采样间隔,若是,则转到步骤S6.15。否则,将δs增加一倍T_inter,转到步骤S6.3。S6.14: Determine whether δs is greater than a sampling interval, if so, go to step S6.15. Otherwise, double δs by T_inter and go to step S6.3.

S6.15:选择最佳bias及k组合。利用不同组bias及k,得到不同时间同步后的待匹配数据。计算待匹配数据与参考数据之间的协方差。若数据为单轴,则选择协方差最大时的那组bias和k作为最佳bias和k组合;若数据为多轴时,以实际经验为准,选择最可信的一轴数据进行协方差求解,选择最佳bias和k组合。S6.15: Select the best combination of bias and k. Different sets of bias and k are used to obtain data to be matched after synchronization at different times. Calculate the covariance between the data to be matched and the reference data. If the data is single-axis, select the group of bias and k with the largest covariance as the best combination of bias and k; if the data is multi-axis, select the most credible one-axis data for covariance based on actual experience Solve, choose the best combination of bias and k.

S7:根据最佳bias及k组合,更新待匹配数据T0时间,并存储。本例中,最可信的为第4列数据,时间同步后,第三组数据得到的协方差最大。利用下式计算更新T0时间:S7: According to the best combination of bias and k, update the time T 0 of the data to be matched, and store it. In this example, the most credible data is the fourth column. After time synchronization, the third group of data has the largest covariance. Use the following formula to calculate the update T 0 time:

t′=(t-t0)×k+bias+tt'=(tt 0 )×k+bias+t

其中,t为T0的时间列,t0为步骤6.12中选择的时间差初值对应的时间,k为时标漂移因子,bias为时间差,t′为t更新后时间。Among them, t is the time column of T 0 , t 0 is the time corresponding to the initial value of the time difference selected in step 6.12, k is the time scale drift factor, bias is the time difference, and t′ is the time after t is updated.

将T0中的时间列用t′代替,并将数据重新存储为与T0数据格式一致的数据文件。Replace the time column in T 0 with t', and re-store the data as a data file in the same format as T 0 .

S8:结束。S8: End.

如图6所示,为利用本发明算法对EPSON及FSAS进行时间同步后,垂向陀螺方向在同一时间标下波形图。从此图可看出,本算法能正确进行时间同步运算。As shown in Fig. 6, after the EPSON and FSAS are time-synchronized using the algorithm of the present invention, the waveform diagram is marked at the same time in the vertical direction of the gyro. It can be seen from this figure that this algorithm can correctly perform time synchronization operations.

如图7所示,为图6中某个时段内的波形匹配局部细节图。由图中可看出,本算法不仅能正确进行待匹配数据与参考数据之间的时间同步,且同步精度较高。As shown in FIG. 7 , it is a partial detailed diagram of the waveform matching in a certain period of time in FIG. 6 . It can be seen from the figure that this algorithm can not only correctly synchronize the time between the data to be matched and the reference data, but also have high synchronization accuracy.

一种基于波形匹配的时间同步系统,其特征在于,包括如下模块:A time synchronization system based on waveform matching, characterized in that it includes the following modules:

读取模块:用于读取参考数据R0及待匹配数据T0Reading module: used to read reference data R 0 and data to be matched T 0 ;

数据处理格式模块:用于统一参考数据R0及待匹配数据T0的数据处理格式,提取出转换后的参考数据R1及待匹配数据T1Data processing format module: used to unify the data processing format of the reference data R 0 and the data T 0 to be matched, and extract the converted reference data R 1 and the data T 1 to be matched;

降采样模块:用于分别对R1和T1降采样,对降采样后的参考数据R2及待匹配数据T2进行互相关序列求解,取互相关序列最大值时对应的间隔,求出此时的粗时间差int_bias;Downsampling module: it is used to downsample R1 and T1 respectively, solve the cross-correlation sequence for the reference data R2 after downsampling and the data T2 to be matched, and obtain the corresponding interval when the maximum value of the cross-correlation sequence is obtained. The coarse time difference int_bias at this time;

粗时间差模块:用于根据求得的粗时间差int_bias,使参考数据R2的时间段覆盖待匹配数据T2的时间段,且前后各超出待匹配数据T2一定长度,截取参考数据R2及待匹配数据T2Coarse time difference module: used to make the time period of the reference data R2 cover the time period of the data to be matched T2 according to the obtained rough time difference int_bias, and each of the front and rear exceeds a certain length of the data to be matched T2 , intercepting the reference data R2 and Data to be matched T 2 ;

采样率计算模块:用于统一R2和T2采样率,得到相同采样率的参考数据R3和待匹配数据T3Sampling rate calculation module: used to unify the sampling rates of R 2 and T 2 to obtain reference data R 3 and data to be matched T 3 of the same sampling rate;

计算模块:用于求得R3和T3的最优时间差bias及时标漂移因子k;Calculation module: used to obtain the optimal time difference bias and time scale drift factor k of R 3 and T 3 ;

更新模块:用于根据最佳bias及k组合,更新待匹配数据T0时间,并存储。Update module: used to update the data to be matched T 0 time according to the best bias and k combination, and store it.

Claims (7)

1. the method for synchronizing time based on Waveform Matching, is characterized in that, comprises the steps:
Step 1: read reference data R 0and data T to be matched 0;
Step 2: unified reference data R 0and data T to be matched 0data processing form, extract the reference data R after conversion 1and data T to be matched 1;
Step 3: respectively to R 1and T 1down-sampled, to the reference data R after down-sampled 2and data T to be matched 2carry out simple crosscorrelation sequence and solve, corresponding interval while getting simple crosscorrelation sequence maximal value, obtains thick mistiming int_bias now;
Step 4: the thick mistiming int_bias according to trying to achieve, makes reference data R 2time period cover data T to be matched 2time period, and front and back respectively exceed data T to be matched 2certain length, intercepting reference data R 2and data T to be matched 2, enter step 5;
Step 5: unified R 2and T 2sampling rate, obtains the reference data R of identical sampling rate 3with data T to be matched 3;
Step 6: try to achieve R 3and T 3the poor bias of optimal time and markers drift parameter k;
Step 7: according to best bias and k combination, upgrade data T to be matched 0time, and storage;
Step 8: finish.
2. a kind of method for synchronizing time based on Waveform Matching according to claim 1, is characterized in that: unified reference data R in described step 2 0and data T to be matched 0the formula of data processing form as follows:
v=Δs/Δt s
Wherein, Δ s is gyro or the measured increment size of accelerometer between former and later two samplings, Δ t sfor the time interval between former and later two samplings, v is the rate value that Δ s is corresponding;
Reference data R after described conversion 1and data T to be matched 1that the time row after changing and an axis data of carrying out Waveform Matching form.
3. a kind of method for synchronizing time based on Waveform Matching according to claim 1, is characterized in that: in described step 3, comprise the steps:
Step 3.1: respectively to R 1and T 1down-sampled, obtain the reference data R after down-sampled 2and data T to be matched 2;
Step 3.2: to down-sampled rear R 2and T 2among shorter sequence trailing zero, until both are equal in length;
Step 3.3: calculate R 2with T 2simple crosscorrelation sequence; Simple crosscorrelation sequence computing formula is as follows:
R ^ xy ( m ) = &Sigma; K = 0 N - m - 1 x K + m y m m &GreaterEqual; 0 R ^ xy ( - m ) m < 0
Wherein, x and y are the sequence of carrying out correlativity processing, and x and y length are N, and K and m are respectively used to represent the ordinal number of the value in sequence x and y, m value is-(N-1) to+(N-1);
Step 3.4: get simple crosscorrelation sequence corresponding interval during maximal value m, obtains thick mistiming int_bias now, and the thick mistiming can utilize following formula to try to achieve:
int_bias=R 2(t 0)-T 2(t 0)-T 2_interval×m
Wherein, R 2(t 0) be R 2start time, T 2(t 0) be T 2start time, T 2_ interval is the time span of the interval representative that staggers, is T 2sampling interval, T 2_ interval * m is the time that two column datas stagger.
4. a kind of method for synchronizing time based on Waveform Matching according to claim 1, is characterized in that: in described step 6.15, comprise following sub-step:
Step 6.1: calculate sub-sampling T_inter interval time;
Step 6.2: take T_inter as factor, calculate the data to be matched δ s of translation distance to the right;
Step 6.3: judge whether δ s is the positive integer times of sampling interval; If so, forward step S6.15 to, if not, forward step S6.4 to;
Step 6.4: by data data T to be matched 3translation δ s obtains T 4;
Step 6.5: take Δ t as length of window, by T 4be divided into limited n section, get present segment data T 4(i), 1≤i≤n;
Step 6.6: judge whether data to be matched extract n section; If so, forward step S6.13 to; If not, forward step S6.7 to;
Step 6.7: set moving window W 1, window is long is Δ t, starting point is the present segment zero hour;
Step 6.8: judge whether window sliding distance is greater than preseting length σ s; As if so, forwarded step S6.11 to;
Otherwise, with W 1for window, get reference data R 3(W 1);
Step 6.9: calculate T 4and R (i) 3(W 1) between Pearson's related coefficient; Pearson's Calculation of correlation factor as shown in the formula:
r = &Sigma; i = 1 N ( x i - x &OverBar; ) ( y i - y &OverBar; ) &Sigma; i = 1 N ( x i - x &OverBar; ) 2 &CenterDot; &Sigma; i = 1 N ( y i - y &OverBar; ) 2
Wherein for x serial mean, for y serial mean, N is the length of sequence x and y, and r is the Pearson's related coefficient between sequence x and y;
Step 6.10: judge that whether reference data reads last position, if so, forwards step S6.11 to; Otherwise,
By window W 1slide backward after the sampling interval of a reference data, forward step S6.8 to;
Step 6.11: calculate this section of mistiming Bias (i) and corresponding time time (i);
Step 6.12: extract next section of data to be matched.Take off one section of T 4(i), forward step 6.6 to;
Step 6.13: with the poor bias of least square adjustment seeking time and markers drift parameter k; Using bias and k as solve for parameter, and Bias (i) is observed reading, and observation equation is as follows:
Bias(i)=k×[time(i)-t 0]+bias
Wherein the initial value Bias0 of bias is Bias (i) sequence intermediate value, and the corresponding time is t 0, the initial value of k is 0;
Step 6.14: judge that whether δ s is greater than a sampling interval, if so, forwards step S6.15 to; Otherwise, by the δ s T_inter that doubles, forward step S6.3 to;
Step 6.15: select best bias and k combination; Utilize not bias and k on the same group, obtain the to be matched data of different time after synchronous.
5. a kind of method for synchronizing time based on Waveform Matching according to claim 4, is characterized in that: in described step 6.15, if data are single shaft, that group bias while selecting covariance maximum and k are as best bias and k combination; If data are multiaxis, select the most believable axis data to carry out covariance and solve, select best bias and k combination.
6. a kind of method for synchronizing time based on Waveform Matching according to claim 1, is characterized in that: in described step 7, utilize following formula to calculate and upgrade T 0time:
t′=(t-t 0)×k+bias+t
Wherein, t is T 0time row, t 0for time corresponding to mistiming initial value of selecting in step 6.12, k is markers drift parameter, and bias is the mistiming, and t ' is the rear time for t upgrades.
7. the clock synchronization system based on Waveform Matching, is characterized in that, comprises as lower module:
Read module: for reading reference data R 0and data T to be matched 0;
Data processing format module: for unified reference data R 0and data T to be matched 0data processing form, extract the reference data R after conversion 1and data T to be matched 1;
Down-sampled module: for respectively to R 1and T 1down-sampled, to the reference data R after down-sampled 2and data T to be matched 2carry out simple crosscorrelation sequence and solve, corresponding interval while getting simple crosscorrelation sequence maximal value, obtains thick mistiming int_bias now;
Interception module: for according to the thick mistiming int_bias trying to achieve, make reference data R 2time period cover data T to be matched 2time period, and front and back respectively exceed data T to be matched 2certain length, intercepting reference data R 2and data T to be matched 2;
Sampling rate computing module: for unified R 2and T 2sampling rate, obtains the reference data R of identical sampling rate 3with data T to be matched 3;
Computing module: for trying to achieve R 3and T 3the poor bias of optimal time and markers drift parameter k;
Update module: for according to best bias and k combination, upgrade data T to be matched 0time, and storage.
CN201410403983.3A 2014-08-15 2014-08-15 Time synchronization method and system based on waveform matching Active CN104142624B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410403983.3A CN104142624B (en) 2014-08-15 2014-08-15 Time synchronization method and system based on waveform matching

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410403983.3A CN104142624B (en) 2014-08-15 2014-08-15 Time synchronization method and system based on waveform matching

Publications (2)

Publication Number Publication Date
CN104142624A true CN104142624A (en) 2014-11-12
CN104142624B CN104142624B (en) 2015-04-01

Family

ID=51851840

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410403983.3A Active CN104142624B (en) 2014-08-15 2014-08-15 Time synchronization method and system based on waveform matching

Country Status (1)

Country Link
CN (1) CN104142624B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108226836A (en) * 2016-12-31 2018-06-29 科大智能电气技术有限公司 A kind of calibration method of fault detector synchronous waveform
CN110477895A (en) * 2019-07-24 2019-11-22 苏州国科医疗科技发展有限公司 The continuous method for measuring heart rate of multiple light courcess detector based on volumetric blood wave
CN110703586A (en) * 2019-09-09 2020-01-17 广州市中海达测绘仪器有限公司 Time synchronization method, data synchronization method, device, system, equipment and medium
CN110895321A (en) * 2019-12-06 2020-03-20 南京南瑞继保电气有限公司 Secondary equipment time mark alignment method based on recording file reference channel
CN112181906A (en) * 2019-07-02 2021-01-05 广州汽车集团股份有限公司 Test data synchronization method, device and system based on combined data acquisition instrument

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7752483B1 (en) * 2006-12-13 2010-07-06 Science Applications International Corporation Process and system for three-dimensional urban modeling
CN102183253A (en) * 2010-12-31 2011-09-14 北京航空航天大学 Software time synchronization method for position and orientation system
CN203204161U (en) * 2013-05-03 2013-09-18 武汉大学 Knocking-type pulse-trigger INS/GPS time synchronizer

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7752483B1 (en) * 2006-12-13 2010-07-06 Science Applications International Corporation Process and system for three-dimensional urban modeling
CN102183253A (en) * 2010-12-31 2011-09-14 北京航空航天大学 Software time synchronization method for position and orientation system
CN203204161U (en) * 2013-05-03 2013-09-18 武汉大学 Knocking-type pulse-trigger INS/GPS time synchronizer

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
刘占超 等: "一种改进的高精度POS时间同步方法", 《仪器仪表学报》, vol. 32, no. 10, 31 October 2011 (2011-10-31) *
张涛 等: "不同动态条件下组合导航系统的时间同步", 《中国惯性技术学报》, vol. 20, no. 3, 30 June 2012 (2012-06-30), pages 320 - 325 *
李倩 等: "GPS/INS组合导航系统时间同步系统设计", 《传感技术学报》, vol. 22, no. 12, 31 December 2009 (2009-12-31), pages 1752 - 1756 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108226836A (en) * 2016-12-31 2018-06-29 科大智能电气技术有限公司 A kind of calibration method of fault detector synchronous waveform
CN108226836B (en) * 2016-12-31 2021-06-01 科大智能电气技术有限公司 Calibration method for waveform synchronization of fault indicator
CN112181906A (en) * 2019-07-02 2021-01-05 广州汽车集团股份有限公司 Test data synchronization method, device and system based on combined data acquisition instrument
CN110477895A (en) * 2019-07-24 2019-11-22 苏州国科医疗科技发展有限公司 The continuous method for measuring heart rate of multiple light courcess detector based on volumetric blood wave
CN110703586A (en) * 2019-09-09 2020-01-17 广州市中海达测绘仪器有限公司 Time synchronization method, data synchronization method, device, system, equipment and medium
CN110703586B (en) * 2019-09-09 2022-02-18 广州市中海达测绘仪器有限公司 Time synchronization method, data synchronization method, device, system, equipment and medium
CN110895321A (en) * 2019-12-06 2020-03-20 南京南瑞继保电气有限公司 Secondary equipment time mark alignment method based on recording file reference channel
CN110895321B (en) * 2019-12-06 2021-12-10 南京南瑞继保电气有限公司 Secondary equipment time mark alignment method based on recording file reference channel

Also Published As

Publication number Publication date
CN104142624B (en) 2015-04-01

Similar Documents

Publication Publication Date Title
CN104142624B (en) Time synchronization method and system based on waveform matching
Hu et al. A derivative UKF for tightly coupled INS/GPS integrated navigation
US11385359B2 (en) Point cloud data acquisition method and device under situation of no GNSS signal
JP6019504B2 (en) Traveling direction estimation apparatus and traveling direction estimation method for moving body
US11181379B2 (en) System and method for enhancing non-inertial tracking system with inertial constraints
CN106197410A (en) For the method and apparatus accurately capturing inertial sensor data
JP5352422B2 (en) Positioning device and program
CN107024212B (en) A X-ray pulsar/time difference astro-Doppler integrated navigation method for deep space probes
CN103616710A (en) Multi-sensor combined navigation time synchronizing system based on field programmable gate array (FPGA)
CN114018274A (en) Vehicle positioning method and device and electronic equipment
CN103017774A (en) Pulsar navigation method with single detector
CN102435763A (en) Spacecraft attitude angular velocity measurement method based on star sensor
CN105910602A (en) Combined navigation method
CN109507706A (en) A kind of prediction localization method that GPS signal is lost
CN109506656A (en) Restoring method is passed under a kind of in-orbit posture information of high-precision
CN107421533B (en) A kind of deep space probe X-ray pulsar TOA/DTOA Combinated navigation method
CN103364842B (en) A kind of error separation method of strapdown airborne gravitometer
CN106842256A (en) A kind of navigation locating method of the mono- star signals of utilization GNSS
CN110207696A (en) A kind of nine axis movement sensor attitude measurement methods based on quasi-Newton method
CN205506069U (en) Space trajectory record device
CN105136150A (en) Attitude determination method based on multiple star-sensor measure information fusion
CN105910617B (en) The method and device of sampled point time synchronization in a kind of onboard navigation system
CN104122412A (en) Accelerometer calibrating method based on Beidou second generation velocity information
CN105510936B (en) Spaceborne GNSS joint orbit determination method and device
CN110160530B (en) Spacecraft attitude filtering method based on quaternion

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant