You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Running EmotiBit Brainflow SpO2 Algorithm using `pybind`
2
+
## Requirements
3
+
- Python
4
+
- Python virtual environment (refer to the Emotibit Plugins [repo](https://github.com/EmotiBit/EmotiBit_Plugins/blob/main/README_py.md#setting-up-python-virtual-environment) for specific instructions on how to setup)
5
+
- CMake
6
+
- [EmotiBit ArduinoFilters](https://github.com/EmotiBit/EmotiBit_ArduinoFilters) installed using Arduino Library Manager (or manually cloned/copied into the Arduino/libraries folder)
7
+
8
+
## Build
9
+
- Open a terminal window
10
+
- `cd` into the `pybind` directory
11
+
- Activate the Python virtual environment (instructions found in Emotibit Plugins [repo](https://github.com/EmotiBit/EmotiBit_Plugins/blob/main/README_py.md#setting-up-python-virtual-environment))
12
+
- Run `cmake -B build` to generate the build files (the build files will be under a directory named `build`)
13
+
- Run `cmake --build build --config Release` to generate the `.pyd` file
14
+
- On Windows using MSVC, the `.pyd` file will be under `pybind/build/Release`
15
+
- Otherwise, the `.pyd` file will be under `pybind/build`
16
+
17
+
## Testing
18
+
- Run the EmotiBit Data Parser on `tests/simulated-unobstructed-airway_v0.0.0/ip900ap/EmotiBit.csv`
19
+
- Verify that `EmotiBit_PI.csv`, `EmotiBit_PR.csv`, and `EmotiBit_UN.csv` exist under `tests/simulated-unobstructed-airway_v0.0.0/ip900ap`
20
+
- Switch to the terminal window in the `pybind` directory
21
+
- Run `python run.py ../tests/simulated-unobstructed-airway_v0.0.0/ip900ap`
22
+
- `matplotlib` may need to be installed for the script to run successfully
23
+
- A plot of the raw PPG data overlayed with the calculated SpO2 should appear
0 commit comments