-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add Hilbert RVT (Harrison et al. 2020) #22
base: master
Are you sure you want to change the base?
Conversation
# not sure why pi is here but it's in the preprint's formula | ||
ibr = np.append(0, np.diff(phas)) / (2 * np.pi) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per @CesarCaballeroGaudes, this seems to normalize radians (see #10 (comment)).
# 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if both signals should be low-pass filtered here, or if just one should be.
# 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
filtfilt
can 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?
from scipy import signal | ||
|
||
|
||
def get_butter_filter(fs, lowcut=None, highcut=None, order=5): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is a Butterworth filter (+ filtfilt
) the way to go?
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.utils
module 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)other
Checklist before review