Skip to content

Fix HRV frequency PSD scale and Systole heart_rate API#1

Open
ZahraRezazadeh wants to merge 1 commit into
martager:mainfrom
ZahraRezazadeh:fix/hrv-frequency-time-units-and-systole-api
Open

Fix HRV frequency PSD scale and Systole heart_rate API#1
ZahraRezazadeh wants to merge 1 commit into
martager:mainfrom
ZahraRezazadeh:fix/hrv-frequency-time-units-and-systole-api

Conversation

@ZahraRezazadeh

Copy link
Copy Markdown
  • hrv_analysis.ipynb (load_rr_data): RRI_Time was previously cumsum'd in milliseconds while NeuroKit2's hrv_frequency() expects it in seconds. The mismatched time scale collapsed all band powers by ~6+ orders of magnitude (ULF dominating, VLF/LF/HF/VHF invisible on the linear PSD plot). Now divides by 1000 so timestamps are in seconds and matches the function's docstring.
  • hrv_analysis.ipynb (hrv_window_crop): drop the matching *1000 from the window-bounds comparison now that RRI_Time is in seconds.
  • hrv_analysis.ipynb (hrv_frequency_domain): pass ulf=(0, 0) so the ULF band is excluded for short recordings, which otherwise returns spurious large values (BBSIG known-issue note on the website).
  • ecg_preproc.ipynb (save_hr_interpol): rename keyword argument unit='bpm' to output_unit='bpm' to match Systole's heart_rate() API (the kwarg was renamed upstream and the old name now raises TypeError).

* hrv_analysis.ipynb (load_rr_data): RRI_Time was previously cumsum'd
  in milliseconds while NeuroKit2's hrv_frequency() expects it in
  seconds. The mismatched time scale collapsed all band powers by
  ~6+ orders of magnitude (ULF dominating, VLF/LF/HF/VHF invisible
  on the linear PSD plot). Now divides by 1000 so timestamps are in
  seconds and matches the function's docstring.
* hrv_analysis.ipynb (hrv_window_crop): drop the matching *1000 from
  the window-bounds comparison now that RRI_Time is in seconds.
* hrv_analysis.ipynb (hrv_frequency_domain): pass ulf=(0, 0) so the
  ULF band is excluded for short recordings, which otherwise returns
  spurious large values (BBSIG known-issue note on the website).
* ecg_preproc.ipynb (save_hr_interpol): rename keyword argument
  unit='bpm' to output_unit='bpm' to match Systole's heart_rate()
  API (the kwarg was renamed upstream and the old name now raises
  TypeError).
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

Successfully merging this pull request may close these issues.

1 participant