3
\$\begingroup\$

I got a brainwave EEG(ElectroEncephaloGram) sensor that is continuously sending data over to my program at about 200 data points per second. Can someone suggest what window/bin size I should be using if I want to do a Fast Fourier Transform(FFT) of this signal?

I'm thinking of using the maximum - 1024 points, but that would mean that I need almost 5 seconds of data to update the readings. Is there some smaller size I can use for faster updates that would still be accurate?

Here's how my signal looks like (orange line, top):

EEG signal

Thank you!

\$\endgroup\$
5
  • 1
    \$\begingroup\$ What is the lowest frequency you want to identify? That will set your requirement. \$\endgroup\$
    – jippie
    May 9, 2013 at 18:58
  • 1
    \$\begingroup\$ Start by describing WHY you want to take the FFT of the eeg. \$\endgroup\$ May 9, 2013 at 19:52
  • 1
    \$\begingroup\$ It's likely to be the tradeoff of evaluation time vs the desired frequency resolution, rather than the minimum frequency, which drives the practical decision. You can overlap the FFT windows to generate more frequent results, but recent changes will be attenuated compared to those which have endured for an entire window. \$\endgroup\$ May 9, 2013 at 20:07
  • \$\begingroup\$ @ChrisStratton You are right the resolution is important, I forgot that. \$\endgroup\$
    – jippie
    May 9, 2013 at 20:14
  • \$\begingroup\$ I"m trying to figure out if the signal is good enough to identify different brainwave bands listed in the link. I'm looking for the range of 0-50Hz. en.wikipedia.org/wiki/… \$\endgroup\$
    – Alex Stone
    May 9, 2013 at 21:42

2 Answers 2

3
\$\begingroup\$

It depends on the tradeoff you want between frequency and time resolution. The shorter you make your time window, the better you'll be able to tell when changes occur, but you'll pay for it in reduced frequency resolution. Longer windows give sharp frequency resolution, but poor time resolution. Cf. "Gabor Limit"

Keep in mind that the limits for the EEG frequency bands are a bit fuzzy. It's not like content at 3.9 Hz means something completely different than 4.1 Hz from a biological standpoint. 1 second windows provide plenty of frequency accuracy, and I've seen cool things done with windows shorter than 1/4 second. We are measuring a brain after all, not a crystal oscillator.

\$\endgroup\$
3
\$\begingroup\$

Take as big an fft as you need to get the resolution in frequency you require. You don't need to wait 5 seconds to reevaluate an fft, just slide your window along. For example, take points 1-1024, and take the fft. Then wait 100ms, take the fft of points 21-1044, etc. This will update your fft ten times per second, always using the most recent data. You just need 1024 points to take a 1024 point fft. They don't need to be 1024 brand new points!

For that matter, you're probably not limited to one fft. Your program can take multiple ffts at multiple resolutions to capture whatever you need to.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ This is a possibility, but you overlook the fact (mentioned when I raised this possibility an hour ago in a comment) that a long FFT will not fully accurately reflect changes to the signal recent enough to have been present for only part of the evaluation interval. \$\endgroup\$ May 9, 2013 at 22:00
  • \$\begingroup\$ @Chris, Didn't overlook that, its the nature of the beast. It depends on what the OP is trying to assess. There might be value in watching peaks develop with time. Also, this approach might capture a transient event that might be missed using non-overlapping samples. At some point, the sliding fft will capture a transient as optimally as possible (although attenuated), instead of missing it entirely. Again, depends on what the OP is trying to see. Personally, this feels like more of a time-domain problem to me- a bank of correlation filters, or maybe a wavelet analysis would work best. \$\endgroup\$ May 9, 2013 at 22:32
  • \$\begingroup\$ It's better than a non-overlapped fft for transients, but it's inferior for that purpose to a shorter fft. "Take as big as you like" overlooks that tradeoff. \$\endgroup\$ May 9, 2013 at 22:49
  • \$\begingroup\$ The two approaches are not exclusive. Perhaps "as big as you like" should be "as big as you need". I'll edit \$\endgroup\$ May 9, 2013 at 23:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.