# What is the best way of filtering EEG signal for the specific frequency band?

I have an EEG data with a sampling rate is 500 Hz. Actually, there are too many ways to filter EEG signals. However, the abundance of options is not valid for me. I have to use a causal, linear-phase FIR filter with a small group delay as possible. I also want to -3dB attenuation at cut- off frequencies.

The problem arises at this point. Look at the figure below.

I applied 30th order FIR filter (hamming window 4-30 Hz) on the continuous (non-epoched) EEG. The side-lobe attenuation for higher frequencies is satisfactory but the lower frequency components for this filter failed. I don't want to use rectangular window because of relatively low side-lobe attenuation. How can I design ideal filter to make possible my intention?

• Do you have actual target specifications. An "ideal filter" may not be possible but provide minimum acceptable target specifications for the parameters that are important to you. Note that a short transition band with high rejection requires a longer group delay. Aug 24, 2020 at 11:52
• Actually, the most important expectations from the FIR filter I will use in the pre-processing are that small group delay ( max 30th order filter), good side-lobe attenuation (min -40 dB for higher components) and -3dB cut-off frequency attenuation. Aug 24, 2020 at 12:35
• Assuming you want to restrict to a linear FIR phase filter with 30 taps, then I would recommend the least-squares algorithm provided by "firls" in MATLAB/Octave and Python scipy.signal. It will provide the best passband and rejection performance in the least-squared sense (minimum rms error from target) Aug 24, 2020 at 14:30
• In this case, the pass-band ripple is higher than the classical window-based FIR filter approximation. However, this filter is capable of satisfying conditions for the lower frequency components. It is not enough for my study yet. I will try to solve this problem. Thank you so much for your advice. You are so kind. Aug 24, 2020 at 16:18
• Note that the firls functions provide weighting options if you want to have more attention on passband ripple. Aug 24, 2020 at 16:23

## 1 Answer

Perhaps you should try some of the filter design tools that are available online. You can define the required filter behavior (Cutoff frequency, Ripple ..) and you will get a design solution that fits your needs. This kind of tools will help you know what is possible to achieve in terms of filtering performance given the constraints that you detailed

Checkout the following ones ( this is not an exhaustive list) :

http://t-filter.engineerjs.com/

https://webench.ti.com/filter-design-tool/filter-response

Best regards,

Mourad

• Thank you so much. These are useful websites. Aug 24, 2020 at 18:11