ChatPPG Editorial

Savitzky-Golay Filter for PPG: Smoothing Without Flattening Morphology

Savitzky-Golay filter for PPG smooths noise while preserving peaks and slopes when window length, polynomial order, and edge handling are chosen well.

ChatPPG Research Team
10 min read
Savitzky-Golay Filter for PPG: Smoothing Without Flattening Morphology

Savitzky-Golay filter for PPG is a strong choice when you need less noise but still care about pulse shape. Instead of averaging every sample equally, it fits a low-order polynomial inside a moving window, which lets it smooth roughness while preserving slopes, peaks, and curvature better than a plain moving average. If your endpoint depends on beat timing, pulse morphology, or derivatives such as SDPPG, that difference matters.

Why Savitzky-Golay shows up so often in PPG pipelines

PPG is not only a heart-rate waveform. The systolic upstroke, peak width, dicrotic region, and derivative landmarks all carry information, and all of them can be damaged by blunt smoothing. A filter that makes the trace look pretty while flattening those structures is usually a bad trade.

That is why Savitzky-Golay remains useful. The original paper by Savitzky and Golay framed the method as local polynomial least-squares smoothing and differentiation, which is still the right way to think about it (DOI). Schafer's review later explained why the filter preserves low-order local structure better than naive smoothing windows (DOI).

In practical PPG work, that means the filter can reduce fine high-frequency roughness without flattening the waveform as aggressively as a boxcar average of similar width. This matters most when you care about second derivative PPG, signal quality assessment, or other tasks where local shape is part of the output.

How the filter works without getting lost in the algebra

A Savitzky-Golay filter slides an odd-length window across the signal. Inside each window, it fits a polynomial of order p to the samples and evaluates that polynomial at the center point. For fixed parameters, the whole operation can be implemented as a convolution with precomputed coefficients.

The important part is the assumption behind it. Savitzky-Golay assumes the local signal segment can be approximated by a low-order polynomial over a short interval. That is often a decent approximation for a clean PPG rising edge, peak, or decay segment. It is much less appropriate for motion spikes, clipping, or abrupt baseline drift.

So the filter lives in a useful middle ground:

  • more shape-aware than a moving average
  • much lighter than wavelet or state-space methods
  • good for moderate noise, not a cure for broken data

That positioning is why it often belongs in the same conversation as wavelet denoising and Kalman filtering. It solves a different class of problem.

Why morphology preservation matters in PPG

Allen's review on photoplethysmography is still the standard reminder that PPG contains much more than a pulse count (DOI). Once you care about pulse-foot timing, notch visibility, stiffness surrogates, or derivatives, small smoothing choices become feature-extraction choices.

The same filtered waveform can therefore be:

  • acceptable for average heart rate
  • risky for pulse-arrival timing
  • poor for notch detection
  • unusable for unstable derivative landmarks

That is why there is no universal best Savitzky-Golay setting for PPG. The right parameters depend on what you need to preserve.

The two parameters that control almost everything

When engineers ask how to tune savitzky golay filter ppg, the answer usually comes down to window length and polynomial order.

Window length

Window length determines how many samples take part in each local fit. It must be odd. Larger windows smooth more strongly, but they also broaden narrow features and can shift or soften clinically relevant structure.

A 15-sample window is not a universal setting. At 25 Hz it spans 600 ms. At 100 Hz it spans 150 ms. Those are very different filters in physiologic time.

That is why window choice should begin in milliseconds, not samples. Convert to samples only after you know the device sample rate.

Polynomial order

Polynomial order determines how flexible the local fit is. Lower orders smooth more aggressively. Higher orders preserve more curvature, but if the window is short they can start following noise rather than suppressing it.

In most practical PPG systems:

  • order 2 or 3 is the best starting point
  • order 4 can be reasonable at higher sample rates with enough window support
  • very high orders are rarely worth the instability risk

The interaction matters more than either parameter alone. A short window with a high-order polynomial usually behaves nervously. A long window with a low-order polynomial often becomes too blunt.

Choosing parameters by endpoint

Heart rate and basic peak detection

If the goal is stable peak timing or pulse rate, you can tolerate somewhat more smoothing. A moderate window with polynomial order 2 or 3 is usually enough.

