Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the user guide for the big picture.

nilearn.signal.butterworth#

nilearn.signal.butterworth(signals, sampling_rate, low_pass=None, high_pass=None, order=5, copy=False)[source]#

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
signalsnumpy.ndarray (1D sequence or n_samples x n_sources)

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

sampling_ratefloat

Number of samples per time unit (sample frequency).

low_passfloat or None, optional

Low cutoff frequency in Hertz. If specified, signals above this frequency will be filtered out. If None, no low-pass filtering will be performed. Default=None.

high_passfloat, optional

High cutoff frequency in Hertz. If specified, signals below this frequency will be filtered out. Default=None.

orderint, 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 can lead to numerical instability. Default=5.

copybool, optional

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

Returns
filtered_signalsnumpy.ndarray

Signals filtered according to the given parameters.