# Bandpass filter to get EEG frequency bands?

I'm doing a project with an EEG to detect driver drowsiness and learned about EEG frequency bands (alpha, beta, gamma...).

As the frequency bands are simple frequency ranges, I wonder if I can use several bandpass filters to get them (instead of using WPT / FFT)?

Is this approach correct? Is there any reason not to do it (performance)?

As the frequency bands are simple frequency ranges, I wonder if I can use several bandpass filters to get them (instead of using WPT / FFT)?

Sure! That's how it's usually done!

Is there any reason not to do it (performance)?

diabolical laugther as it happens, I've prepared just the blog post for you… TL;DR: If you don't have to process more than 20 Million EEG samples per second, your PC should do fine performance-wise.

Filtering Time-Series Data on the GNU Radio blog.

I came across an EEG problem that tried to do exactly that, filter things into multiple bands. And lo, I had 5 minutes of fun designing this bandpass filterbank for signals with $f_\text{sample}=220\,\text{Hz}$:

\begin{align} \Delta:& [1,3]\text{ Hz}\\ \theta:& [4,7]\text{ Hz}\\ \alpha_1:& [8,9]\text{ Hz}\\ \alpha_2:& [10,12]\text{ Hz}\\ \beta_1:& [13,17]\text{ Hz}\\ \beta_2:& [18,30]\text{ Hz}\\ \gamma_1:& [31,40]\text{ Hz}\\ \gamma_2:& [41,50]\text{ Hz} \end{align}

in this GNU Radio Companion flow graph

The result was that, even in this totally naive filterbank implementation, things are so much faster than real-time that you can assume that if done a little more cleverly, it'd work on any halfway DSP-affine microcontroller in real-time.

• Extremely rapid prototyping :)
– A_A
Feb 19, 2017 at 22:14
• yeah, my first prototype actually was a single filter, and then I just went ahead and modified the Python script that GNU Radio companion generates to have a loop, which took the passband edges from an array and instantiated a filter for each of those – but then I realized that for the DSP.SE question I mention above, a graphical representation of what's happening would be much nicer :) But I'm slower at clicking than at writing for loops, so it's only semy-rapid prototyping ;) Feb 19, 2017 at 22:16
• Thanks for your answer - nice blog post! I just asked this, as most papers I've read used WPT / FFT to perform a frequency analysis. What does TransitionWidth and Beta do?. Feb 20, 2017 at 7:59
• The transition width is a property of a filter response. It's the distance in frequency between the edge of the pass- end the beginning of the stop-band. (I.e. the width of the part of spectrum that is neither nicely let through by the filter, nor fully suppressed) Feb 20, 2017 at 8:15
• Beta is just a design parameter for a specific type of filter and not relevant here Feb 20, 2017 at 8:16