[Eeglablist] power spectral plot for averaged sensor data

Tarik S Bel-Bahar tarikbelbahar at gmail.com
Wed Aug 17 20:27:12 PDT 2016


Hello Xianghong, Notes below, thank you!



*************First please try googling "eeglablist + your topic/question",
it is an important resource for you. This basic topic has been covered a
lot before on the list, and there are many responses that you can use
easily there, including SPECIFIC EXAMPLES of exactly how to  get/average
metrics out of the output of that spectral eeglab function (see some basic
info about that right below)

*************If you haven''t had a chance to yet, please also go through
the online eeglab tutorial with the tutorial data, which includes many
important details and examples, including how to access the "data
structures" in eeglab, how to access the "outputs" of eeglab functions, and
how to write "eeglab scripts". You can google "eeglab" and each of those
topics. If necessary, google online matlab tutorials and youtube videos
that show how to work with functions and outputs, as basic matlab training
is necessary to make the best of eeglab.


*************Use EEGH (lowercase) to find out how to run the function from
the Matlab command line
Type eegh in the matlab command line after eeglab has made the
Channel/spectral maps figure. Find the command that was just run
("pop_spectopo", which actually runs "spectopo"). That is the name of the
function. Type doc "pop_spectopo" and review the documentation. then type
doc "spectopo" and review the documentation. Review the OUTPUTS section of
the documentation for spectopo. These are "spectra and freqs" and there are
others too. Now check out the code lines below, where there is an example
of "adding the ouputs"


*************THIS IS AN EXAMPLE of what COMES OUT OF THE EEGH COMMAND after
you run the Plot Channel/Spectra command from the eeglab gui:
figure; pop_spectopo(EEG, 1, [0  2998], 'EEG' , 'percent', 15, 'freq', [6
10 22], 'freqrange',[2 25],'electrodes','off');

If you run that line above in the matlab command window, you will make a
new figure (just like when you use the gui)


************NOW ADD THE OUTPUT PART to the Beginning of the command [look
at the change at the beginning]
[spectra  freqs] = pop_spectopo(EEG, 1, [0  2998], 'EEG' , 'percent', 15,
'freq', [6 10 22], 'freqrange',[2 25],'electrodes','off');

After you run this line, spectra and freqs will be two new variables in
your matlab variables. You can review the documentation for their meaning,
but essentially spectra holds the spectral values for each channel at each
frequency, and the freqs variable holds a list of which frequencies were
computed. So you can average across sensors for your frequencies of choice
from the data matrix that is named "spectra". To learn how to average, you
can google for basic matlab tutorials on how to average vectors or matrices.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20160817/4eb5cd2a/attachment.html>


More information about the eeglablist mailing list