Add Hilbert RVT (Harrison et al. 2020)#22
Draft
tsalo wants to merge 3 commits intophysiopy:masterfrom
Draft
Conversation
tsalo
commented
Dec 30, 2020
Comment on lines
+56
to
+57
| # not sure why pi is here but it's in the preprint's formula | ||
| ibr = np.append(0, np.diff(phas)) / (2 * np.pi) |
Member
Author
There was a problem hiding this comment.
Per @CesarCaballeroGaudes, this seems to normalize radians (see #10 (comment)).
tsalo
commented
Dec 30, 2020
Comment on lines
+62
to
+64
| # low-pass filter both(?) at 0.2Hz | ||
| ibr = butter_bandpass_filter(ibr, fs=sampling_freq, highcut=0.75) | ||
| rv = butter_bandpass_filter(rv, fs=sampling_freq, highcut=0.75) |
Member
Author
There was a problem hiding this comment.
I'm not sure if both signals should be low-pass filtered here, or if just one should be.
tsalo
commented
Dec 30, 2020
Comment on lines
+47
to
+51
| # Reconstruct the oscillatory portion of the signal, cos(𝜙(𝑡)), | ||
| # and lowpass filter at 0.75 Hz to remove any resulting artefacts. | ||
| oscill = np.cos(phas) | ||
| oscill = butter_bandpass_filter(oscill, fs=sampling_freq, highcut=0.75) | ||
| phas = np.arccos(oscill) |
Member
Author
There was a problem hiding this comment.
It seems to me that a number of transformations could be done here, and I'm not sure why one was chosen over the others:
- phase to oscillatory portion of signal (as is done)
- phase + magnitude to analytic signal, to be split again after low-pass filtering (assuming
filtfiltcan work with complex-valued data). - phase + magnitude to reconstructed original signal, to be transformed again using the Hilbert after low-pass filtering.
- Just filtering the phase signal, right?
tsalo
commented
Dec 31, 2020
| from scipy import signal | ||
|
|
||
|
|
||
| def get_butter_filter(fs, lowcut=None, highcut=None, order=5): |
Member
Author
There was a problem hiding this comment.
Is a Butterworth filter (+ filtfilt) the way to go?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10.
This adds a new function (
chest_belt.hilbert_rvt()) to calculate the Hilbert transform-based RVT metric from Harrison et al. (2020). This implementation is based on the manuscript, rather than any available code (couldn't find any).Proposed Changes
metrics.chest_belt.hilbert_rvt()to calculate the new metric.metrics.chest_belt.utilsmodule in support of the new metric.Change Type
bugfix(+0.0.1)minor(+0.1.0)major(+1.0.0)refactoring(no version update)test(no version update)infrastructure(no version update)documentation(no version update)otherChecklist before review