eripe970 / go-dsp-utils

53 stars 7 forks source link

Index out of range signal.go 21 #2

Open BrandonRaeder opened 2 years ago

BrandonRaeder commented 2 years ago

Never Mind! Not enough data..

eripe970 commented 2 years ago

Cool! :) Hope you like the library, if you have any improvements, just open a PR :)

BrandonRaeder commented 2 years ago

K! I'm half a programmer so I stumble over basic things. The out of range index was coming in because I didn't have 10 seconds of data yet call thing the function.

eripe970 commented 2 years ago

👍 everyone started somewhere, hope you can get your code to compile and that the library is working the way it should :)

BrandonRaeder commented 2 years ago

Oh its working! I believe as time progresses though, for my application, I need the heart rate to start dropping if no new signal was received.

https://ibb.co/tpGyg4S

BrandonRaeder commented 2 years ago

Not sure if that would make sense though based on how the library is processing the data. Your library is taking the data I am give it and only measuring what It can measure, statically. And if no new signal comes in, than bpm can't really change.

eripe970 commented 2 years ago

Maybe look at a window of like 10-20 seconds and calculate the heart-rate in that, an example when I did that from a mendi.io device, https://twitter.com/lazyloading/status/1403336825213751300?s=20&t=pQdh70MMCzdb6OA-1SACAQ

(that code is not open source,).

BrandonRaeder commented 1 year ago

Eric... Some time has passed and I am learning more everyday:) If you ever want to collaborate on a project let me know!