Skip to content

Commit 8a6d849

Browse files
author
Joseph Atkins-Turkish
committed
Changed make_filter back to just returning a function.
1 parent bdaa6e2 commit 8a6d849

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

signals.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ def make_filter(order=5, low_freq=0.75, high_freq=5, sample_freq=250.0):
5050
low = low_freq / nyq
5151
high = high_freq / nyq
5252
b, a = signal.butter(order, [low, high], btype='bandpass')
53-
return (lambda x: signal.lfilter(b, a, x), b, a)
53+
func = lambda x: signal.lfilter(b, a, x)
54+
func.b = b
55+
func.a = a
56+
return func
5457

5558

5659
def find_periodicities(X, sample_freq=250.0):

tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_get_peaks(self):
2828
def test_make_filter(self):
2929
""" Check that the bandpass filter function filters the correct signals.
3030
N.B graph must be checked by eye! """
31-
filt, b, a = signals.make_filter(
31+
filt = signals.make_filter(
3232
order=5, low_freq=0.75, high_freq=5, sample_freq=250.0)
3333
x, y = self.make_test_signal(250.0)
3434

0 commit comments

Comments
 (0)