TeslasuitDocumentation
APIs

Photoplethysmography (PPG)

C99 · Teslasuit XR5+ · SDK 2.5.1+

What is PPG?#

Photoplethysmography (PPG) is a non-invasive optical technique that measures blood-volume changes in microvascular tissue: a sensor emits light into the skin and measures how much is absorbed or reflected by blood vessels. It is widely used in fitness and medical wearables to monitor heart rate and other cardiovascular parameters in real time. For the sensor details, sampling rate, and how the signal becomes metrics, see Concept: Biometry (PPG). This page focuses on how PPG data is exposed through the C API.

PPG in the Teslasuit API#

PPG is part of the suit's biometry subsystem. A single PPG sensor in the upper-right sleeve produces the signal (see Concept: Biometry (PPG) for sensor specs). In the C API this is accessed through ts_biometry_api.h, which provides functions for streaming raw data, retrieving processed data (heart rate and HRV), and performing calibration.

Key features of the Teslasuit PPG subsystem#

  1. Raw data streaming: stream raw PPG data (infrared, red, blue, and green channels) in real time for custom signal processing.
  2. Heart rate variability (HRV): time-domain, frequency-domain, and non-linear HRV metrics.
  3. Processed data: heart rate plus a validity flag on each value.
  4. Calibration: ts_ppg_calibrate re-triggers the PPG processor calibration; it also runs automatically on start.

Description of PPG data#

The subsystem exposes processed HRV and heart-rate data plus the raw signal. The physiological meaning of these metrics is covered in Concept: Biometry (PPG); below are the fields you work with in the API.

HRV#

HRV is the variation in time between consecutive heartbeats, measured in milliseconds. Because it is calculated from many inter-beat intervals, a short buffering period follows sensor start-up before values become available.

HRV parameters and explanation#

  1. Mean inter-beat interval (mean_rr): the average interval between consecutive heartbeats, in milliseconds.
  2. SDNN (sdnn): standard deviation of all normal-to-normal inter-beat intervals; overall variability.
  3. SDSD (sdsd): standard deviation of the differences between successive inter-beat intervals; short-term variability.
  4. RMSSD (rmssd): root mean square of successive inter-beat interval differences; a marker of parasympathetic (vagal) activity.
  5. SD1 (sd1): short-term variability from the Poincaré plot, mathematically related to RMSSD.
  6. SD2 (sd2): short- and long-term variability from the Poincaré plot.
  7. LF/HF (lf_hf): low-frequency to high-frequency power ratio; an index of autonomic balance.

See Concept: Biometry (PPG) for how these group into time-domain, frequency-domain, and non-linear families.

Heart rate#

Heart rate (HR) is the number of beats per minute, calculated from the interval between successive beats (the inter-beat interval, IBI).

Heart rate parameters and explanation#

  1. Heart rate (HR): beats per minute, calculated for every inter-beat interval, retrieved with ts_ppg_get_heart_rate.
  2. Validity flag: ts_ppg_is_heart_rate_valid reports whether each value is measured or extrapolated. During movement, signal artifacts can make direct measurement unreliable, so an extrapolation algorithm estimates HR to keep the stream continuous.

Explore these guides and resources to deepen your understanding and get the most out of Teslasuit PPG features:

Essential API references#

Practical guides & examples#

Deeper dives & broader concepts#

  • Concept: Biometry (PPG): The full conceptual background, including the sensor, LED wavelengths, sampling rate, and calibration.
  • Teslasuit Main Concepts: Go back to explore and understand the other Teslasuit subsystems and how PPG fits within the larger suite of technologies.