Skip to content
Snippets Groups Projects
Commit b617c1af authored by Tobias Hangleiter's avatar Tobias Hangleiter
Browse files

Use rms in welch

parent 63471f66
No related branches found
No related tags found
1 merge request!104Add rms functions to signal_processing
...@@ -229,9 +229,8 @@ def welch(x, fourier_procfn: Optional[Union[Callable, Sequence[Callable]]] = Non ...@@ -229,9 +229,8 @@ def welch(x, fourier_procfn: Optional[Union[Callable, Sequence[Callable]]] = Non
return d return d
elif not callable(normalize): elif not callable(normalize):
def normalize_func(d): def normalize_func(d):
# RMS normalization. Assumes detrend has already removed a constant trend, which means # RMS normalization. Assumes detrend has already removed a constant trend.
# we divide by the standard deviation. return d / rms(d, axis=-1, keepdims=True)
return d / d.std(axis=-1)[..., None]
elif axis != -1: elif axis != -1:
def normalize_func(d): def normalize_func(d):
d = np.moveaxis(d, -1, axis) d = np.moveaxis(d, -1, axis)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment