Hi Roemer,<br><br>I did the preprocessing with eeglab. I'm going to include the eeglab commands at the end of this mail.<br>So first the fieldtrip commands only:<br><br>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br>% reading in the data from eeglab<br>

<br>[data]=eeglab2fieldtrip(EEG, 'preprocessing', 'none');<br><br>% This step is from the fieldtrip wiki<br>cfg = [];<br>cfg.demean = 'yes';<br>data = ft_preprocessing(cfg, data);<br><br>% frequency analysis<br>

cfg = [];<br>cfg.channel    = 'all';<br>cfg.output     = 'pow';<br>cfg.method     = 'mtmconvol';<br>cfg.taper      = 'hanning';<br>cfg.foi        = 40:1:100;<br>cfg.toi        = -1.0:0.02:1.0;<br>

cfg.t_ftimwin  = 7./cfg.foi;<br>cfg.tapsmofrq  = cfg.foi*0.4;<br>cfg.pad        = 'maxperlen';<br>cfg.keeptrials = 'no';<br>freq      = ft_freqanalysis(cfg, data);<br><br>% baseline correction -300 to -100 ms<br>

<br>base = freq;<br>bix = find(freq.time < -0.1 & freq.time >-0.3);<br>totalbase    = repmat(nanmean(freq.powspctrm(:,:,bix),3),[1,1,length(freq.time)]);<br>freq.powspctrm = 100 * ((freq.powspctrm-totalbase)./totalbase);<br>

<br>% plotting the results<br>lay = ft_prepare_layout(freq);<br><br>figure<br>cfg = [];<br>cfg.layout  = lay;<br>cfg.interactive = 'yes';<br>cfg.marker = 'labels';<br>cfg.channel = {'M_4'};<br>cfg.xparam  = 'time';<br>

cfg.yparam = 'freq';<br>cfg.zparam  = 'powspctrm';<br>cfg.xlim  = [-0.3 1.0];<br>cfg.zlim  = 'maxabs' ;<br>ft_singleplotTFR (cfg, freq);<br><br><br><br><br><br><br>%%%%%%%%%%%%%%%%%%%%%%%%%<br>% So here is what I did with eeglab, before calling the eeglab2fieldtrip<br>

<br>% reading in data<br>EEG = pop_loadset('filename',[setname, '.set'],'filepath', pathname);<br>[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, CURRENTSET, 'setname', setname);<br><br>
% edit channels and reading in their locations and set reference<br>
EEG=pop_chanedit(EEG, 'load',{'E:\\E176_data\\TF_Matlab_scripts\\electrode_pos61.elp' 'filetype' 'autodetect'},'append',64,'changefield',{65 'labels' 'ref_right_ear'},'setref',{'1:64' 'ref_right_ear'});<br>

<br>[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET);<br>EEG = eeg_checkset( EEG );<br><br>% lowpass filter<br>EEG = pop_eegfilt( EEG, 0, 110, [], [0]);<br>[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);<br>

<br>% change sampling rate to 250Hz<br>EEG = pop_resample( EEG, 250);<br>[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);<br><br>% highpass filter<br>EEG = pop_eegfilt( EEG, 0.3, 0, [], [0]);<br>[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);<br>

<br>% re-referencing to linked earlobe reference<br>EEG = pop_reref( EEG, [],'refloc',struct('type',{''},'labels',{'ref_ear_right'},'radius',{0.65556},'sph_theta',{-90},'sph_phi',{-28},'theta',{90},'sph_radius',{1},'X',{5.4065e-017},'Y',{-0.88295},'Z',{-0.46947},'ref',{''},'urchan',{65}));<br>

EEG = pop_reref( EEG, [62 65] );<br><br>% run ICA<br>EEG = pop_runica(EEG, 'extended',1,'chanind', [1:61],'stop',1e-007,'maxsteps',600);<br>% Identification of components reflecting eyeblinks and -movements,<br>

% heartbeat, noise is done by hand<br><br>% get rid of artifact components<br>artcomp = sort([EEG.artifact.eyeblink, EEG.artifact.noise, EEG.artifact.heyem, EEG.artifact.ecg]);<br>EEG = pop_subcomp(EEG, artcomp, 0);<br>EEG = pop_saveset(EEG, savename, pathname);<br>

[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET);<br><br>%notch filter to take out the electrical<br>%current at 50 HZ and 100 Hz<br>EEG = pop_eegfilt( EEG, 49, 51, [], [1]);<br>[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);<br>

