<div dir="ltr"><div><div><div><div><div><div><div>Dear all<br><br>I am working on the cross frequency phase-amplitude coupling and I tried to run the following code provided in the tutorial in the latest version of FieldTrip (fieldtrip-lite-20141125)<br><br>""<b>Calculate coherence between power and raw<br></b><br>% mtmconvol<br>cfg = [];<br>cfg.method    = 'mtmconvol';<br>cfg.channel   = 'mix';<br>cfg.output    = 'pow';<br>cfg.taper     = 'hanning';<br>cfg.foi       = 2:2:60;<br>cfg.toi       = data.time{1}(3001:7000); %power is calculated at every sample<br>cfg.t_ftimwin = 4./cfg.foi; %timewindow used to calculated power is 4 cycles long and therefore differs over frequencies<br>cfg.keeptrials = 'yes';<br><br>freq1 = ft_freqanalysis(cfg,data);<br><br>% Make data same length as freq1<br>data_cut = data;<br>for iTr = 1:length(data.trial)<br>  data_cut.trial{iTr} = data.trial{iTr}(:,3001:7000);<br>  data_cut.time{iTr}  = data.time{iTr}(3001:7000);<br>end<br><br>data_app = ft_appenddata([],data_cut, freq1); %contains original channel and channels with power<br>                                           %FieldTrip automatically converts the freq1 data to raw data. <br>                                           <br>% mtmfft output cross-spectral-density between mix(raw) and freq1<br>cfg = [];<br>cfg.method    = 'mtmfft';<br>cfg.output    = 'powandcsd';<br>cfg.taper     = 'hanning';<br>cfg.foilim    = [2 60];<br>cfg.keeptrials = 'no';<br>cfg.pad = 4;<br>cfg.channelcmb = {'mix' 'mix@2Hz'; 'mix' 'mix@4Hz'; 'mix' 'mix@6Hz'; 'mix' 'mix@8Hz'; 'mix' 'mix@10Hz'; 'mix' 'mix@12Hz'; 'mix' 'mix@14Hz'; 'mix' 'mix@16Hz'; 'mix' 'mix@18Hz'; 'mix' 'mix@20Hz'; 'mix' 'mix@22Hz'; 'mix' 'mix@24Hz'; 'mix' 'mix@26Hz'; 'mix' 'mix@28Hz'; 'mix' 'mix@30Hz'; 'mix' 'mix@32Hz'; 'mix' 'mix@34Hz'; 'mix' 'mix@36Hz'; 'mix' 'mix@38Hz'; 'mix' 'mix@40Hz'; 'mix' 'mix@42Hz'; 'mix' 'mix@44Hz'; 'mix' 'mix@46Hz'; 'mix' 'mix@48Hz'; 'mix' 'mix@50Hz'; 'mix' 'mix@52Hz'; 'mix' 'mix@54Hz'; 'mix' 'mix@56Hz'; 'mix' 'mix@58Hz'; 'mix' 'mix@60Hz';};<br><br>freq2 = ft_freqanalysis(cfg,data_app);<br><br>% calculate coherence<br>coh = ft_freqdescriptives([],freq2);<br><br>coh.freq2 = [2:2:60];<br>figure; imagesc(coh.freq, coh.freq2, coh.cohspctrm)<br>axis xy<br>print -dpng phalow_amphigh_fig5.png""<br><br><br></div><div>It gives me the following error "Reference to non-existent field 'cohspctrm'."<br></div><br>Can anyone tell me if I'm doing something wrong or is there a problem in the code? <br></div>Any help would be appreciated.<br><br></div>Best<br></div>Deepshikha Moolchandani<br></div>Research Assistant<br></div>Brain and Vision Research Lab<br></div>Boston University<br></div>