Skip to content

Commit a00b0a3

Browse files
committed
check if notch filter exists
1 parent b675be7 commit a00b0a3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/explorepy/stream_processor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,15 +313,15 @@ def process(self, packet):
313313
self.last_exg_packet_timestamp = get_local_time()
314314
missing_timestamps = self.fill_missing_packet(packet)
315315
self._update_last_time_point(packet, received_time)
316-
317316
self.packet_count += 1
318317
if self._is_imp_mode and self.imp_calculator:
319318
packet_imp = self.imp_calculator.measure_imp(
320319
packet=copy.deepcopy(packet))
321320
if packet_imp is not None:
322321
self.dispatch(topic=TOPICS.imp, packet=packet_imp)
323-
324-
self.dispatch(topic=TOPICS.raw_ExG, packet=self._notch_filter.apply(packet=packet, in_place=False))
322+
if self._notch_filter:
323+
self._notch_filter.apply(packet)
324+
self.dispatch(topic=TOPICS.raw_ExG, packet=packet)
325325
else:
326326
self.dispatch(topic=TOPICS.raw_ExG, packet=packet)
327327
try:
@@ -590,7 +590,7 @@ def fill_missing_packet(self, packet):
590590
return timestamps[:-1]
591591

592592
def _add_notch_filter(self):
593-
self._notch_filter = ExGFilter(
593+
self._notch_filter = ExGFilter(
594594
cutoff_freq=(61, 64),
595595
filter_type='notch_imp',
596596
s_rate=250,

0 commit comments

Comments
 (0)