EEG = pop_eegfilt( EEG, 99, 101, [], [1]);<br>[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);<br><br>% epoching the data and removing<br>thresh = 100;<br>condition = {'111'};<br>for j=1:length(condition)<br>

    EEG = pop_loadset('filename', savename,'filepath', pathname);<br>    EEG = pop_epoch( EEG, {condition{j}}, [-1.0  1.2], 'newname', ['L' subject{i},' resampled pruned with ICA epochs'], 'epochinfo', 'yes');<br>

    EEG = pop_rmbase( EEG, [-100  0]);<br>    [EEG, Ind1] = pop_eegthresh( EEG, 1, [1:61], -thresh, thresh, -0.5, 0.5, 0, 1); % get rid of artifacts<br>end<br><br>% re-referencing to avg reference: do not use EOG channels for average reference<br>

EEG = pop_select( EEG, 'nochannel',[62 63]);<br>% re-reference to average reference<br>EEG = pop_reref(EEG, []);<br><br><br>Best,<br>Jonathan<br>       <br><br><div class="gmail_quote">2012/10/19 Roemer van der Meij <span dir="ltr"><<a href="mailto:r.vandermeij@donders.ru.nl" target="_blank">r.vandermeij@donders.ru.nl</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jonathan,<div><br></div><div>This indeed looks like a bleeding in of the 0Hz component. How did you exactly follow the help on the wiki? Could you post your entire analysis pipeline? (i.e. your call to ft_preprocessing, your call to ft_singleplotTFR, baselining that you do, etc.). That would help in diagnosing the problem.</div>



<div><br></div><div>All the best,</div><div>Roemer</div><div><br><br><div class="gmail_quote"><div><div class="h5">On Fri, Oct 19, 2012 at 1:23 PM, Jonathan Schubert <span dir="ltr"><<a href="mailto:jonathan.schubert@uni-hamburg.de" target="_blank">jonathan.schubert@uni-hamburg.de</a>></span> wrote:<br>



</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">Dear all,<br><br>I have a question regarding frequency analysis using the multitaper approach. I transformed my data using the following code:<br>



<br>        cfg = [];<br>        cfg.channel    = 'all';<br>
        cfg.output     = 'pow';<br>        cfg.method     = 'mtmconvol';<br>        cfg.foi        = 40:1:100;<br>        cfg.toi        = -1.0:0.02:1.0;<br>        cfg.t_ftimwin  = 7./cfg.foi;<br>        cfg.tapsmofrq  = cfg.foi*0.4;<br>






        cfg.pad        = 'maxperlen';<br>        cfg.keeptrials = 'no';<br>        freq      = ft_freqanalysis(cfg, data);<br><br>When I plot the TFR it looks strange in a similiar way to what I found on the fieldtrip homepage: <a href="http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange" target="_blank">http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange</a> <br>






Following the help on the homepage did not improve the outcome. I attached an example of my TFR.<br><br>What can I do to improve the outcome of the frequency analysis?<br><br>Best,<br>Jonathan<br><br>
<br></div></div>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><span class="HOEnZb"><font color="#888888"><br></font></span></blockquote></div>

<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><br clear="all"><div><br></div>-- <br><font size="3"><font color="darkblue"><font face="calibri">Roemer
            van der Meij M.Sc.<br>
            PhD Candidate<br>
            Donders Institute for Brain, Cognition and Behaviour<br>
            Centre for Cognition<br>
            P.O. Box 9104<br>
            6500 HE Nijmegen<br>
            The Netherlands<br>
            Tel: <a href="tel:%2B31%280%2924%203655932" value="+31243655932" target="_blank">+31(0)24 3655932</a><br>
            E-mail: <a href="mailto:r.vandermeij@donders.ru.nl" target="_blank">r.vandermeij@donders.ru.nl</a></font></font></font><div style="line-height:130%;text-align:left;font-size:10px;overflow:hidden;margin-left:0px;word-wrap:break-word;margin-top:0px;padding:0px">



</div><br>
</font></span><br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br><br clear="all"><br>-- <br><pre cols="72"><font><span style="font-family:arial,helvetica,sans-serif">Dipl.-Psych. Jonathan Schubert</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">University of Hamburg</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">Biological Psychology and Neuropsychology</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">Von-Melle-Park 11, Room 301</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">D-20146 Hamburg</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">Germany</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">-</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">Phone: (49) 40 - 42838 7626 </span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">Fax:   (49) 40 - 42838 6591</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif"></span><a style="font-family:arial,helvetica,sans-serif" href="mailto:jonathan.schubert@uni-hamburg.de" target="_blank">jonathan.schubert@uni-hamburg.de</a><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif"></span><a style="font-family:arial,helvetica,sans-serif" href="http://www.epb.uni-hamburg.de/de/personen/schubert" target="_blank">www.bpn.uni-hamburg.de</a></font></pre>

<br>