band pass filter and notch filter for an upper frequency do not give the same result

Hi all,

We dont get the same result when we are plotting the 2 following EEG (eeg_filtered and eeg_notch): eeg_notch is way less crowded…

# filter the data between 0.1 to 55 Hz
eeg_filtered = eeg.copy().filter(l_freq=0.1, h_freq=55) 

# notch filter for freq =60
eeg_notch = eeg_filtered.copy().notch_filter(freqs=60)

We don’t understand why because 60Hz is upper than 55 so it should already be removed when we apply the filter between 0.1 and 55Hz

Do you know why ?

Thanks a lot for your help !

1 Like

Can you post images of the PSDs of these two signals? I assume that the bandpass filter does not suppress activity at 60Hz enough since this is very close to the edge frequency. The notch filter has strong attenuation only at 60Hz.

@victoriasus1 just as @cbrnr suggest the passband filter you are using likely doesn’t suppress 60 Hz enough. First, make sure that you are using a recent mne-python version. Then, when you are filtering take a look at the filter information that are printed - particularly take a look at the “Upper transition bandwidth” information. It is very likely that the transition bandwidth is much longer than 5 Hz. You can change the bandwidth yourself - take a look at the excellent filtering tutorial written by Eric Larson. Alternatively you can lower the upper passband edge (for example to 50 Hz).

1 Like

Hi,

Thanks a lot for your answers its really useful !

So you were right it’s a question of cutoff frequency which is a little bit higher than 60Hz when we choose the Hfreq= 55Hz

The information printed when we apply the high pass filter are the following:

  • Upper passband edge: 55.00 Hz
  • Upper transition bandwidth: 13.75 Hz (-6 dB cutoff frequency: 61.88 Hz)

What does that mean “ Upper transition bandwidth: 13.75 Hz“ ?
Does this mean that the transition band is from 48,13Hz (61,88-13,75) to 61,88Hz ?

Again thanks a lot !

The upper passband edge frequency marks the end of the passband. From that frequency, the signal gets more and more attenuated in the transition band, which in your case is 13.75Hz wide, so it ranges from 55Hz to 68.75Hz. The 6dB attenuation (cutoff frequency) is at 61.88Hz. After the transition band, the stopband starts at 68.75Hz. Its attenuation is also mentioned in the output (probably 53dB).

1 Like

Niiiice ! Thanks a lot, it’s crystal clear now :slight_smile:

1 Like