From 3e232aa41b2e78ac3837a78b263a78580dd3d93d Mon Sep 17 00:00:00 2001 From: SaraPido Date: Wed, 15 May 2024 18:59:16 +0000 Subject: [PATCH] fix band rms docstring and change band rms code --- sigpro/aggregations/frequency/band.py | 7 ++----- sigpro/basic_primitives.py | 5 +++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/sigpro/aggregations/frequency/band.py b/sigpro/aggregations/frequency/band.py index 83122a0..4fc983d 100644 --- a/sigpro/aggregations/frequency/band.py +++ b/sigpro/aggregations/frequency/band.py @@ -54,10 +54,7 @@ def band_rms(amplitude_values, frequency_values, min_frequency, max_frequency): lower_frequency_than = frequency_values <= max_frequency higher_frequency_than = frequency_values >= min_frequency - selected_idx = np.ravel(np.where(np.ravel(higher_frequency_than & lower_frequency_than))) - - selected_idx = [int(x) for x in selected_idx] - - selected_values = np.array(amplitude_values)[selected_idx] + selected_idx = np.ravel(np.where(higher_frequency_than & lower_frequency_than)) + selected_values = amplitude_values[selected_idx] return np.sqrt(np.mean(np.square(selected_values))) diff --git a/sigpro/basic_primitives.py b/sigpro/basic_primitives.py index 9e9a7d6..66c0ad1 100644 --- a/sigpro/basic_primitives.py +++ b/sigpro/basic_primitives.py @@ -181,9 +181,10 @@ def __init__(self, min_frequency, max_frequency): class BandRMS(primitive.FrequencyAggregation): """ - BandMean primitive class. + BandRMS primitive class. - Filters between a high and low band and compute the mean value for this specific band. + Filter between a high and low band (inclusive) and compute the rms value for this + specific band. Args: min_frequency (int or float):