Applying FFT to raw data

buzzardavalanche
Posts: 4
Joined: Thu Jul 30, 2020 5:59 pm

Applying FFT to raw data

Post by buzzardavalanche »

Hi All,

I'm new to this, I've been wanting to use the auxiliary cable with the muse headset and see the data of certain bands. Only the four original electrodes on the muse have the bands transmitted over OSC for you, to get band infomation for the auxiliary cable I would need to apply a FFT to the raw data. I've been trying to work this out by applying a FFT to AF8 raw data to get 'Alpha' and comparing it to the 'Alpha' data coming in from OSC for AF8. Occasionaly the lines look similar, but in most cases they are not.

What would I need to do to make my FFT match what was coming out of Muse Monitor?
Screenshot from 2020-07-30 22-52-51.png
Screenshot from 2020-07-30 22-52-51.png (164.96 KiB) Viewed 3695 times
Screenshot from 2020-07-30 22-52-46.png
Screenshot from 2020-07-30 22-52-46.png (160.53 KiB) Viewed 3695 times
User avatar
James
Site Admin
Posts: 1103
Joined: Wed Jan 02, 2013 9:06 pm

Re: Applying FFT to raw data

Post by James »

If you look at the Interaxon docs through the web archive it says they are doing calcs at 10hz using a sliding set of 256 values.

https://web.archive.org/web/20181105231 ... and_Powers

"We use a Hamming window of 256 samples(at 220Hz), then for the next FFT we slide the window 22 samples over(1/10th of a second). This gives a 90% overlap from one window to the next. These values are emitted at 10Hz."

Note these docs were not updated for the Muse 2, so the 220hz data rate they are referring to is the output from the Muse 1. I imagine the SDK code is doing the same thing for the Muse 2, 256hz data. Unfortunately the SDK FFT code is closed source so I can't tell you the exact calcs they are doing. I know they drop blink packets and remove power line noise. I am also interested in working out the specifics of this myself, but haven't had time.

What software is in the screenshot? Looks cool :-)
buzzardavalanche
Posts: 4
Joined: Thu Jul 30, 2020 5:59 pm

Re: Applying FFT to raw data

Post by buzzardavalanche »

Hi James,

Thank you for responding, I'll see if I can apply that let you know what I get.

What you are seeing is an application called Neuromore, it's like UE4 blueprint for bio/neuro data, you can make your own feedback experiences, it's free for individuals :)
buzzardavalanche
Posts: 4
Joined: Thu Jul 30, 2020 5:59 pm

Re: Applying FFT to raw data

Post by buzzardavalanche »

I butchered another muse python project (muse-lsl) which applied and FFT in it's neurofeedback demo the way that you mentioned. It's gotten much more closer results. The range seems to be different though, any ideas one what I could do to address that?
Screenshot from 2020-08-03 21-14-54.png
Screenshot from 2020-08-03 21-14-54.png (32.33 KiB) Viewed 3670 times
User avatar
James
Site Admin
Posts: 1103
Joined: Wed Jan 02, 2013 9:06 pm

Re: Applying FFT to raw data

Post by James »

Have you tried normalizing the raw data before the fft?
buzzardavalanche
Posts: 4
Joined: Thu Jul 30, 2020 5:59 pm

Re: Applying FFT to raw data

Post by buzzardavalanche »

Normalizing to unit 1? I'll give that a go, I'll let you know how that works out.
User avatar
James
Site Admin
Posts: 1103
Joined: Wed Jan 02, 2013 9:06 pm

Re: Applying FFT to raw data

Post by James »

Raw egg comes in at ~800 volts, so subtracting the average voltage from the sample set before doing the FFT. You could subtract a static figure to have the raw voltage zero based, but different versions of the Muse have different base voltages. I'm not sure if you need to do this, but it's something I do for my FFT view and I don't recall why. I think someone at Interaxon told me to do it, but it was a few years ago when I wrote my FFT code, so my memory is hazy!
Henke
Posts: 8
Joined: Sun Oct 29, 2017 3:54 am

Re: Applying FFT to raw data

Post by Henke »

just wonder: any progress on the FFT part of the Aux electrode?

Thanks

Henrik
Sebastiii
Posts: 15
Joined: Mon Jan 11, 2021 2:23 pm

Re: Applying FFT to raw data

Post by Sebastiii »

James wrote: Thu Jul 30, 2020 6:39 pm Unfortunately the SDK FFT code is closed source so I can't tell you the exact calcs they are doing. I know they drop blink packets and remove power line noise. I am also interested in working out the specifics of this myself, but haven't had time.
Hello :)
This is weird, because the new Sleep function didn't work for me until, I remove the electronic device to avoid the 50Hz interference.
So this mean, meditation protocol has FFT that remove power line but not sleep protocol ?

Thanks if you have an idea :)
paulbrennan
Posts: 17
Joined: Thu Jul 16, 2020 7:51 am

Re: Applying FFT to raw data

Post by paulbrennan »

Hi all, I'm also working on a similar project. I'm using Blue Muse, a python script and Neuromore using a 2016 Muse. Like this:
https://github.com/ViacheslavBobrov/LSL_Neuromore

For some reason I had more success setting this up with Blue Muse than with Mind Monitor (no offence to James) but the theory is the same I think.
I'm also wondering how best to validate it. I'm really more interested in ratios than absolute amplitudes. For example, with the electrode at the back of the head, alpha should block (reduce) with eyes open as compared with eyes closed. I think mine usually blocks at about 30% on a proper EEG setup but with this setup I only see about 10% block. So I'm guessing something is probably not right. I haven't yet tried any of the suggestions here (such as comparing the filtered raw output with the Muse frontal bandwidths) so I'll give that a go first.

Just a note that even with Myndlift (the consumer version of this setup) the amplitudes are weird and not really comparable with other equipment in my experience. So I think it's probably more suitable for looking at things like ratios, symmetry, etc.
Post Reply