Butterworth filter
Last updated
Last updated
This function filters the data using a zero-phase butterworth filter. Either a band pass, band stop, high pass, or low pass filter can be implemented. The filter order is defined by the user. This function uses the Matlab butter
and filtfilt
functions.
1. Enter the frequencies for filtering.
2. Enter the order of the filter.
3. Select the filter type. For a band-pass filter, frequencies outside of the high and low pass cutoffs will be excluded, whereas for the band-stop filter, frequencies within the high and low pass cutoffs will be excluded. For a high-pass filter, frequencies below the cutoff will be excluded (note that low-pass field can be left blank), whereas for a low-pass filter, frequencies above the cuttoff will be excluded (note that high-pass field can be left blank).
EEG = tesa_filtbutter( EEG, high, low, ord, type );
Default use.
EEG = pop_tesa_filtbutter( EEG );
Pop up window
EEG = pop_tesa_filtbutter( EEG, high, low, ord, type );
Custom inputs
Input
Description
Example
Default
EEG
EEGLAB EEG structure
EEG
-
high
Integer setting the high pass frequency
1
-
low
Integer setting the low pass frequency
100
-
ord
Integer setting the filter order
4
-
type
String which sets the design of either a zero-phase band pass, band stop , high pass or low pass butterworth filter; string is either 'bandpass', 'bandstop', 'highpass', or 'lowpass'.
'bandpass'
-
Output
Description
EEG
EEGLAB EEG structure
EEG = pop_tesa_filtbutter( EEG, 1, 100, 4, 'bandpass' );
Zero-phase, 4th-order band pass butterworth filter between 1-100 Hz.
EEG = pop_tesa_filtbutter( EEG, 48, 52, 4, 'bandstop' );
Zero-phase, 4th-order band stop butterworth filter between 48-52 Hz.
EEG = tesa_filtbutter( EEG, 1, [], 4, 'highpass' );
Zero-phase, 4th-order high pass butterworth filter allowing frequencies above 1 Hz
EEG = tesa_filtbutter( EEG, [], 45, 4, 'lowpass' );
Zero-phase, 4th-order low pass butterworth filter allowing frequencies below 45 Hz