This also fixes a bug I found when calculating the resulting segment. Originally, when the sample was displaced to the right, only sample_len - lag elements were compared to calculate the Pearson Correlation Coefficient. But knowing that the source length is twice the sample length, sample_len elements can be compared, since the remainder when displaced to the right is available in the source data.
This also fixes a bug I found when calculating the resulting segment. Originally, when the sample was displaced to the right, only
sample_len - lag
elements were compared to calculate the Pearson Correlation Coefficient. But knowing that the source length is twice the sample length,sample_len
elements can be compared, since the remainder when displaced to the right is available in the source data.It's explained in detail in the code.