This application is built mainly to run the data acquisition process from the sensor inside the android smartphone, and then it will run the following signal processing stuff that was written in javascript, it uses Rhino Engine to run the javascript code natively in android.
The signal processing code uses math.js and numeric.js library as the dependency to do nearly all matrix operations inside the algorithm, and also bessel.js to do bessel function.
The calculation.js are the main algorithm that will calculate and measure the respiration rate value from the acquired sensor data by doing several signal processing steps that you can understand by looking at the code (for now, im going to release the link to the paper for this research in the near future).
The algorithm will need data from accelerometer and gyroscope sensor, thus needing the smartphone to have those two sensors.
╭─f4r4w4y@blackrock ~/Documents/general/autorr ‹master*› ‹base›
╰─$ tree app/src/main/assets
app/src/main/assets
├── calculation.js
├── math.js
└── numeric.js
This application will acquire the sensor in a frequency of 100Hz by running the data acquisition function in the background using simple kotlin coroutines mechanism namely suspend function that you can see (mainly) in these lines of code.
You can get the apk here to download and install it.
I have fixed all the bugs that i have found earlier, but if you found another one, please dont hesitate to open up an issue in this repo.
Oh and anyway, i recorded the whole session of porting the octave/matlab code to javascript and then i created the timelapse and uploaded it on my youtube channel which you can see here, https://youtu.be/2PG6IHR1rSM