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

Few remarks from a first-timer #57

Open
5 tasks
ryobg opened this issue Apr 12, 2023 · 3 comments
Open
5 tasks

Few remarks from a first-timer #57

ryobg opened this issue Apr 12, 2023 · 3 comments

Comments

@ryobg
Copy link

ryobg commented Apr 12, 2023

Hello,

As an unprofessional first-timer, I have kept a record of few notes while trying Systole:

  • An error message X must be a 1darray is more readable as a X must be a 1d array for example.

  • * Document somewhere that in order to use Bokeh, output_notebook () should be called. I know it is a 3rd part add-on, but it took me hours until I noticed that call in one (of many) places in the documentation. After that I read their API ofc. But that time could have been saved?

  • The current usage of CDSView is deprecated in Bokeh 3.0+ (e.g. plot_rr (show_artefacts = True) fails)

  • Not all function can actually work with integer arrays (non numpy.float64). For the rr_ms type I had to explicit convert beforehand.

  • A mixed time-frequency report, like wavelet transforms, would be great.

Just my 2c.
Thank you for the great framework!
I will make good use if it for my chest-band monitor -> Garmin watch -> hrv report notebooks.

@LegrandNico
Copy link
Contributor

Hi @ryobg , thank you for pointing this out, this kind of feedback is really helpful for developing the library 👍

These are all good points, I will work on a PR to add some fixes for that. Regarding the wavelet approach, this is probably an issue in itself. Do you have papers or toolbox that document that as a starting point?

@ryobg
Copy link
Author

ryobg commented Apr 16, 2023

Heya, wrt to the wavelets:

I have checked out few articles:

But there are many others which are behind a paywall. My non-physiology view says that the ability to look at the temporal changes of cycles over time is a good addition. It seems, many articles agrees on that. The difficulty is being to setup the proper transforms of the mother wavelet (Daubechies?). I'm currently investigating some wavelet libs in python, like scipy.signal.cwt and PyWavelets.

I'm sorry I'm unable to help here.

@ryobg
Copy link
Author

ryobg commented Apr 17, 2023

I'm having some barely noticeable success with a code along the lines of:

import pywt
wavelet = 'morl'
periods = [2.5, 5, 10, 20, 40, 80, 160, 320]
scales = pywt.frequency2scale (wavelet, 1 / numpy.array (periods))
_, ax = plt.subplots (figsize = (20, 7))
ax.set_ylabel ("Frequency (s)")
ax.set_xlabel ("Time (minutes)")
coef, _ = pywt.cwt (ibi, scales, wavelet)
ax.imshow (abs (coef), aspect = 'auto', interpolation = 'nearest',
        extent = [0, ibi.sum () / (1000*60), max (periods), min (periods)],
        vmax = abs (coef).max (), vmin = abs (coef).min ())  
plt.show () 

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

2 participants