<p align="center">
<a href="https://github.com/AmbiqAI/physiokit"><img src="./docs/assets/physiokit-banner.png" alt="PhysioKit"></a>
</p>
<p align="center">
<em>A Python toolkit to process raw ambulatory bio-signals. </em>
</p>
<p align="center">
<a href="https://pypi.org/project/physiokit" target="_blank">
<img src="https://img.shields.io/pypi/v/physiokit?color=%2334D058&label=pypi%20package" alt="Package version">
</a>
<a href="https://pypi.org/project/physiokit" target="_blank">
<img src="https://img.shields.io/pypi/pyversions/physiokit.svg?color=%2334D058" alt="Supported Python versions">
</a>
<a href="https://pypi.python.org/pypi/physiokit" target="_blank">
<img src="https://img.shields.io/pypi/dm/physiokit.svg?color=%2334D058" alt="Package downloads">
</a>
<a href="https://github.com/AmbiqAI/physiokit" target="_blank">
<img src="https://img.shields.io/github/stars/AmbiqAI/physiokit.svg?color=%2334D058" alt="Package downloads">
</a>
<a href="https://github.com/AmbiqAI/physiokit/LICENSE" target="_blank">
<img src="https://img.shields.io/pypi/l/physiokit" alt="License">
</a>
</p>
<p style="color:rgb(201,48,198); font-size: 1.2em;">
🚧 PhysioKit is under active development
</p>
---
**Documentation**: <a href="https://ambiqai.github.io/physiokit" target="_blank">https://ambiqai.github.io/physiokit</a>
**Source Code**: <a href="https://github.com/AmbiqAI/physiokit" target="_blank">https://github.com/AmbiqAI/physiokit</a>
---
**Key Features:**
* Handles a variety of physiological signals including ECG, PPG, RSP, and IMU.
* Geared towards real-time, noisy wearable sensor data.
* Provide advanced signal processing and feature extraction methods.
* Create synthetic signals for testing and benchmarking.
## Requirements
* [Python 3.11+](https://www.python.org)
## Installation
Installing PhysioKit can be done using `Poetry` or `pip`.
```console
pip install physiokit
```
```console
poetry add physiokit
```
## Example
In this example, we will generate a synthetic ECG signal, clean it, and compute heart rate and HRV metrics.
```python
import physiokit as pk
sample_rate = 1000 # Hz
heart_rate = 64 # BPM
signal_length = 8*sample_rate # 8 seconds
# Generate synthetic ECG signal
ecg, segs, fids = pk.ecg.synthesize(
duration=10,
sample_rate=sample_rate,
heart_rate=heart_rate,
leads=1
)
# Clean ECG signal
ecg_clean = pk.ecg.clean(ecg, sample_rate=sample_rate)
# Compute heart rate
hr_bpm, _ = pk.ecg.compute_heart_rate(ecg_clean, sample_rate=sample_rate)
# Extract R-peaks and RR-intervals
peaks = pk.ecg.find_peaks(ecg_clean, sample_rate=sample_rate)
rri = pk.ecg.compute_rr_intervals(peaks)
mask = pk.ecg.filter_rr_intervals(rri, sample_rate=sample_rate)
# Re-compute heart rate
hr_bpm = 60 / (np.nanmean(rri[mask == 0]) / sample_rate)
# Compute HRV metrics
hrv_td = pk.hrv.compute_hrv_time(rri[mask == 0], sample_rate=sample_rate)
bands = [(0.04, 0.15), (0.15, 0.4), (0.4, 0.5)]
hrv_fd = pk.hrv.compute_hrv_frequency(
peaks[mask == 0],
rri[mask == 0],
bands=bands,
sample_rate=sample_rate
)
```
## License
This project is licensed under the terms of BSD 3-Clause.
Raw data
{
"_id": null,
"home_page": "https://ambiq.ai",
"name": "physiokit",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.11,<3.13",
"maintainer_email": "",
"keywords": "physiology,bio-signals,ambulatory,wearables",
"author": "Adam Page",
"author_email": "adam.page@ambiq.com",
"download_url": "https://files.pythonhosted.org/packages/aa/0f/e1eb9f39ce4d03eec7f359d4d6ffd9f56066af3cc8b709bc7d30785ce0e4/physiokit-0.8.1.tar.gz",
"platform": null,
"description": "<p align=\"center\">\n <a href=\"https://github.com/AmbiqAI/physiokit\"><img src=\"./docs/assets/physiokit-banner.png\" alt=\"PhysioKit\"></a>\n</p>\n\n<p align=\"center\">\n <em>A Python toolkit to process raw ambulatory bio-signals. </em>\n</p>\n\n<p align=\"center\">\n<a href=\"https://pypi.org/project/physiokit\" target=\"_blank\">\n <img src=\"https://img.shields.io/pypi/v/physiokit?color=%2334D058&label=pypi%20package\" alt=\"Package version\">\n</a>\n<a href=\"https://pypi.org/project/physiokit\" target=\"_blank\">\n <img src=\"https://img.shields.io/pypi/pyversions/physiokit.svg?color=%2334D058\" alt=\"Supported Python versions\">\n</a>\n<a href=\"https://pypi.python.org/pypi/physiokit\" target=\"_blank\">\n <img src=\"https://img.shields.io/pypi/dm/physiokit.svg?color=%2334D058\" alt=\"Package downloads\">\n</a>\n<a href=\"https://github.com/AmbiqAI/physiokit\" target=\"_blank\">\n <img src=\"https://img.shields.io/github/stars/AmbiqAI/physiokit.svg?color=%2334D058\" alt=\"Package downloads\">\n</a>\n<a href=\"https://github.com/AmbiqAI/physiokit/LICENSE\" target=\"_blank\">\n <img src=\"https://img.shields.io/pypi/l/physiokit\" alt=\"License\">\n</a>\n</p>\n\n<p style=\"color:rgb(201,48,198); font-size: 1.2em;\">\n\ud83d\udea7 PhysioKit is under active development\n</p>\n\n---\n\n**Documentation**: <a href=\"https://ambiqai.github.io/physiokit\" target=\"_blank\">https://ambiqai.github.io/physiokit</a>\n\n**Source Code**: <a href=\"https://github.com/AmbiqAI/physiokit\" target=\"_blank\">https://github.com/AmbiqAI/physiokit</a>\n\n---\n\n**Key Features:**\n\n* Handles a variety of physiological signals including ECG, PPG, RSP, and IMU.\n* Geared towards real-time, noisy wearable sensor data.\n* Provide advanced signal processing and feature extraction methods.\n* Create synthetic signals for testing and benchmarking.\n\n## Requirements\n\n* [Python 3.11+](https://www.python.org)\n\n## Installation\n\nInstalling PhysioKit can be done using `Poetry` or `pip`.\n\n```console\npip install physiokit\n```\n\n```console\npoetry add physiokit\n```\n\n## Example\n\nIn this example, we will generate a synthetic ECG signal, clean it, and compute heart rate and HRV metrics.\n\n\n```python\n\nimport physiokit as pk\n\nsample_rate = 1000 # Hz\nheart_rate = 64 # BPM\nsignal_length = 8*sample_rate # 8 seconds\n\n# Generate synthetic ECG signal\necg, segs, fids = pk.ecg.synthesize(\n duration=10,\n sample_rate=sample_rate,\n heart_rate=heart_rate,\n leads=1\n)\n\n# Clean ECG signal\necg_clean = pk.ecg.clean(ecg, sample_rate=sample_rate)\n\n# Compute heart rate\nhr_bpm, _ = pk.ecg.compute_heart_rate(ecg_clean, sample_rate=sample_rate)\n\n# Extract R-peaks and RR-intervals\npeaks = pk.ecg.find_peaks(ecg_clean, sample_rate=sample_rate)\nrri = pk.ecg.compute_rr_intervals(peaks)\nmask = pk.ecg.filter_rr_intervals(rri, sample_rate=sample_rate)\n\n# Re-compute heart rate\nhr_bpm = 60 / (np.nanmean(rri[mask == 0]) / sample_rate)\n\n# Compute HRV metrics\nhrv_td = pk.hrv.compute_hrv_time(rri[mask == 0], sample_rate=sample_rate)\n\nbands = [(0.04, 0.15), (0.15, 0.4), (0.4, 0.5)]\nhrv_fd = pk.hrv.compute_hrv_frequency(\n peaks[mask == 0],\n rri[mask == 0],\n bands=bands,\n sample_rate=sample_rate\n)\n\n```\n\n## License\n\nThis project is licensed under the terms of BSD 3-Clause.\n\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "PhysioKit, process raw ambulatory bio-signals.",
"version": "0.8.1",
"project_urls": {
"Homepage": "https://ambiq.ai",
"Repository": "https://github.com/AmbiqAI/physiokit"
},
"split_keywords": [
"physiology",
"bio-signals",
"ambulatory",
"wearables"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3176def695457f77ff52764b22e71b9661e519c452e835d87370072fb47204e4",
"md5": "09ef590fab4e2146ced0ddb3390a584a",
"sha256": "cb9c510ad879781057c9555af092accccbf79f76b859fd3c05b83ceef5a3fe25"
},
"downloads": -1,
"filename": "physiokit-0.8.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "09ef590fab4e2146ced0ddb3390a584a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11,<3.13",
"size": 56070,
"upload_time": "2024-02-05T21:38:07",
"upload_time_iso_8601": "2024-02-05T21:38:07.695727Z",
"url": "https://files.pythonhosted.org/packages/31/76/def695457f77ff52764b22e71b9661e519c452e835d87370072fb47204e4/physiokit-0.8.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "aa0fe1eb9f39ce4d03eec7f359d4d6ffd9f56066af3cc8b709bc7d30785ce0e4",
"md5": "4a80b4fc0518603df132a22e374dad63",
"sha256": "463a2c39954fe7248102fe9afffc510b3bbe07c9bab245d54ec42c05c7b4115f"
},
"downloads": -1,
"filename": "physiokit-0.8.1.tar.gz",
"has_sig": false,
"md5_digest": "4a80b4fc0518603df132a22e374dad63",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11,<3.13",
"size": 42799,
"upload_time": "2024-02-05T21:38:09",
"upload_time_iso_8601": "2024-02-05T21:38:09.391260Z",
"url": "https://files.pythonhosted.org/packages/aa/0f/e1eb9f39ce4d03eec7f359d4d6ffd9f56066af3cc8b709bc7d30785ce0e4/physiokit-0.8.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-05 21:38:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "AmbiqAI",
"github_project": "physiokit",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "physiokit"
}