<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Dear Ladies and Gentlemen,</span><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">i have some problem by using the example code "phalow_amphigh" in advanced (link: <a href="http://fieldtrip.fcdonders.nl/example/crossfreq/phalow_amphigh" target="_blank">http://fieldtrip.fcdonders.nl/example/crossfreq/phalow_amphigh</a> ). I do my best in the last days to understand my issue, which i will described below:</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">First, the code will generate a powerspectrum with the 'mtmconvol' method. For Signal2 at every 2Hz until 60Hz. After that it will do a 'mtmfft' calculation, so that we get on both axies the frequency range.</div><div style="font-family:arial,sans-serif;font-size:13px">What will happened to the powerspectrum of signal2@2Hz etc. in this case? Powerspectrum of powerspectrum? This is another confusing point.</div><div style="font-family:arial,sans-serif;font-size:13px">Finally, when i calculate the coherence between the created channels (singal1 between signal2@2Hz etc.) i get some strange output. I use the example signals in the code at your homepage. </div><div style="font-family:arial,sans-serif;font-size:13px">The plotting with imagesc generate a picture which seems to be wrong. But maybe it can also be, that i cant understand the result and therefore my interpretation is false. In general, the signal1 and signal2 are independend at different frequencys and the result should be a blue (low or no coherence) picture. But i get some blue jets and the rest of the picture is amlost red (high coherence). This is very confusing to me! Please tell me what i do wrong or is there a fieldtrip bug? </div><div style="font-family:arial,sans-serif;font-size:13px">Thanks a lot and you will make me very happy with your answer! </div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I used the Fieldtrip version from 9.11.14.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Yours sincerely</div><div style="font-family:arial,sans-serif;font-size:13px">Alexander</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">The code part for this issue:</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><div>cfg = [];</div><div>cfg.method    = 'mtmconvol';</div><div>cfg.channel   = 's2 (high)';</div><div>cfg.output    = 'pow';    </div><div>cfg.taper     = 'hanning';</div><div>cfg.foi       = [2:2:60];</div><div>cfg.toi       = data.time{1}(3001:7000); %power is calculated at every sample</div><div>cfg.t_ftimwin = 4./cfg.foi; %timewindow used to calculated power is 4 cycles long and therefore differs over frequencies</div><div>cfg.keeptrials = 'yes';</div><div><br></div><div>freq4 = ft_freqanalysis(cfg,data);</div><div><br></div><div><br></div><div>% Make data same length as freq1</div><div>data_cut = data;</div><div>for iTr = 1:length(data.trial)</div><div>  data_cut.trial{iTr} = data.trial{iTr}(:,3001:7000);</div><div>  data_cut.time{iTr}  = data.time{iTr}(3001:7000);</div><div>end</div><div><br></div><div>data_app = ft_appenddata([],data_cut, freq4); %contains original channel and channels with power</div><div>                                           %FieldTrip automatically converts the freq4 data to raw data. </div><div>   </div><div><br></div><div>                                                                                 </div><div><br></div><div><br></div><div><br></div><div><br></div><div>% mtmfft output cross-spectral-density between s2 (high)(raw) and freq4</div><div>cfg = [];</div><div>cfg.method    = 'mtmfft';</div><div>cfg.output    = 'powandcsd';</div><div>cfg.tapsmofrq  = 1;</div><div>cfg.foilim    = [2 60];</div><div>cfg.keeptrials = 'no';</div><div>cfg.pad = 4;</div><div>cfg.channelcmb = {'s1 (AM)' 's2 (high)@2Hz'; 's1 (AM)' 's2 (high)@4Hz'; 's1 (AM)' 's2 (high)@6Hz'; 's1 (AM)' 's2 (high)@8Hz'; 's1 (AM)' 's2 (high)@10Hz'; 's1 (AM)' 's2 (high)@12Hz'; 's1 (AM)' 's2 (high)@14Hz'; 's1 (AM)' 's2 (high)@16Hz'; 's1 (AM)' 's2 (high)@18Hz'; 's1 (AM)' 's2 (high)@20Hz'; 's1 (AM)' 's2 (high)@22Hz'; 's1 (AM)' 's2 (high)@24Hz'; 's1 (AM)' 's2 (high)@26Hz'; 's1 (AM)' 's2 (high)@28Hz'; 's1 (AM)' 's2 (high)@30Hz'; 's1 (AM)' 's2 (high)@32Hz'; 's1 (AM)' 's2 (high)@34Hz'; 's1 (AM)' 's2 (high)@36Hz'; 's1 (AM)' 's2 (high)@38Hz'; 's1 (AM)' 's2 (high)@40Hz'; 's1 (AM)' 's2 (high)@42Hz'; 's1 (AM)' 's2 (high)@44Hz'; 's1 (AM)' 's2 (high)@46Hz'; 's1 (AM)' 's2 (high)@48Hz'; 's1 (AM)' 's2 (high)@50Hz'; 's1 (AM)' 's2 (high)@52Hz'; 's1 (AM)' 's2 (high)@54Hz'; 's1 (AM)' 's2 (high)@56Hz'; 's1 (AM)' 's2 (high)@58Hz'; 's1 (AM)' 's2 (high)@60Hz';};</div><div><br></div><div><br></div><div>freq5 = ft_freqanalysis(cfg,data_app);</div><div><br></div><div><br></div><div><br></div><div>%calculate coherence</div><div><br></div><div>cfg = [];</div><div>cfg.method    = 'coh';</div><div>coh = ft_connectivityanalysis(cfg,freq5); </div><div><br></div><div>coh.freq5 = [2:2:60];</div><div><br></div><div>figure; imagesc(coh.freq, coh.freq5, coh.cohspctrm); colorbar      </div><div>xlabel('Frequency(1/Hz)'); ylabel('Frequency(1/Hz)');title('Coherencespectra S1 - S2');</div><div>axis xy</div><div>print -dpng phalow_amphigh_fig11.png</div></div></div>