[Eeglablist] Plot and Extract ERSP values for statistical analysis (ERD)
Benjamin Bardel
benbardel at gmail.com
Tue Feb 13 16:00:56 PST 2018
Dear EEGLAB Community,
I’m trying to study the ERD/ERS of multiple subjects in different conditions (multiple trials, epochs [-2000 1000], Fs=1000 Hz, Notch filtered) but I’m having some issues and I can’t find answers despite many questions asked on the list about this subject…
My questions (and solutions so far…) are :
1 - How to plot time-frequency decomposition (envelope) of multiple channels, in specific frequency range (alpha and beta bands) ?
I tried : using metaplottopo but the figure is not quite visible …When I look at the T-F decomposition I don’t know how I can analyze the ERSP envelope, and I want to extract the data to do statistical analysis. So I use STUDY function :
>> [STUDY ALLEEG] = std_precomp(STUDY, ALLEEG, {},'interp','on','recompute','on','ersp','on','erspparams',{'cycles' [6 0.5] 'freqs' [7 40] 'freqscale' 'linear' 'nfreqs' 100 'ntimesout' 200 'padratio' 4}); %% Precomputing the data
>> [STUDY ersp times freqs] = std_erspplot(STUDY,ALLEEG,'plotfunc','newtimef','trialbase', 'on','freqrange', [7 13], 'channels',{'F3’,’FZ’,’F1’ ‘etc..’}); %% Plot all ERSP between specified frequencies for 14 channels:
But this time I don’t have the value (envelope) of the ERSP, only the RGB map… so it’s possible to add the envelope (like metaplottopo or newtimef) ?
2 - How to compute ERSP according to Pfurscheller : ERSP=(10.^(ERSP/10)-1)*100 and not ERSP=10*log10(A/R)
There is a post about that : https://sccn.ucsd.edu/pipermail/eeglablist/2013/006061.html. I have my variable ’ersp’ in the Workspace but I don’t know how to do statistical analysis with it :
cell {ersp} : 16x200x14 : 16 (number of frequency points between 7 and 13) x 200 (times -1400 → 500ms) x14 (Number of channel).
Should I add ‘baseline’, [NaN] in std_precomp parameter and then :
>> ersp_abs = 10.^(ersp{1}/10)*100 %% Transform log Spectrum to absolute dB spectrum
>> min_erspabs=min(ersp_abs); %% Minimum for each frequency points (16), in each time points (200) and for each channel
>> meanerspabs=mean(ersp_abs(:,1:50,:)) %% Mean of the first 50 points (assuming it is the baseline) for each freq points and for each channel
>> mean_erspabs=mean(meanerspabs) %% Mean of the 50 mean value above for each chan
>> ERD= (min_erspabs-mean_erspabs)./mean_erspabs %% apply Pfurscheller ERD= (A-R)/R
The result is a 1 :200 :35 matrix of ERD for each time point and for each channel but is it right ?
Or should I instead do this: Add ‘baseline’ [-1500 -1000] in std_precomp parameter ? Is this method good to analyse ERSP ? Is the format of the value in the variable ‘ersp’ (Standard Deviation ?) is the same as ERSP=(10.^(ERSP/10)-1)*100 ?
2’ - And then can I apply this formula (found on the post above) ? :
>> AllSsErspData_cond1 = mean(erspdata{1},1); %Take average of all frequencies:
>> ClustErspData_cond1 = mean(AllSsErspData_cond1,3); %Take Average ERSP data for all electrodes in cluster
>> ClustERD_cond1 = (10.^(ClustErspData_cond1/10)-1)*100; %Compute ERS/ERD (percent change)
But what if I want to extract average ERSP for each electrodes (14 in my case) ? Then compared/compute each channel ERSP of each subject ?
>> S1ErspData_1 = mean(erspdata{1},1); %Take average of all frequencies for subject 1
>> S2ErspData_2 = mean(erspdata{2},1); %Take average of all frequencies for subject 2
>> MeanAllSubj=((S1ErspData_1(1,:,:)+S2ErspData_2(1,:,:))/2); %%Compute mean of Mean S1 and Mean S2 for each chans
>> ERDMeanAllSubj=(10.^( MeanAllSubj /10)-1)*100 %% Compute ERD of the Mean ERSP for each chan
2’’- Is there a faster way (or better) to Compute ERD (percent change) ?
2’’’- Is it possible to use the statcond() function to do this kind of statistical analysis : Compare ERD in 2 differents conditions of 5 subjects (MeanERDcond1 versus MeanERDcond2) for each channel ?
3 - Is it ok to do a wavelet transform [6 0.5] for frequency between [7-13] or is it too much ? And should I put a lower padratio (4) or is it OK ?
Sorry for all these questions at the same time but if anyone could give me some leads I would really appreciate because I’m completely stuck and I don’t know if i’m doing right …
Sincerely,
Benjamin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20180214/135d37f6/attachment.html>
More information about the eeglablist
mailing list