Skip to content

Commit

Permalink
Update ppg_quality.py
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
athatcher13 authored Oct 25, 2024
1 parent 21e3cf7 commit 2cf5862
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions neurokit2/ppg/ppg_quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
return quality

0 comments on commit 2cf5862

Please sign in to comment.