# [FieldTrip] Simulate data to compare methods

Tue Jan 27 17:50:34 CET 2015

```Hello FieldTrip community,

I am new to FieldTrip and I try to simulate data to compare the
ft_frequanalysis methods Hanning, Multitaper and Wavelet.

Therefore I simulate Data manually using different latency, amplitude and
frequency combinations using the following equation:

sig1 = exp(-(t-lat1).^2/(2*sigma1))*amp1.*sin(2*pi*f1*t);

sig2 = exp(-(t-lat2).^2/(2*sigma2))*amp2.*sin(2*pi*f2*t);

sig3 = exp(-(t-lat1).^2/(2*sigma1))*amp1.*sin(2*pi*f2*t);

sig4 = exp(-(t-lat2).^2/(2*sigma2))*amp2.*sin(2*pi*f1*t);

sig = sig1+sig2+sig3+sig4;

where amp1=20; amp2 = 5; lat1= 1.7; lat2 = 2.3; f1 = 12; f2 = 60;

After using ft_frequanalysis (see the following cfgs)

*Cfg Wavelet:*

cfg = [];

cfg.output     = 'pow';

cfg.channel    = labels;

cfg.method     = 'wavelet';

cfg.width      = 7;

cfg.gwidth     = 3;

cfg.foilim     = [1 70];

cfg.toi        = 0:0.05:2;

TFRwave = ft_freqanalysis(cfg, data_preproc);

*Cfg Hanning / Multitaper:*

cfg = [];

cfg.output     = 'pow';

cfg.channel    = labels;

cfg.method     = 'mtmconvol'

cfg.foi        = 1:1:70

cfg.tapsmofrq  = 0.2*cfg.foi;

cfg.taper      = 'dpss' / ‘hanning’;

cfg.t_ftimwin  = 4./cfg.foi;

cfg.toi        = 0:0.05:2;

TFRmult1 = ft_freqanalysis(cfg, data_preproc);

the data is plotted with ft_singleplotTFR (see cfg below)

*cfg singleplot:*

cfg = [];

cfg.colorbar     = 'yes';

cfg.layout       = 'AC_Osc.lay';

ft_singleplotTFR(cfg, TFRwave);

Two problems occur. First, the power scale of wavelet and
Multitaper/Hanning differs extremely (Multi 0-~100 and Wavelet 0-~15*10^4).

1.       How can I get the scale of all methods equal, or do I have to
change the Wavelet settings to get the right scale of the values?

Second, the best result of Multitaper analysis is performed using only one
Taper. The goal was to get a result, where the advantages and disadvantages
of Multitaper analysis compared to the other methods can be seen.

2.       How can I change the simulation so that more tapers show better
results than a single taper does?

Thank you for your time and help.

Regards,

Nicolas Weeger

Student of Master-Program Appied Research,

University Ansbach,

Germany
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150127/e00a6452/attachment-0001.html>
```