From Raw to Absolute Band Powers
Posted: Thu Oct 14, 2021 6:47 pm
Hello,
I am currently working on a research project as a research assistant and it is my first time using the Muse. We have collected data and just for me to learn, I am trying to replicate the graph of a specific channel and a specific from the online plotting tool mind monitor provides.
To do so, I import my data into Matlab EEGLAB and preprocess the data first (removing the offset, applying a highpass filter of 0.5 Hz and rejecting artifacts manually). Then I go back into the normal matlab scripting window and use a hanning tapering method and a short-time Fourier transform to get the power values distributed into 129 bins (using the approach from mike x cohen as a guideline):
fft_y = fft(yHan,NFFT)./numel(yHan); % take FFT normalize by length
pow_y = fft_y.*conj(fft_y); % mult by complex conjigut to get power (p)
P(ii,:) = pow_y(1:NFFT/2+1);
Afterwards I take the log10 of the sum of each frequency range for each point in time (here I am using the delta waves and the TP10 channel as an example):
delta_log=log10(sum(P(b.delta(1):b.delta(2),:)));
I then convert the values from a {-1:+1} scale to a {0,-100} scale like suggested.
When averaging the values per second (I think that is what the online tool does, since it only displays one value per second), I still do not get a graph that looks anything like the one shown online. Obviously if I just take the values of the first columns that represent the alpha, beta, ... values for each channel, I end up with the same plot as the one online. But I would seriously be interested in how to get there myself just using the raw data.
So I was wondering what pipeline/procedure is used in the online plotting tool to go from raw data to the absolute band power graph. I have looked through the forum and the archive plenty of times, but am still clueless.
I am looking forward to an answer,
Sincerely,
Jan
I am currently working on a research project as a research assistant and it is my first time using the Muse. We have collected data and just for me to learn, I am trying to replicate the graph of a specific channel and a specific from the online plotting tool mind monitor provides.
To do so, I import my data into Matlab EEGLAB and preprocess the data first (removing the offset, applying a highpass filter of 0.5 Hz and rejecting artifacts manually). Then I go back into the normal matlab scripting window and use a hanning tapering method and a short-time Fourier transform to get the power values distributed into 129 bins (using the approach from mike x cohen as a guideline):
fft_y = fft(yHan,NFFT)./numel(yHan); % take FFT normalize by length
pow_y = fft_y.*conj(fft_y); % mult by complex conjigut to get power (p)
P(ii,:) = pow_y(1:NFFT/2+1);
Afterwards I take the log10 of the sum of each frequency range for each point in time (here I am using the delta waves and the TP10 channel as an example):
delta_log=log10(sum(P(b.delta(1):b.delta(2),:)));
I then convert the values from a {-1:+1} scale to a {0,-100} scale like suggested.
When averaging the values per second (I think that is what the online tool does, since it only displays one value per second), I still do not get a graph that looks anything like the one shown online. Obviously if I just take the values of the first columns that represent the alpha, beta, ... values for each channel, I end up with the same plot as the one online. But I would seriously be interested in how to get there myself just using the raw data.
So I was wondering what pipeline/procedure is used in the online plotting tool to go from raw data to the absolute band power graph. I have looked through the forum and the archive plenty of times, but am still clueless.
I am looking forward to an answer,
Sincerely,
Jan