[FieldTrip] Comparison between the power spectrum of two conditions (no time bins)
Jose Rebola
jrebola at gmail.com
Fri Jul 17 16:54:45 CEST 2015
I am using this code:
cfg = [];
cfg.method = 'mtmfft';
cfg.output = 'pow';
cfg.taper = 'hanning';
%cfg.toi = 1.6 : 0.02 : 6.0;
cfg.foi = 2:60;
%cfg.t_ftimwin = ones(size(cfg.foi)) * 1.2;
cfg.keeptrials = 'yes';
freq1 = ft_freqanalysis(cfg, data1);
freq2 = ft_freqanalysis(cfg, data2);
%layout = ft_prepare_layout(cfg, ftadata1)
cfg = [];
cfg.channel = 'all';
%cfg.latency = 'all';
cfg.frequency = 'all';
cfg.method = 'montecarlo';
cfg.statistic = 'ft_statfun_indepsamplesT';
cfg.correctm = 'cluster';
cfg.clusteralpha = 0.05;
cfg.clusterstatistic = 'maxsum';
cfg.minnbchan = 2;
cfg.tail = 0;
cfg.clustertail = 0;
cfg.alpha = 0.025;
cfg.numrandomization = 1000;
% prepare_neighbours determines what sensors may form clusters
cfg_neighb.method = 'distance';
cfg.neighbours = ft_prepare_neighbours(cfg_neighb, ftadata1);
design = zeros(1,size(freq1,1) + size(freq2.powspctrm,1));
design(1,1:size(freq1.powspctrm,1)) = 1;
design(1,(size(freq1.powspctrm,1)+1):(size(freq1.powspctrm,1)+size(freq2.powspctrm,1)))
= 2;
cfg.design = design;
cfg.ivar = 1;
[stat] = ft_freqstatistics(cfg, freq1, freq2);
cfg = [];
freq11 = ft_freqdescriptives(cfg, freq1);
freq22 = ft_freqdescriptives(cfg, freq2);
stat.raweffect = freq11.powspctrm - freq22.powspctrm;
cfg = [];
cfg.alpha = 0.05;
cfg.parameter = 'raweffect';
%cfg.zlim = [-1e-27 1e-27];
cfg.layout = layout ;
ft_clusterplot(cfg, stat);
On Fri, Jul 17, 2015 at 3:52 PM, Jose Rebola <jrebola at gmail.com> wrote:
> How can I use the outputs of mtmfft ft_freqanalysis to compare two
> spectra, by means of non-parametric randomization procedures?
>
> I have the two outputs with the keeptrials option on
> Does anybody have sample code for this or an example?
> I only can find examples for TFR. I have adapted the code but not
> successfully.
> I can't interpret the output of ft_freqstatistics so well..._
>
> thank you all so much
>
> José
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150717/92235e08/attachment-0002.html>
More information about the fieldtrip
mailing list