Clear Filters
Clear Filters

EEG lab pop_spectopo()

10 views (last 30 days)
Mubeen Janmohamed
Mubeen Janmohamed on 10 Jan 2021
Answered: Prasanna on 25 May 2024
Hi,
I would like to plot the power spectra of my events in EEGlab which were labelled by EDF browser.
The pop_spectopo() does the whole EEG epoch.
I cant seem to be finding the code to slectively do this for certain event types with a specified time from the event annotation.
Could anyone help me with this. I had trimmed the original EDF file to select data by events only.

Answers (1)

Prasanna
Prasanna on 25 May 2024
Hi Mubeen,
To plot the power spectra of specific events in EEG data, especially when those events are marked with annotations like in your case, You'll need to segment your continuous EEG data around the events of interest and then use spectral analysis functions on these segments.
  • Load the dataset using the ‘pop_loadset’ function of EEGLAB
  • Use ‘pop_epoch’ function to create epochs centred around your events of interest. You’ll need to specify the time window around each event you are interested to plot.
% extract epoch from -1 to 2 seconds around each event of type ‘x’
EEG1 = pop_epoch(EEG, {yourEventType}, [-1,2])
  • After epoching, you can plot the power spectra of these epochs using the ‘pop_spectopo’ function.
% For example, to plot the spectra at 25 points between the EEG frequencies, for channel 1:
pop_spectopo(EEG1, 1, [EEG1.xmin*1000 EEG1.xmax*1000], 'EEG' , 'percent', 25);
For more information on the ‘pop_epoch’ and the ‘pop_spectopo‘ functions, refer to the following documentations:
Hope this helps.

Categories

Find more on EEG/MEG/ECoG in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!