Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion neurodsp/filt/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def filter_signal(sig, fs, pass_type, f_range, filter_type='fir',

Parameters
----------
sig : 1d array
sig : 1d or 2d array
Time series to be filtered.
fs : float
Sampling rate, in Hz.
Expand Down
7 changes: 7 additions & 0 deletions neurodsp/tests/filt/test_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from pytest import raises, warns

import numpy as np

from neurodsp.tests.settings import FS, F_RANGE

from neurodsp.filt.filter import *
Expand All @@ -21,6 +23,11 @@ def test_filter_signal(tsig):
with raises(ValueError):
out = filter_signal(tsig, FS, 'bandpass', F_RANGE, filter_type='bad')

# 2d check
sigs = np.array([tsig, tsig])
outs = filter_signal(sigs, FS, 'bandpass', F_RANGE, remove_edges=False)
assert np.diff(outs, axis=0).sum() == 0

def test_iir_checks():

# Check catch for having n_seconds defined
Expand Down
2 changes: 1 addition & 1 deletion neurodsp/utils/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def wrapper(sig, *args, **kwargs):
out = [data[0] if ind in select else data for ind, data in enumerate(out)]

else:
out = np.stack(outs)
out = np.array(outs)

return out

Expand Down