Useful starting ranges are:

  • 25 to 32 Hz: 5 to 9 samples
  • 50 to 64 Hz: 7 to 13 samples
  • 100 to 128 Hz: 9 to 21 samples

These are starting points, not rules. Faster heart rates and narrower pulses usually require smaller windows.

Morphology and vascular features

If the goal is waveform contour, be more conservative. The filter should remove roughness without slowing the systolic rise or flattening the dicrotic region. In this case, it helps to review PPG waveform basics and tune against actual pulse width at the target body site rather than using a generic parameter set.

Derivatives such as velocity PPG or SDPPG

Derivative estimation amplifies high-frequency noise, so this is one of the best use cases for Savitzky-Golay. The method supports smoothing and differentiation inside the same local polynomial framework. But the settings must stay conservative enough to preserve inflection structure. Too short, and derivatives stay noisy. Too long, and the landmarks that define SDPPG get rounded away.

Sample rate changes the meaning of every parameter

One of the most common mistakes in PPG code is copying Savitzky-Golay settings from a paper without matching sample rate. That usually fails because window size represents time, not just point count.

If your device runs at 25 Hz, one sample is 40 ms. At 125 Hz, one sample is 8 ms. A 21-point window therefore means very different smoothing strength on those systems.

This is why Savitzky-Golay tuning belongs beside PPG sampling rate optimization. You are choosing smoothing relative to physiologic time scales, not in the abstract.

A practical workflow is:

  1. estimate pulse width and upstroke duration at the target site
  2. choose a window clearly shorter than the pulse period
  3. verify peak timing and local slope on clean data
  4. stress test on noisy data without trusting visual smoothness alone

Edge handling matters more than many teams expect

Every moving-window filter has an edge problem. Near the start and end of a segment, the full centered window is unavailable. Libraries deal with this through padding, reflection, interpolation, or asymmetric approximations.

In PPG, poor edge handling can create false peaks, unstable derivatives, or distorted baseline behavior exactly where short segments are already fragile. Good practice is simple:

  • know how your library handles boundaries
  • avoid overinterpreting the first and last filtered samples
  • validate real-time implementations separately from offline centered filtering

That last point matters because live systems often use causal or partly asymmetric approximations. They are useful, but they are not identical to offline symmetric filtering.

What Savitzky-Golay does well, and what it does not

Savitzky-Golay is strong at:

  • suppressing fine high-frequency roughness
  • preserving local curvature better than boxcar averaging
  • supporting derivative estimation
  • staying cheap enough for embedded deployment

It is weak at:

  • large motion artifacts
  • strong baseline wander by itself
  • clipped or saturated pulses
  • periodic interference that overlaps the pulse band

That is why it is best used as one stage in a larger pipeline. A sensible stack is often:

  1. remove or limit baseline drift
  2. reject clipped or poor-quality segments
  3. apply light Savitzky-Golay smoothing
  4. extract peaks, timing, or derivatives
  5. escalate to heavier denoising only when the artifact profile justifies it

Common failure modes

Window too long

This is the classic mistake. The waveform looks smooth, but the systolic upstroke slows, the peak broadens, and subtle morphology weakens.

Polynomial order too high

A high-order local fit inside a small window can start following noise instead of suppressing it.

Reusing one setting across devices

A parameter set that works at 100 Hz finger PPG can be wrong for 25 Hz wrist PPG because the time scale, morphology, and noise profile differ.

Filtering data that should have been rejected

If the segment is dominated by motion artifact, Savitzky-Golay gives you a smoothed artifact. It does not convert bad data into valid physiology.

A practical tuning workflow for engineers

If you are implementing savitzky golay filter ppg today, use this process:

1. Tune on clean segments first

You need to know what waveform structure is worth preserving before you tune against noisy data.

2. Choose the window in time units

Think in milliseconds, then convert to samples. This avoids one of the most common reuse mistakes.

3. Start with order 2 or 3

Those settings are usually enough. Increase only when you have evidence that curvature preservation is still lacking.

4. Validate against the real endpoint

Check visual shape, peak timing, and downstream feature stability. If you care about SDPPG or other derivatives, validate those directly.

