Giving credit

4.7.1.3. nilearn.signal.butterworth

nilearn.signal.butterworth(signals, sampling_rate, low_pass=None, high_pass=None, order=5, copy=False, save_memory=False)

Apply a low-pass, high-pass or band-pass Butterworth filter

Apply a filter to remove signal below the low frequency and above the high frequency.

Parameters :

signals: numpy.ndarray (1D sequence or n_samples x n_sources) :

Signals to be filtered. A signal is assumed to be a column of signals.

sampling_rate: float :

Number of samples per time unit (sample frequency)

low_pass: float, optional :

If specified, signals above this frequency will be filtered out (low pass). This is -3dB cutoff frequency.

high_pass: float, optional :

If specified, signals below this frequency will be filtered out (high pass). This is -3dB cutoff frequency.

order: integer, optional :

Order of the Butterworth filter. When filtering signals, the filter has a decay to avoid ringing. Increasing the order sharpens this decay. Be aware that very high orders could lead to numerical instability.

copy: bool, optional :

If False, signals is modified inplace, and memory consumption is lower than for copy=True, though computation time is higher.

Returns :

filtered_signals: numpy.ndarray :

Signals filtered according to the parameters