This App will align datasets by finding delay corresponding to maximal correlation
How to Use ?
• Worksheet: select at least 2 Y columns, click the App icon and select linear or circular correlation.
The 1st dataset is the reference dataset. All the others will be aligned to the reference dataset.
• Graph: if there are at least 2 dataplots, click the App icon and select linear or circular correlation.
The 1st dataplot is the reference dataplot. All the others will be aligned to the reference dataplot. New dataplots are added and corresponds to nth dataplot aligned to 1st dataplot. For clarity and emphasis purpose, the source nth dataplot transparency is set to 80%.
New XY columns corresponding to nth dataset aligned to reference dataset are added into source worksheet, with Shift and Correlation values printed into column Comments header. If a dataset duration is smaller than 50% of reference dataset duration, an Adjusted Correlation value is also computed and corresponds to the correlation value limited to the aligned matching parts.
Linear Correlation
Prior to correlation, the sampling frequencies are checked. If they are different, the dataset with lowest sampling rate is internally oversampled to the highest sampling rate.
The new X column is a copy of the source column, offseted by the amount of shift.
The new Y column is a copy of the source column.
Circular Correlation
Prior to correlation, the sampling frequencies are checked. If they are different, the dataset with lowest sampling rate is internally oversampled to the highest sampling rate.
In circular correlation, the nth dataset will be wrapped (i.e. shifted circularly) for finding best match with 1st dataset. Thus, the 2 source datasets are supposed to have the same initial X values, and nth dataset duration should not be shorter than 1st dataset duration. Whatever the case, the new XY columns will fulfill those conditions.
The new X column starts at same initial value than 1st dataset, has same sampling rate than 2nd dataset and same duration than longest dataset.
The new Y column is a copy of the source column (padded with 0 if needed), wrapped in the rightward direction by the amount of shift.
Installation
Download the file CorrelShift.opx, and then drag-and-drop onto the Origin workspace. An icon will appear in the Apps Gallery window.
A sample project is available with many examples. Right click on App icon and select Show Samples Folder