5. Add quality gating

Use PPG signal quality assessment so you do not waste filtering effort on windows that should simply be rejected.

6. Compare to a simple baseline

Always compare against a moving average or light low-pass filter. If Savitzky-Golay is not materially better for the endpoint, do not keep it out of habit.

The right mental model

The best way to use Savitzky-Golay for PPG is to treat it as a local shape-preserving smoother, not a universal denoiser. When the raw data are mostly valid and you want to reduce roughness without losing morphology, it is excellent. When the segment is dominated by motion, drift, or clipping, it is the wrong tool.

That distinction is why the filter keeps appearing in serious PPG workflows. Used lightly and tuned against sample rate and endpoint, it can smooth the waveform without sanding off the part that mattered.

FAQ

Is Savitzky-Golay better than a moving average for PPG?

Often yes, when morphology matters. A Savitzky-Golay filter usually preserves peaks, slopes, and curvature better than a moving average with a similar span.

What window length should I use for PPG?

Choose it in time units first, then convert to samples. The right value depends on sample rate, pulse width, and whether the goal is heart rate, morphology, or derivatives.

What polynomial order is best for PPG smoothing?

Order 2 or 3 is the best starting point for most PPG applications. Higher orders can preserve more curvature, but they also risk fitting noise if the window is too short.

Can Savitzky-Golay remove motion artifact from PPG?

Not reliably when the motion artifact is large. It helps with moderate high-frequency roughness, but strong motion contamination usually needs quality gating, adaptive filtering, or another denoising stage.

Is Savitzky-Golay good for derivative PPG features?

Yes. It is widely used when derivative stability matters because it supports local polynomial smoothing and differentiation in the same framework. The tuning still has to preserve inflection structure.

Does Savitzky-Golay distort peak timing?

It can if the window is too wide, if edge handling is poor, or if a real-time implementation uses an asymmetric approximation. That is why timing validation matters.

{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "Is Savitzky-Golay better than a moving average for PPG?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Often yes, when morphology matters. A Savitzky-Golay filter usually preserves peaks, slopes, and curvature better than a moving average with a similar span."
      }
    },
    {
      "@type": "Question",
      "name": "What window length should I use for PPG?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Choose it in time units first, then convert to samples. The right value depends on sample rate, pulse width, and whether the goal is heart rate, morphology, or derivatives."
      }
    },
    {
      "@type": "Question",
      "name": "What polynomial order is best for PPG smoothing?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Order 2 or 3 is the best starting point for most PPG applications. Higher orders can preserve more curvature, but they also risk fitting noise if the window is too short."
      }
    },
    {
      "@type": "Question",
      "name": "Can Savitzky-Golay remove motion artifact from PPG?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Not reliably when the motion artifact is large. It helps with moderate high-frequency roughness, but strong motion contamination usually needs quality gating, adaptive filtering, or another denoising stage."
      }
    },
    {
      "@type": "Question",
      "name": "Is Savitzky-Golay good for derivative PPG features?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes. It is widely used when derivative stability matters because it supports local polynomial smoothing and differentiation in the same framework. The tuning still has to preserve inflection structure."
      }
    },
    {
      "@type": "Question",
      "name": "Does Savitzky-Golay distort peak timing?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "It can if the window is too wide, if edge handling is poor, or if a real-time implementation uses an asymmetric approximation. That is why timing validation matters."
      }
    }
  ]
}
{
  "@context": "https://schema.org",
  "@type": "Article",
  "headline": "Savitzky-Golay Filter for PPG: Smoothing Without Flattening Morphology",
  "description": "Savitzky-Golay filter for PPG smooths noise while preserving peaks and slopes when window length, polynomial order, and edge handling are chosen well.",
  "author": {"@type": "Organization", "name": "ChatPPG Research Team"},
  "publisher": {"@type": "Organization", "name": "ChatPPG", "url": "https://chatppg.com"},
  "datePublished": "2026-04-13",
  "url": "https://chatppg.com/blog/ppg-savitzky-golay-smoothing-guide"
}

Related reading: PPG Second Derivative (SDPPG) | PPG Sampling Rate Optimization | Wavelet Denoising for PPG Signals | PPG Signal Quality Assessment