Skip to content

Commit 687b6f4

Browse files
authored
Merge pull request #430 from Mentalab-hub/asr-1k-sps
Change low cutoff for higher SPS
2 parents 7a97a7a + a99cc29 commit 687b6f4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/explorepy/asr_processor.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def __init__(self, stream_proc, in_topic):
130130
self.last_cleaned_timestamp = 0.0
131131
self._refresh_window: float = self._default_clean_timer # how long to wait between running asr, in s
132132

133+
self.filter_low_cutoff = 0.1 if self.sr < 1000 else 2
133134
self._cutoff = self._default_cutoff
134135
self._state = None
135136

@@ -221,7 +222,7 @@ def clean_data(self):
221222
if self.to_clean_ts[0][0] <= 1.0:
222223
return
223224
filt_sig = bp_filter(self.to_clean.copy(), 45, 55, btype='bandstop', fs=self.sr)
224-
filtered_data = bp_filter(filt_sig, .1, 40, fs=self.sr)
225+
filtered_data = bp_filter(filt_sig, self.filter_low_cutoff, 40, fs=self.sr)
225226
try:
226227
ret = asr_pipeline(filtered_data, self.sr, self.ch_count, self._state)
227228
self.cleaned_data_available = True
@@ -272,7 +273,7 @@ def stop_calibration(self):
272273
def set_state_from_calibration_data(self, calib_data):
273274
self.lifecycle_state = State.CLEANING
274275
filt_sig = bp_filter(calib_data, 45, 55, btype='bandstop', fs=self.sr)
275-
filtered_data = bp_filter(filt_sig, .1, 40, self.sr)
276+
filtered_data = bp_filter(filt_sig, self.filter_low_cutoff, 40, self.sr)
276277
cleaned, state = clean_calib_data(filtered_data, self.sr)
277278
if cleaned is None:
278279
self.calibration_data_available = False

0 commit comments

Comments
 (0)