Reading Channel Data: Fast Fourier Transforms, Sample Rate and Scale Factor
It is typical to convert raw EEG channel data into various "brain waves" (alpha, delta, gama frequencies, etc.) using Fast Fourier Transform.
In reading the OpenBCI v3 Data Specs, it is not obvious to me whether or not the data pumped out by the RFduino is "raw" channel data, or whether it has already undergone FFT. Any ideas?
Also, regardless of whether the EEG data is "raw" or FFT, I have some similar questions about the following concepts:
- the sample rate is explained to be 250 Hz by default, but the docs never explain what the sample rate actually is. what is it, and how does this sample rate relate to the FFT-decomposed frequencies like alpha waves, delta waves, etc.?
- i'm not entirely sure I understand the "scale factor"; what are we scaling from? what are we scaling to? I would have expected the OpenBCI mainboard to sample EEG data in, say, microvolts, and for its outputs (24-bit signed integers) to simply be expressed as those units (again, say, microvolts). is this not the case?
Thanks for any and all help!
Comments
https://en.wikipedia.org/wiki/Signal_processing
As an example of a BrainBay signal flow, see,
http://openbci.com/forum/index.php?p=/discussion/90/brainbay-install-neurofeedback-tutorial
The scale factor calculation with example is shown at the end of this page,
http://docs.openbci.com/software/02-OpenBCI_Streaming_Data_Format
Here's some comment lines in the BrainBay driver that I inserted during our mods,
// OpenBCI ADS1299 samples are 24 bits, so +- (2^23 - 1) max signed integers
//
// From TI data sheet: (Volts/count) = 4.5 Volts / gain / (2^23 - 1);
// default gain for the board is 24x,
// that gives 4.5 / 24 / (2^23 - 1) = .0223 uV per count
//
// So full scale +- range of microvolts in 24 bits is 2^23 * .02235 = +-187485.388 uV.
https://github.com/ChrisVeigl/BrainBay/blob/master/src/ob_eeg.cpp
OpenBCI_GUI code differs from this. But the GUI allows you to alter the firmware scale factor. The samples recorded in the file and shown on screen are adjusted by the scale factor you have chosen. Hence allowing both EEG and EKG to appear on a similar graph scaling. But in reality, recording both EEG and EKG simultaneously at the same default x24 scale factor, would work fine. No bits would be lost. The tutorial scale adjustment was just made for clarity of the GUI screen graph.
Bottom line, you don't have to be concerned about scale factor. Just compute using the default values.