Template-based in-ear heartbeat extraction
from tempbeat.extraction.heartbeat_extraction import hb_extract
# sig is a 1D numpy array
# peak_time is a 1D numpy array with the time of each heartbeat in seconds
peak_time = hb_extract(sig, sampling_rate=sampling_rate, method="temp")
To use a method implemented in MATLAB, you need to have MATLAB installed and
the MATLAB engine for Python. After putting the MATLAB code in the
src/matlab
folder, you can use it as follows:
peak_time = hb_extract(sig, sampling_rate=sampling_rate, method="matlab")
This project uses pre-commit, please make sure to install it before making any changes:
pip install pre-commit cd tempbeat pre-commit install
It is a good idea to update the hooks to the latest version:
pre-commit autoupdate
Don't forget to tell your contributors to also install and use pre-commit.
This project has been set up using PyScaffold 4.5. For details and usage information on PyScaffold see https://pyscaffold.org/.