Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download data #9

Open
Srivathsa-Bharadwaj opened this issue May 6, 2021 · 2 comments
Open

Download data #9

Srivathsa-Bharadwaj opened this issue May 6, 2021 · 2 comments

Comments

@Srivathsa-Bharadwaj
Copy link

Hi,

I am currently working on a project which needs HRV, IBI and other data.
I came across this repository which has good resource required for my project. I just wanted to know if it is possible to update the data acquired from the graph to a CSV file every 5 seconds or so, so that it can be used later for processing.

Thank you
Srivathsa

@georod99
Copy link

georod99 commented May 6, 2021 via email

@biomurph
Copy link
Contributor

biomurph commented May 6, 2021

@Srivathsa-Bharadwaj
This is a great feature add to the PulseSensor Playground Library.
Right now, the code sends a raw sample at about 50Hz. I say about because that is timed with a 20mS delay() function.

The Pulse Sensor code, however samples at 500Hz, (2mS sample rate) and I think there are a couple of ways to go about getting every sample if you need it without missing any.

First you have to have a sample stamp of some kind. An easy one is just a counter that can verify if any datapoints are lost.
Then,
Either one would send out every sample, along with IBI value when a beat happened. The values have to be parsable, but that could happen with our scheme of adding an ASCII coded prefix to the value or a different protocol.
Or, one could make a buffer of samples to send intermittent to the sample rate. That would take some benchmarking to see how much time is available for sending buffers. At first glance, 500Kbaud rate can fit a decent amount of data in 2mS, so buffering has enough headroom if the receiver can't handle a fire hose of data.

For saving data in a .csv file, you can try PulseSensor_Visualizer_Record_Playback, which would be a good starting point to saving a file. This has not been tested with high frequency data, I don't think, so that would be a fun test to run. First make sure it works as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants