This algorithm calculates the normalized cross correlation between two signal files. The cross correlation is a measure of the degree to which two different signals are similar. A higher cross correlation means a higher degree of similarity and vice versa. Its main difference from correlation is that there is a time lag involved as compared to a correlation in which two signals are considered to be in the same time.
- This algorithm takes in two different files, one for x, and one for y, and determines the starting index for the crosscorrelation. When no starting index is given, assume that the starting index is 0.
- After obtaining the raw signal files, this algorithm subtracts the average of each signal file to get a signal consisting of subtracted averages.
- Calculate the cross-correlation based on the starting index and the end indexes of the signal files.
- Output the results to a separate text file.
There are ten different inputs in this project:
- x1.txt
- x2.txt
- x3.txt
- x4.txt
- y1.txt
- y2.txt
- y3.txt
- y4.txt
- output1.txt
- output2.txt
The ten inputs result into one output per x and y input combination:
- output1.txt (output of x1.txt and y1.txt)
- output2.txt (output of x2.txt and y2.txt)
- output3.txt (output of x3.txt and y3.txt)
- output4.txt (output of x4.txt and y4.txt)
- output5.txt (output of output1.txt and output2.txt)
Output5.txt is shown to emphasize that even the outputs of this algorithm can be used as inputs for the succeeding iterations of the normalized cross correlation.
Each function used has been given documented within the .cpp file. Enjoy!