Skip to main content

pyPPG: a python toolbox for PPG morphological analysis.

Project description

pyPPG toolbox documentation

A toolbox for finger photoplethysmogram (PPG) analysis, including beat detection, fiducial point detection, and comprehensive assessment of standard biomarkers.

If you use the pyPPG resource, please cite:

Goda, M. A., Charlton, P. H., & Behar, J. A. (2023). pyPPG: A Python toolbox for comprehensive photoplethysmography signal analysis. DOI 10.1088/1361-6579/ad33a2, (THE ACCEPTED MANUSCRIPT IS AVAILABLE HERE)

Introduction

pyPPG is a standardised toolbox to analyze long-term finger PPG recordings in real-time. The toolbox extracts state-of-the-art PPG biomarkers (i.e. pulse wave features) from PPG signals. The algorithms implemented in the pyPPG toolbox have been validated on freely available PPG databases. Consequently, pyPPG offers robust and comprehensive assessment of clinically relevant biomarkers from continuous PPG signals.

Description

The following steps are implemented in the pyPPG toolbox:

  1. Loading a raw PPG signal: The toolbox can accept PPG signals in various file formats such as .mat, .txt, .csv, or .edf. These files should contain raw PPG data along with the corresponding sampling rate.
    • .mat: Data should be stored in two variables within the file: (i) 'Fs' representing the sampling frequency, and (ii) 'Data', a vector containing the raw PPG signal.
    • .txt: The raw PPG signal should be stored in tabular form (single tab or space-delimited), and you need to provide the sampling frequency as an input parameter to the script using 'fs'.
    • .csv: This format stores raw PPG signal data with comma separation. Similar to .txt, the sampling frequency must be provided as an input parameter to the script using 'fs'.
    • .edf: The European Data Format is supported, and it applies 'Pleth' channel by default. However, if using a different channel name, then the user needs to define it themselves.
  2. Preprocessing: The raw PPG signal is filtered to remove noise and artifacts. Subsequently, the first, second, and third derivatives (PPG', PPG'', and PPG'") of the PPG signal are computed and filtered. The resampling of the filtered PPG signal to 75 Hz is specifically performed for systolic peak detection.
  3. Pulse wave segmentation: The toolbox employs a peak detector to identify the systolic peaks. It uses an improved version of a beat detection algorithm originally proposed in (Aboy et al. 2005). Based on the peak locations, the toolbox also detects the pulse onsets and offsets, which indicate the start and end of the PPG pulse waves.
  4. Fiducial points identification: For each pulse wave, the toolbox detects a set of fiducial points.
  5. Biomarker engineering: Based on the fiducial points, a set of 74 PPG digital biomarkers (i.e. pulse wave features) are calculated.

The pyPPG toolbox also provides an optional PPG signal quality index based on the Matlab implementation of the work by (Li et al. 2015).

The toolbox identifies individual pulse waves in a PPG signal by identifying systolic peaks (sp), and then identifying the pulse onset (on) and offset (off) on either side of each systolic peak which indicate the start and end of the pulse wave, respectively.

Installation

Available on pip, with the command: pip install pyPPG

pip project: https://pypi.org/project/pyPPG/

For more details see the pyPPG example code and pyPPG YouTube video

Requirements

Python Requirements:

Python == 3.10

scipy == 1.9.1

numpy == 1.23.2

dotmap == 1.3.30

pandas == 1.5.0

wfdb == 4.0.0

mne == 1.5.0

All the python requirements are installed when the toolbox is installed, so there is no need for any additional commands.

Validation and Benchmarking

For more details see the Validation and Benchmarking

The fiducial point annotations and benchmarking results are accessible at doi.org/10.5281/zenodo.10523285.

Documentation

https://pyppg.readthedocs.io/en/latest/

The main components

  1. Software
    • An open-source algorithmic pyPPG toolbox, which loads a PPG signal, preprocesses it, segments individual pulse waves, identifies fiducial points, and calculates a set of biomarkers. This can be used within your own data analysis code using the pyPPG API.
  2. Databases

All PPG measures can be further adapted for the analysis for efficient heart rate measurement as well as health assessment with clinically relevant biomarkers.

Acknowledgments

This work was supported by the Estate of Zofia (Sophie) Fridman and funding from the Israel Innovation Authority, COST Action CA18216 VascAgeNet, supported by COST (European Cooperation in Science and Technology), and the British Heart Foundation (grant FS/20/20/34626).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyPPG-1.0.72.tar.gz (59.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyPPG-1.0.72-py3-none-any.whl (63.3 kB view details)

Uploaded Python 3

File details

Details for the file pyPPG-1.0.72.tar.gz.

File metadata

  • Download URL: pyPPG-1.0.72.tar.gz
  • Upload date:
  • Size: 59.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for pyPPG-1.0.72.tar.gz
Algorithm Hash digest
SHA256 f1dec803e24f869af43680fd73c3237b5222116a7e20278da9a79cca46ce2179
MD5 8c19ea7c84c6c315d67b41f7f294998d
BLAKE2b-256 568979711eeb51b895c3ba4cd268a4c68dc4d63c80ddaa6d6d144567e89a034b

See more details on using hashes here.

File details

Details for the file pyPPG-1.0.72-py3-none-any.whl.

File metadata

  • Download URL: pyPPG-1.0.72-py3-none-any.whl
  • Upload date:
  • Size: 63.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for pyPPG-1.0.72-py3-none-any.whl
Algorithm Hash digest
SHA256 12e2e327899c9359877144cab4fc699d8904b188abd6d126495118e3458d7eb9
MD5 bab6f78e7f40670eb6d77ef154fa543d
BLAKE2b-256 6bbdbd2baa51dd8714510894bb9d720c8dc6cba814df48882ad4c2ab990f910f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page