Applies a Savitzky-Golay filter to a continuous glucose monitoring (CGM) trace prior to baseline correction and peak detection. This mirrors the smoothing step of the first post-wake glucose peak detection pipeline described in Pugliane et al. (2026, preprint).
Details
NOTE (parity flag): this is currently a clean-room reimplementation and
has not yet been validated against the Python reference
(scipy.signal.savgol_filter) used in the manuscript pipeline. Edge
handling (boundary mode) in particular needs to be checked for parity
before this function is treated as validated. See package NEWS.md /
inst/COPYRIGHTS once that comparison has been done.