# Filtering the EEG signals

I have very limited knowledge of DSP, so I apologize if my question is trivial :)

I have an EEG signal from which I need to extract different frequency bands. For example, waves in the the frequency band of 8-12 Hz.

After noise filtering, I was planning to simply feed the data into the FFmpeg bandpass filter, setting the 'frequency' to 10 Hz, and 'width' to 2 Hz. Is this the way to do it?

I need to ask this since I'm not sure how to check if I got the correct wave in the end.

It is one way to do it, yes. You will get frequencies between 8 an 12 Hz less attenuated compared to others, but both the 8 and 12 Hz components will be attenuated 3 dB ($\frac{1}{\sqrt{2}}$ the original magnitude) and frequencies just outside the band will be attenuated only slightly more.

The way depends on how much you would like to attenuate and so on.

For a proper filter design you would like to specify a passband (between 8 and 12 in your case), a stopband (where the filter should attenuate according to your specification, there must be a transition band), maximum allowed attenuation in the passband and minimum required attenuation in the stopband. The exact numbers can be hard to determine, but once you have some you can rather straightforwardly input them into any appropriate filter design method.

However, you should obtain some filtering using the FFmpeg approach, although there may be artifacts which you did not expect/want.

Another way of extracting certain frequency signal from EEG is FFT or correctly short-time Fourier transform (STFT).
At first you divide your main signal in several epochs and after that by using fft you could calculate each epoch's frequency component.
And after that by simply zeroing frequency which placed outside of your desired band and then calculating the inverse fft, you have that range's signal in time domain.