File Exchange > DataAnalysis >    Correlation Shift

Author:
Antoine Couturier
Date Added:
6/15/2018
Downloads (90 Days):
146
Last Update:
6/29/2018
Total Ratings:
0
File Size:
2976 KB
Average Rating:
File Name:
CorrelShift.opx
File Version:
2
Minimum Versions:
2016
License:
Free
Summary:

Align signals with cross correlation.

Screen Shot and Video:
Description:

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

Updates:

- Support Circular Correlation
- Support multiple datasets
- Added Correlation and Adjusted Correlation values
- More examples in Sample project

Reviews and Comments:

Be the first to review this File Exchange submission.