Tuesday, October 22, 2013

Finding My Mu Waves

I'm trying to control things with my brain.  As discussed in my previous post, I think that Mu waves are the best approach that I know about right now.  I tried to get my Mu waves before, but failed.  Now I'm trying again.  This time, I've done a little more learning, so I think that I know how to do it better.  Let's go!

Listening to My Brain
Approach:  The idea with a Mu wave brain-computer interface (BCI) is that I'll use my EEG system to listen to my brain waves.  Mu waves are simple but strong signals in the Alpha band that appear in the sensorimotor (SM) cortex when you relax parts of your body.  The Mu waves go away when you move (or *think* about moving!) those parts of your body.  Supposedly, different regions of the SM cortex correspond to different portions of your body.  So, with careful use of EEG, I might be able to separate thoughts of moving my legs from thoughts of moving my arms.  Seeing other folks do this on the web, this is pretty exciting stuff.

Goal:  My goal today is not to make a full Mu wave BCI.  That's too big a leap.  Today, I just want to see if I can pick up my Mu waves.

Equipment: To do this test, I need some EEG electrodes and an EEG system:

  • For the EEG electrodes, I'm using re-usable gold-plated cup electrodes from Biopac (EL160, see pic below).  This style of electrode is often used in hospitals and in research settings.  I'm using this style of electrode because I can easily slip them within my hair and stick them to the skin.  To use the electrodes, you need some electrode paste, which is both conductive and sticky.  I used Ten20 paste, also available from Biopac.  Just swab some paste into the electrode cup and stick it firmly onto your scalp, with as little hair as possible between the skin and the electrode.

Re-Usable Gold-Plated Electrodes from Biopac
  • For the EEG system, I'm using the OpenBCI system that I'm helping to develop.  This is an open source EEG system that mates to a microcontroller, such as an Arduino.  I'm using an Arduino Uno, which is simply pumping the EEG data from the OpenBCI board to a PC.  On the PC, I'm running some software to capture the data from the serial port.  I can view the data in real time, but really, I'm going to do most of the processing afterwards.
Using OpenBCI as My EEG System

EEG Montage:  I think that a key challenge with measuring Mu waves is to get the electrodes in the right place.  They must be over the sensorimotor cortex or you're not going to see them.  How do you find the sensorimotor cortex?  Well, you have a good chance of getting it simply by drawing a line from the front of your ear (specifically, your tragion) up over the top of your head.  Really, though, you should follow the directions for finding EEG locations C3 or C4 according to the proper layout of the 10-20 system.  On my head, I put electrodes at C3 (left side), C4 (right size), Cz (top), and Oz (back).  I used Fz (front-top) as my reference electrode.  In the end, though I really only needed C3 and Oz along with the Fz reference.

Electrode Locations Used in My Testing
Another View Showing the Electrode Locations Used in My Testing

