From 2cf5862eafb817206f4780d3ddf84c13d00c4ffb Mon Sep 17 00:00:00 2001 From: Andrew Thatcher <137421747+athatcher13@users.noreply.github.com> Date: Fri, 25 Oct 2024 12:40:28 -0500 Subject: [PATCH] Update ppg_quality.py Addressing issue #1043 Change 'templatematch' implementation to use interpolation method 'previous' rather than 'quadratic'. This aligns it with the 'disimilarity' implementation and is a better representation of the beat-by-beat nature of the quality measure. --- neurokit2/ppg/ppg_quality.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neurokit2/ppg/ppg_quality.py b/neurokit2/ppg/ppg_quality.py index c53a609f94..4ef625337c 100644 --- a/neurokit2/ppg/ppg_quality.py +++ b/neurokit2/ppg/ppg_quality.py @@ -138,7 +138,7 @@ def _ppg_quality_templatematch(ppg_cleaned, ppg_pw_peaks=None, sampling_rate=100 # Interpolate beat-by-beat CCs quality = signal_interpolate( - ppg_pw_peaks[0:-1], cc, x_new=np.arange(len(ppg_cleaned)), method="quadratic" + ppg_pw_peaks[0:-1], cc, x_new=np.arange(len(ppg_cleaned)), method="previous" ) return quality @@ -193,4 +193,4 @@ def _ppg_quality_disimilarity(ppg_cleaned, ppg_pw_peaks=None, sampling_rate=1000 ppg_pw_peaks[0:-1], dis, x_new=np.arange(len(ppg_cleaned)), method="previous" ) - return quality \ No newline at end of file + return quality