Chebyshev Type II Filter
Description
This module implements a Chebyshev Type II bandpass filter for EEG data. The chebyshevII function applies a recursive filter with a steeper roll-off and controlled stopband ripple.
Function
- bciflow.modules.tf.bandpass.chebyshevII.chebyshevII(eegdata, low_cut=4, high_cut=40, btype='bandpass', order=4, rs='auto')[source]
- Parameters:
eegdata (dict) – A dictionary containing the EEG data, where the key ‘X’ holds the raw signal and ‘sfreq’ holds the sampling frequency.
low_cut (int) – The lower cutoff frequency of the bandpass filter (default is 4 Hz).
high_cut (int) – The upper cutoff frequency of the bandpass filter (default is 40 Hz).
kind_bp (str) – The type of filter (‘bandpass’, ‘lowpass’, ‘highpass’, etc., default is ‘bandpass’).
order (int) – The order of the filter (default is 4).
rs (str) – The minimum attenuation in the stopband (default is ‘auto’, which sets 40 dB for bandpass and 20 dB for other types).
- Returns:
output – The original dictionary with the filtered data stored under the key ‘X’.
- Return type:
dict
The implementation uses the scipy.signal.cheby2 function to design the filter and scipy.signal.filtfilt for zero-phase filtering.