Test Plan:  So we need a test plan that will help me see Mu waves, which means that part of my test needs to have me be physically relaxed.  Then I need to make the Mu waves go away, which means that part of my test needs to have me move my body (I'll move my hand).  Actually, let's get fancy...I'm just going to *think* about moving my hand.  Finally, if I do see Mu waves, I need to make sure that I'm not just seeing alpha waves from the back of my head, so a third part of my test will be to close my eyes to induce my Posterior Dominant Rhythm, which are Alpha waves from the back of my head that expresses the idling of my visual cortex.  OK, I've got three parts of my test: relaxed, thinking about moving my hand, and relaxing but with my eyes closed.  I'm going to do this all while seated in a chair.

Data from the Oz, my Visual Cortex:  The data that I collected is messy.  This is true of most data that is ever collected from a living, breathing human being.  To help make sense of the data, I'm going to talk about the easier results first...and those are the results from the electrode at location Oz, on the back of my head.  The plot below is a spectrogram of the signal recorded at Oz.  Time is on the horizontal axis and signal frequency on the vertical axis.  A pixel's color indicates the intensity of the signal at that pixel's time and frequency.  The reason that I'm showing this plot first is because of the obviousness of the red horizontal lines that appear when my eyes are closed.  These red lines indicate strong sinusoidal signals around 9-10 Hz that are sustained when my eyes are closed.  Because it only occurs when my eyes are closed, this is certainly my Posterior Dominant Rhythm (PDR).  These are not Mu waves.  Therefore, moving forward, any signal that occurs at these times and these frequencies in my other electrodes will simply by this PDR being detected from afar.  Again, these are not Mu waves and can be ignored.

Horizontal Lines are my Posterior Dominant Rhythm
Data from the C3, my Sensorimotor Cortex:  Now that we know what to ignore, the plot below shows a spectrogram of the data from electrode C3, with is located over my SM cortex.  Probably the easiest thing to see (though it is generally messy all around) are weaker versions of the horizontal lines that appear when I close my eyes.  As discussed above, these are my PDR and should be ignored.  They are not Mu waves. What is more interesting in this plot are the faint horizontal lines a little higher in frequency (~12 Hz) that only seem to occur when I'm relaxed.  Note that, when I think about moving my hand, they go away.  These must be Mu waves!  I found them!

Some Mu Waves Are Occasionally Seen Around 12 Hz When Relaxed.

Plan for Live Feedback:  OK, so with this one test, I've shown that I can detect my Mu waves when I'm relaxed and that I can make them go away when I think about moving a body part.  That's pretty exciting. The signals are really weak, though.  It's hard to see them and it'll be hard to get the computer to detect them reliably.  Apparently, I'm not good at getting sufficiently relaxed.  My next step, therefore, is to generate some sort of live feedback based on the strength of my Mu waves.  I to do this, I will modify my PC software to process the data and make a dinging sound or something in proportion to the strength of the signal at 12 Hz.  This live feedback will tell my I'm doing the right thing.   As a result, I should be able to train myself to do a better job making Mu waves.

Plan for BCI:  Once I get better at making Mu waves, it will be easier for the computer to differentiate between my relaxed state (strong Mu waves) and my "thinking about my hand" state (no Mu waves).  Once the computer can differentiate between these two states, I will have my magical brain-controlled interface.  Moreover, since the brain is sided (left side vs right side), the computer should be able to tell the difference between thinking about the left hand versus thinking about the right hand.  With two controls (left and right) we can start doing more complex activities...like moving robot arms back and forth...or like changing the television channel up and down...or like driving a rover forward and back.

Yeah, this is gonna be cool...

Follow-Up: I recorded more Mu waves using some homemade electrodes
Follow-Up: I can now view my Mu waves using a real-time spectrogram in my Processing GUI

10 comments:

  1. If you go to this link (http://www.slideshare.net/roopchandps/eeg-wave-pattern-14999919) and jump to slide 11, it says this about Mu Waves:

    * Rhythm of Alpha Frequency
    * In you adults (Chip comment: huh!?!)
    * Arch like morphology
    * Blocked by motor movement (Chip comment: I agree)
    * Not affected by eye opening (Chip comment: I agree)
    * Blocked by mental arithmetic (Chip comment: Really? I'll have to try this.)

    Gotta be careful with the internet, though. You can't believe everything that you read. Take it as inspiration and then test, test, test!

    ReplyDelete
  2. Since about 40-50% of the EEG signal at an electrode is based on volume condition (e.g from not "under" the electrode), your "right body" signal at C3 will contain a fair amount of the "left body" signal at C4... might try using Cz as your reference when analyzing, e.g. C3-Cz for right "hand", C4-Cz for left "hand". As Cz will have about equal amounts of each hand imagery / Mu, then using that reference scheme as a common-mode-rejection trick should attenuate the contralateral Mu more, and enhance the signal "at" C3 and C4.

    Would be even better if you gathered A1 and A2 (C3-A1, C4-A2) as well as Cz. Oz will often have lots of noise - close to loud neck/shoulder muscles (EMG). Pz would also pick up the strong visual stuff fairly well, if you were looking for a visual signal.

    ReplyDelete
    Replies
    1. Thanks for the comment! I did do a little bit of exploration of using Cz as my reference instead of Fz, but it wasn't a proper study. I'll have to go back and try it again.

      For those folks doing Mu Wave detection who want to do hand (C3, C4) as well as feet (Cz), what reference do they use? Do they use the ears (A1, A2)?

      Delete
  3. I wish to know the cost of the electrode used(from biopac)

    ReplyDelete
    Replies
    1. Hello!

      If you follow the link provided, the Biopac webpage (at least here in the USA) shows that they are $20 each. There are definitely cheaper ones around, but back when I did this post, that's what I used.

      Good luck!

      Chip

      Delete
  4. Could you provide any insights about what software did you use to plot and visualize the EEG on your computer?

    ReplyDelete
    Replies
    1. For these plots, I used Matlab, because I have access through my professional work. Because it is so expensive, I've now switched to using Python to do my analysis and plotting. I've shared some of my code and data on my EEGHacker GitHub:

      https://github.com/chipaudette/EEGHacker

      Delete
  5. Excuse me. I will explore Mu-rhythm detection ways for my thesis. If you are submitting MU-rhythm files on github, could you give a specific reference on it.

    ReplyDelete
  6. I am a student in the US. I use the Biopac MP 150 to record EEG activity from F3 and F4 regions. What software have you used to exhibit the spectrogram??? I have visited this sight multiple times and have tried to find something on the MP 150 software to replicate your spectrogram and have not found how to do this...please help me!!

    ReplyDelete