Skip to content

Commit 3e232aa

Browse files
committed
fix band rms docstring and change band rms code
1 parent 0b231de commit 3e232aa

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

sigpro/aggregations/frequency/band.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@ def band_rms(amplitude_values, frequency_values, min_frequency, max_frequency):
5454
lower_frequency_than = frequency_values <= max_frequency
5555
higher_frequency_than = frequency_values >= min_frequency
5656

57-
selected_idx = np.ravel(np.where(np.ravel(higher_frequency_than & lower_frequency_than)))
58-
59-
selected_idx = [int(x) for x in selected_idx]
60-
61-
selected_values = np.array(amplitude_values)[selected_idx]
57+
selected_idx = np.ravel(np.where(higher_frequency_than & lower_frequency_than))
58+
selected_values = amplitude_values[selected_idx]
6259

6360
return np.sqrt(np.mean(np.square(selected_values)))

sigpro/basic_primitives.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,10 @@ def __init__(self, min_frequency, max_frequency):
181181

182182
class BandRMS(primitive.FrequencyAggregation):
183183
"""
184-
BandMean primitive class.
184+
BandRMS primitive class.
185185
186-
Filters between a high and low band and compute the mean value for this specific band.
186+
Filter between a high and low band (inclusive) and compute the rms value for this
187+
specific band.
187188
188189
Args:
189190
min_frequency (int or float):

0 commit comments

Comments
 (0)