PPG Signal & SpO₂ Simulator Back
Biomedical Signal Processing

PPG Signal & SpO₂ (Pulse Oximetry) Simulator

Visualize how a pulse oximeter converts the red/infrared LED absorption ratio into arterial oxygen saturation SpO₂. Adjust perfusion index, motion artifact and sampling rate and watch the PPG waveform, calibration curve, signal quality and measurement uncertainty respond in real time.

Parameters
Target SpO₂
%
True SpO₂ to simulate (healthy: 95-100%)
Heart rate HR
BPM
Red LED wavelength
nm
Standard 660 nm — large Hb vs HbO₂ absorption gap
IR LED wavelength
nm
Standard 940 nm — near the isobestic region
Perfusion Index PI
%
AC/DC × 100. Healthy 1-5%, low-flow <0.5%
Motion artifact
%
Amplitude of low-frequency noise on the PPG
Sampling rate Fs
Hz
Results
Ratio R
SpO₂ estimate (%)
Estimation error (%)
RR interval (ms)
Signal quality SQI (%)
Uncertainty (%)
Fingertip cross-section — PPG animation

Red (660 nm) and infrared (940 nm) light cross the finger, are modulated by the pulsatile blood volume, and reach the photodetector as a combined AC + DC waveform.

Raw PPG waveform (Red + IR, AC emphasized)
SpO₂ calibration curve (R vs SpO₂)
Theory & Key Formulas

$$R = \frac{(AC/DC)_{\text{red}}}{(AC/DC)_{\text{IR}}}, \qquad SpO_{2} \approx 110 - 25\,R$$

R ≈ 0.4-0.5 corresponds to SpO₂ ≈ 100% and R ≈ 1.0 to SpO₂ ≈ 85%. The empirical calibration curve differs by manufacturer (measured with reference oximeters).

$$SpO_{2} = \frac{\varepsilon_{Hb,\text{red}} - R\,\varepsilon_{Hb,\text{IR}}}{(\varepsilon_{Hb,\text{red}}-\varepsilon_{HbO_{2},\text{red}}) + R\,(\varepsilon_{HbO_{2},\text{IR}}-\varepsilon_{Hb,\text{IR}})}$$

This tool uses the rigorous Beer-Lambert form with extinction coefficients tuned so that SpO₂ = 98% input gives R ≈ 0.33 and essentially zero estimation error.

$$SQI = \frac{PI}{5}\,\left(1-\frac{motion}{100}\right), \qquad U[\%] = 1 + \frac{1}{SQI} + 0.02\cdot motion$$

Simplified Signal Quality Index SQI and measurement uncertainty U. Low perfusion or strong motion cause U to grow quickly.

Photoplethysmography (PPG) signal and SpO₂

🙋
My Apple Watch and the clip-on sensor at the hospital both show "oxygen saturation 98%". How is that actually measured? They aren't drawing blood, right?
🎓
Right — it is a completely non-invasive measurement, no needles. The principle in one sentence: it is just measuring light absorption. Two LEDs, red (≈660 nm) and infrared (≈940 nm), shine through the fingertip, and a photodetector on the opposite (or same) side reads the transmitted or reflected light. Every heartbeat pushes more arterial blood through, so the absorption pulses with the same rhythm. The pulsing part is called "AC" and the steady part "DC", and the ratio R of the two AC/DC ratios reveals the oxygen saturation of arterial blood (SpO₂) via the absorption gap between HbO₂ and Hb.
🙋
Why exactly red and infrared, two colours? Why not just one?
🎓
Good one. It comes down to the Beer-Lambert law. With a single colour, "haemoglobin concentration" and "oxygenation fraction" sit in the same equation and can't be separated. But at 660 nm Hb absorbs more strongly than HbO₂, and at 940 nm HbO₂ absorbs slightly more than Hb. Take AC/DC at both wavelengths and divide them, and the concentration and path length cancel out, leaving only the oxygenation fraction. That's the heart of pulse oximetry — balancing two unknowns against two equations, very much the same flavour as a CAE system of equations.
🙋
If I drop the perfusion index from 2.5% to 0.5% on the left panel, the signal quality crashes and the verdict turns yellow. Is PI really that critical?
🎓
Absolutely. PI = AC/DC × 100 — the share of pulsating signal in the total light — is essentially the SNR you start with. A warm fingertip gives 1-5%, but a cold finger, shock, or strong vasoconstrictors can push it below 0.1%. Once AC is tiny, R wobbles and the displayed SpO₂ jumps "97 → 92 → 95". That is why ICUs switch to forehead or ear sensors on cold patients, and treat persistently low PI itself as a warning sign of circulatory trouble.
🙋
There's also "motion artifact" — that's when waving your hand makes the reading bounce around, right?
🎓
Yes, the great enemy of wearables. Moving a finger or wrist changes the skin-to-LED distance and even shakes venous blood, which leaks into the AC band as huge low-frequency noise. When that noise overlaps the cardiac frequency, both peak detection and R go wrong. The reason smartwatches refuse to give SpO₂ during exercise is exactly that — they decide "SQI below threshold, don't display". In this tool, push the motion slider past 30% and you'll see the uncertainty climb sharply: at that point the device is, in effect, blind.
🙋
And what about the sampling rate Fs — how much is enough? Hospital monitors look really fast.
🎓
It depends on the goal. For SpO₂ and heart rate alone, 50-100 Hz is fine, which is why this tool defaults to 100 Hz. But if you want to extract blood-pressure trends or HRV (heart-rate variability) from the PPG waveform itself, you want to keep up to the 5th harmonic, so 250-500 Hz is the norm. That's why ICU-grade monitors run at 500 Hz class. From Nyquist, HR/60 × 5 × 2 is the minimum — about 30 Hz at HR = 180 BPM.

