Skip to content

Commit 4701bda

Browse files
committed
README updates
1 parent f79ed5c commit 4701bda

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Description
2-
This algorithm is derived from the Brainflow SpO2 algorithm, and uses PPG-R and PPG-IR data from the EmotiBit to calculate SPO2 level. As a starting point, `run.py` splits PPG-R and PPG-IR signals into buffers of length 64, which are then passed to the algorithm. It is recommended for the buffers to contain **at least** 64 samples for accurate results.
2+
This algorithm is derived from the Brainflow SpO2 algorithm, and uses PPG-R and PPG-IR data from the EmotiBit to calculate SPO2 level.
3+
The repository has been setup to enable using the spO2 source code in both, Arduino and a standalone python script. We did this to enable testing source in pyhton, to fast track testing and enable us to improve algorithm performance with a shorter loop.
4+
5+
- Arduino: To use this library in Arduino, just clone the git repo or download it using the Arduino Library manager into your `Arduino/libraries` directory.
6+
- Python:
7+
- We use pybind11 to create bindgings for the c-source. The resulting `pyd` file is then used by the python script.
8+
- To learn more about using pybind and pythin, check out the [pybind/README.md](./pybind/README.md).
39

410
# Required Hardware
511
- Emotibit

pybind/README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,32 @@
44
- Python virtual environment (refer to the Emotibit Plugins [repo](https://github.com/EmotiBit/EmotiBit_Plugins/blob/main/README_py.md#Creating-python-env-with-pybind11) for specific instructions on how to setup)
55
- CMake
66
- [EmotiBit ArduinoFilters](https://github.com/EmotiBit/EmotiBit_ArduinoFilters)
7+
- The EmotiBit ArduinoFilter directory should be on the same level as this repository.
78
- **Option 1:** Library Manager
89
1. Open Arduino IDE,
910
1. open the Library Manager
1011
1. Download EmotiBit_ArduinoFilters `v1.0.1` (if not already installed)
11-
- **Option 2:** `git clone`
12+
- **Option 2:** `git clone` (*example showing cloning in Arduino Libraries directory, but user can clone in any other location, as long as ArduinoFilters is also cloned at the same directory level*)
1213
1. `cd` into Arduino libraries folder
1314
- **Windows:** `C:\Users\{username}\Documents\Arduino\libraries`
1415
- **Mac:** `/Users/{username}/Documents/Arduino/libraries`
1516
- **Linux:** `/home/{username}/Arduino/libraries`
1617
1. Run `git clone https://github.com/EmotiBit/EmotiBit_ArduinoFilters`
17-
1. Run `git checkout 2a1d6cfa0b36ba8cf9e9a19b97d8fa261519a2d9`
1818

1919
## Build
2020
- Open a terminal window
2121
- `cd` into the `pybind` directory
22-
- 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))
22+
- Before being able to run cmake, you will need to update the path to `pybind11` if required. `pybind11` is installed in the python virtual environment, as the link in the previous section explains.
23+
- We tested this with cirtual environment created using python 3.12, and therefore the path to pybind in the current CMakeLists.txt file is `py-env/lib/python3.12/site-packages/pybind11/share/cmake/pybind11/`.
2324
- Run `cmake -B build` to generate the build files (the build files will be under a directory named `build`)
2425
- Run `cmake --build build --config Release` to generate the `.pyd` file
2526
- On Windows using MSVC, the `.pyd` file will be under `pybind/build/Release`
2627
- Otherwise, the `.pyd` file will be under `pybind/build`
28+
- 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))
29+
30+
### Running run.py
2731
- Open `run.py` and uncomment lines 6-7 (if on linux/macOS), or uncomment lines 10-11 (if on Windows)
32+
- `run.py` runs on emotibit data. We have checked in test data in thie repositoty. By default, the script looks for a `data` directory on the same level. Therefore, to test the script, you can extract the `tests/sit-stand-sit_v0.0.0/ip900ap/sit-stand-sit_v0.0.0_ip900ap.zip` file and place the EMotiBit.csv file in the `data` folder. You can then use the EmotiBit data parser to parse the files, since the script looks for files ending in `_PR` and `_PI`.
2833

2934
## Testing
3035
- Unzip the `.zip` file in `tests/simulated-unobstructed-airway_v0.0.0/ip900ap`

0 commit comments

Comments
 (0)