Bandpass Filters on EEG

    Jun 01 2010 | 3:25 pm
    I wonder whether I could get some help concerning the use of bandpass filters on a complex EEG raw data signal. Earlier, I received some help from Mudang ( and now I am comparing his patch with an other approach (ffb~).
    The results (amplitudes of bands) I get, are not similar and when looking at the spectrum get with an external fft object [IbvaGet~] the result differs again.
    I attach the project file(s) with saved EEG data (1 min) in order to demonstrate the above. If anyone is interested in helping me with some hints, I will appreciate it.
    Thank you in advance, Krisztian

    • Jun 02 2010 | 8:26 am
      hi tedor! Great to hear, that you're still active in this interesting eeg thingie. Just wanted to say, that the patch isn't originally by me, but taken from the classic-vocoder example, that comes with max.
      And your post is missing a patch (freq_analyzer_1.maxpat).
    • Jun 02 2010 | 9:05 pm
      I've been taking a look at your bandpass filter patches. To test these more fully, you might want to consider generating a sine wave reference signal so you can compare the methods at a single fixed frequency. I did this with a cycle~ object.
      I found that the settings on the fftb~ object needed to be adjusted. If you change the third parameter to an H, you should get equally spaced frequency bins. This is the way most EEG fft data is displayed.
      The fftb~ seemed to have attenuated response below 4Hz (assuming the amplitude cycle~ object is constant at low frequencies). I'm not sure why. Perhaps someone closer the the actual code could comment on the algorithm. It was probably not intended for such low frequencies.
      I have not had a chance to try the bandpass filters yet, but the change in the ratio parameter to H may produce closer results between the two methods.
      Best regards, Michael
    • Jun 04 2010 | 1:36 pm
      Hello Both
      Thank you for the replies. I am adding the missing file (freq_analyser_1.maxpat). Mudang, oh yes, brainwaves will be used sooner or later in many devices, so why not? :)
      Using the 'reference cycle' on its own or adding it to the EEG data suggests, that both analysis tool works (attached picture). I also changed the third parameter to H, though now I am not sure how the harmonic series assigns frequencies to the banks. However, maybe with my low frequencies the H gives me more or less the same ratios than the argument 2:
      fffb~ 15 2 2 30
      fffb~ 15 2 H 30
      Hopefully, by tweaking on the Q factor and having the [slide] object for smoother data, I will be able to receive similar results.
      I think to solve the problem I will have to understand the differences between the signal and float. As far as I understand, the EEG I receive is a float, which I have to convert into a signal with [sig~] in order to be used with both analysis spectrums (vocoder vs ffb).
      But, when using the [ffb~ ] the subpatch first saves the EEG data/float into a buffer, 120 sample rate and it is this buffer that gets read by using [phasor~ 1.] into [ffb~]. So in my understanding the EEG data transforms from being a float into a signal.
      To use the 'reference cycle' to test the ffb part, I need to transform the the signal into a float, and this is the part where I go really confused:
      If I have a signal for instance [cycle 10] and use a [number~] to make it into a float, will this number represent the same data? When I use a [sig~] object on this float to make a signal again... I don't think I get the original back data back. At least this is what the spectrums suggest in the patch and what I get on a simpler spectroscope~ :
      I assume this (making a float from a signal) will effect the outcome. I am sorry if I could not be clearer, thank you for you help so far.
      All the best Krisztian
    • Jun 04 2010 | 1:38 pm
      I am adding files (ha, too many post, sorry) :