Description of the issue
After adding a cycle in the library, and after running the template matching analysis, the P-wave of the cycle that was just added to the library is not matching 100 % with itself :
The template cycle only has a few samples prior to the P-start mark :
Several samples are needed for filters to initialize identically on the template and on the actual data. When comparing the template with the signal, both sets of data are filtered prior to comparison.
Due to the limited amount of data in the template, after filtering the two signals are no longer exactly the same, resulting in a match < 100%.
This difference would not exist if more samples were available prior to the P-Start mark.
Before adding the cycle to the library, move the P-Start mark of the cycle towards the left.
Then add the cycle to the library.
The template will have much more samples available before the P-wave :
Move the P-Start mark to its correct position :
Run the analysis. Now the P-wave should match 100% :