[Eeglablist] simple spectral example foe continuous EEG? maybe a bit OT.
James Desjardins
jdesjardins at brocku.ca
Fri Jun 17 13:19:45 PDT 2011
Hi Andrew,
To get the spectral values from functions like spectopo.m simply add
the output names to the beginning of the call to the function at the
command line as follows:
figure;
[spectra,freqs]=spectopo(EEG.data,EEG.pnts,EEG.srate, ...
'freq',10, ...
'chanlocs', EEG.chanlocs ...
);
For the automation across multiple files I like to use the Batch
plugin. You can find download details here:
http://sccn.ucsd.edu/wiki/EEGLAB_Plugins
With the Batch plugin, once you have designed the function (or series
of functions) that you would like to perform on multiple files you
just need to copy the commands to a text file and save it with a *.htb
extension (History Template Batch file). The text in the htb file
should begin with a file loading call and end with a data saving call.
In order to bacth this procedure across files you simply need to edit
the text file so that any instance of the file name is replaced with
"BatchFName" and any instance of the file path is replaced with
"BatchFPath". The following is an example of text in an htb file that
loads an existing dataset file, performs spectopo on the data holding
the spectral information by channel in the "spectra" array, then saves
the mean of frequency bins 3 to 20 of channels 2, 4 and 6 to a coma
delimited text file that has the same name as the input and appends
the extensions ".spec.txt".
EEG = pop_loadset('filename','BatchFName','filepath','BatchFPath');
figure;
[spectra,freqs]=spectopo(EEG.data,EEG.pnts,EEG.srate, ...
'freq',10, ...
'chanlocs', EEG.chanlocs ...
);
close;
dlmwrite('BatchFName.spec.txt',mean(spectra([2,4,6],[3:20]),2));
Once the Batch_plugin folder is in the EEGLAB plugins folder and you
restart EEGLAB a new menu will appear at the far right of the main
EEGLAB GUI (named "Batch"). Select from the Batch menu "Run history
template batch". This will bring up a GUI that will let you load a
history file (htb) and then load multiple data files. When you press
OK the batch plugin will simply loop through the code found in the htb
files for each data file selected... on each iteration it simply
pastes the current file name into any instance of "BatchFName"
(likewise for the path and "BatchFPath").
James Desjardins
Technician, MA Student
Department of Psychology, Behavioural Neuroscience
Cognitive and Affective Neuroscience Lab
Brock University
500 Glenridge Ave.
St. Catharines, ON, Canada
L2S 3A1
905-688-5550 x4676
Quoting Andrew Hill <andrewhill at ucla.edu>:
> Hi folks,
>
> Is there any simple way to calculate the average spectral amplitudes
> for each channel in an EEG set, using continuous files?
>
> I see several functions in EEGLab and ERPLab that appear to
> calculate this, but I'm not sure how to get this info "out" .. e.g.
> my matlab experience is a bit lacking in terms of manipulating
> channels directly versus the GUI
>
> does anyone have an example of how to simply measure (FFT?)
> specified freq ranges?
>
> I've got hundreds of files to process this way, ideally creating a
> text file for each one, so if there is a more automated way to do
> this that someone can suggest I'd appreciate it :)
>
> Best,
> Andrew
>
>
>
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to
> eeglablist-request at sccn.ucsd.edu
>
More information about the eeglablist
mailing list