Frequently Asked Questions

PPG measures the amount of LED light transmitted or reflected through peripheral tissue (such as a fingertip) with a photodetector, separating the cardiac-synchronous blood-volume change (AC component) from the static absorption (DC component). SpO₂ (peripheral arterial oxygen saturation) exploits the fact that oxyhemoglobin (HbO₂) and deoxyhemoglobin (Hb) absorb light differently at red (~660 nm) and infrared (~940 nm) wavelengths, and is computed from the ratio R of the two AC/DC ratios. In other words, SpO₂ is one of the most important parameters derived from a PPG signal.
The ratio used by pulse oximeters is R = (AC/DC)_red / (AC/DC)_IR, and the best-known empirical conversion is SpO₂ ≈ 110 − 25R, calibrated by each manufacturer with reference measurements. This tool uses a more rigorous Beer-Lambert form, SpO₂ = (ε_Hb,red − R·ε_Hb,IR) / (ε_Hb,red − ε_HbO2,red + R·(ε_HbO2,IR − ε_Hb,IR)), with extinction coefficients at 660/940 nm chosen so that an input of SpO₂ = 98% yields R ≈ 0.33 and essentially zero estimation error.
Perfusion Index PI = AC/DC × 100 is the strength of the pulsatile component, typically 1-5%. When PI is small, the signal-to-noise ratio of the AC component drops and R becomes unstable. Motion artifact adds low-frequency, large-amplitude variations to the PPG waveform and disrupts peak detection. This tool uses the simplified model SQI = PI/5 × (1 − motion/100) and U[%] = 1 + 1/SQI + 0.02·motion[%], so you can see how SpO₂ confidence collapses under low perfusion or strong motion.
PPG contains harmonics up to roughly the 5th of the heart-rate fundamental (HR/60 Hz), so the Nyquist guideline is Fs ≥ 2·(HR/60·5) Hz. For HR = 180 BPM that means at least 30 Hz, and a safe practical choice is around 100 Hz. For continuous monitoring or HRV (heart-rate variability) analysis, 250-500 Hz is preferred; for peak detection alone, 50-100 Hz is usually enough. The default 100 Hz in this tool is reported as "Nyquist OK".

Real-World Applications

Hospital monitors, ICU and operating rooms: Pulse oximetry is often called "the fifth vital sign", alongside heart rate, respiration, blood pressure and temperature, and is a standard continuous monitoring channel. It tracks oxygenation under general anaesthesia, guides ventilator weaning, and feeds early-warning scores (NEWS/qSOFA both include SpO₂). Clinical-grade devices typically specify Arms = 2% (root-mean-square error within 2% over SpO₂ 70-100% versus reference oximetry).

