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

[docs] window size for locreg detrending #747

Merged
merged 10 commits into from
Nov 15, 2022
6 changes: 4 additions & 2 deletions neurokit2/signal/signal_detrend.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ def signal_detrend(
Only used if ``method`` is "loess". The parameter which controls the degree of smoothing.
window : float
Only used if ``method`` is "locreg". The detrending ``window`` should correspond to the
desired low frequency band to remove (for instance, ``1.5`` will remove frequencies below
1.5Hz).
1 divided by the desired low-frequency band to remove
(``window = 1 / detrend_frequency``)
For instance, to remove frequencies below ``0.67Hz`` the window should be ``1.5``
(``1 / 0.67 = 1.5``).
stepsize : float
Only used if ``method`` is ``"locreg"``.
components : list
Expand Down
4 changes: 2 additions & 2 deletions studies/ecg_benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,8 @@ def tarvainen(ecg, sampling_rate):
def locreg(ecg, sampling_rate):
ecg = nk.signal_detrend(ecg,
method="locreg",
window=0.5*sampling_rate,
stepsize=0.02*sampling_rate)
window=1/0.5,
stepsize=0.02)
signal, info = nk.ecg_peaks(ecg, sampling_rate=sampling_rate, method="neurokit")
return info["ECG_R_Peaks"]

Expand Down
4 changes: 2 additions & 2 deletions studies/ecg_benchmark/make_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ def standardization(ecg, sampling_rate):
#def locreg(ecg, sampling_rate):
# ecg = nk.signal_detrend(ecg,
# method="locreg",
# window=0.5*sampling_rate,
# stepsize=0.02*sampling_rate)
# window=1/0.5,
# stepsize=0.02)
# signal, info = nk.ecg_peaks(ecg, sampling_rate=sampling_rate, method="neurokit")
# return info["ECG_R_Peaks"]
#
Expand Down