go-dsp-utils icon indicating copy to clipboard operation
go-dsp-utils copied to clipboard

Index out of range signal.go 21

Open BrandonRaeder opened this issue 3 years ago • 7 comments

Never Mind! Not enough data..

BrandonRaeder avatar Jul 24 '22 10:07 BrandonRaeder

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

eripe970 avatar Jul 25 '22 08:07 eripe970

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.

BrandonRaeder avatar Jul 25 '22 21:07 BrandonRaeder

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

eripe970 avatar Jul 26 '22 14:07 eripe970

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 avatar Jul 26 '22 17:07 BrandonRaeder

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.

BrandonRaeder avatar Jul 26 '22 17:07 BrandonRaeder

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,).

eripe970 avatar Jul 26 '22 20:07 eripe970

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

BrandonRaeder avatar Mar 22 '23 21:03 BrandonRaeder