Wearable health devices: Apple Watch (Series 6 and later), Fitbit, Garmin and Oura Ring all derive SpO₂, heart rate, HRV and sleep-apnoea screening from PPG. Watch-style devices use reflectance PPG (LED and photodetector on the same face), which is more sensitive to skin contact, motion and skin tone than transmittance designs, so their readings are positioned as "wellness trend indicators" rather than medical-grade diagnoses.

Neonatal and paediatric care: In screening newborns for patent ductus arteriosus or in titrating oxygen for premature babies, SpO₂ is measured simultaneously on upper and lower limbs to compare pre-ductal and post-ductal values. The thin skin transmits light well, but very small body weights make motion and low perfusion common, so dedicated paediatric probes and low-PI tolerant algorithms are required.

COVID-19 home care and telemedicine: Since 2020, home-isolated mild COVID patients have used SpO₂ as the key marker for detecting "silent hypoxia". Consumer pulse-oximeter sales rose by orders of magnitude, and integrating SpO₂ alerts into telehealth platforms (for example, escalating to a nurse if SpO₂ drops below 93%) became a standard practice.

Common Misconceptions and Pitfalls

The first big misconception is "SpO₂ = 100% is always best". Because SpO₂ saturates at 100%, any further rise in arterial oxygen tension PaO₂ is invisible (the upper end of the oxyhaemoglobin dissociation curve is flat). In COPD or chronic type-II respiratory failure, over-oxygenation actually reduces CO₂ clearance and risks hypercapnic encephalopathy, so target SpO₂ is deliberately held to 88-92%. SpO₂ should be operated against a patient-specific target, not "the higher the better".

Next, nail polish, pigments and peripheral circulation. Dark red, blue or black polish, tattoos, henna, and skin pigmentation (e.g. severe jaundice from bilirubin) distort the transmittance spectrum and tend to bias SpO₂ down by a few percent. Skin tone (melanin) has come under scrutiny: multiple studies show that, especially at low SpO₂, dark-skinned subjects can read "falsely normal" relative to arterial blood gas, and the FDA issued a safety communication on this in 2022. Whenever a reading looks clinically suspicious, switch fingers, try the ear or forehead, and confirm with arterial blood gas.

Finally, abnormal haemoglobins and CO poisoning. Standard pulse oximeters can only separate two species (Hb and HbO₂), so in methaemoglobinaemia (MetHb) or carbon-monoxide poisoning (COHb), the dysfunctional haemoglobin is counted as HbO₂ and SpO₂ reads falsely normal or high. At a fire scene or industrial gas accident, SpO₂ may show 98% while a CO-oximeter (4-8 wavelengths) measures COHb of 40% — effectively severe hypoxia. SpO₂ alone never guarantees "true arterial oxygen content" — the same lesson as CAE: if the input physics breaks the model assumptions, the output is meaningless.

How to Use

  1. Set SpO2 target (88-100%) and HR range (40-200 bpm) using the numeric inputs and sliders
  2. Adjust red (660 nm) and infrared (940 nm) LED absorption values (0-4.0 absorbance units) to simulate different tissue perfusion conditions
  3. Observe the R ratio calculation (red AC/red DC divided by IR AC/IR DC), SpO2 estimate via calibration curve, RR interval from beat detection, and signal quality index (SQI) threshold at 60%

Worked Example

Clinical scenario: 45-year-old patient with normal oxygenation. Set SpO2=98%, HR=72 bpm, red absorbance=1.8 AU, IR absorbance=2.1 AU. Simulator calculates R ratio≈0.92, SpO2 estimate=97.8% (error 0.2%), RR interval=833 ms, SQI=87% indicating good signal. Motion artifact reduces IR to 1.9 AU; R ratio shifts to 0.96, SpO2 drops to 95.2%, SQI falls to 52% (signal unusable). Calibration polynomial applied: SpO2=110-(25×R).

Practical Notes

  1. AC/DC ratios below 0.02 indicate poor perfusion or sensor placement issues; clinical SpO2 becomes unreliable below SQI 50%
  2. Venous pulsation (IR>red) occurs in dependent limbs; proper arm positioning (heart level) normalizes IR absorption
  3. Ambient light interference increases baseline absorption equally in both channels; differential measurement preserves accuracy when R ratio maintained stable
  4. Low hemoglobin (anemia) reduces total absorbance but R ratio remains relatively constant, so SpO2 estimates stay accurate while absolute signal strength degrades