Matlab changes for score function and jitter compensation