[FieldTrip] ft_spiketriggeredspectrum questions

Aaron T aaron__t at hotmail.com
Mon Nov 19 19:11:59 CET 2012

I'm trying to get started with dsp and running into some difficulty grasping the proper use of ft_spiketriggeredspectrum and ft_spiketriggeredspectrum_stat.  
The sample code at the bottom uses LFP data that has already been bandpassed filtered (theta); I am trying to examine spike-lfp statistics in theta, and would greatly appreciate help figuring out how to analyze spike phases.  
The issues I am having relate to the use of the cfg.method (mtmfft vs convol), foo and timwin/t_ftimwin and foi.  As well as perhaps the use of ft_spiketriggeredspectrum_stat generally.

1)  Should .foi be specified if the data is already filtered?  I changed the code below to restrict foi to a plv (8Hz) I would be able to simplify and understand, but I am guessing I should use theta ranges?  I've tried code that replicates (and also values that further limit) the frequency of the bp filter, but am not sure how .foi is intended to be used here.

2)  Ive gone through the tutorials, and according to code snippet in the timefrequencyanalysis tutorial tfrhann.freq = "% Array of frequencies of interest (the elements of freq may be different from your cfg.foi input depending on your trial length) ".   I'm not quite sure what that means?  
When I use the single frequency of 8Hz and cfg.timwin = [-0.5 0.5]; %1 second window 
I receive (for data with 82 trials, single spike channel, 11 lap channels) a 1x151 double array of values as the tfrSample.ang value in the code below (using mtmfft as the cfg.method).  The 151 array columns (frequencies) appear to converge on two separate values (in odd and even columns respectively).  I'm not understanding what these represent?
3) When I change the timwin to [-0.25 0.25] I receive fewer values (1x7 ), again with what appears to be two converging sets of values, but they are not terribly similar to the 1 second values I am receiving.
4) cfg.method = convol results in a single tfrSample.ang value, but while cfg.t_ftimwin = 4./cfg.foi and cfg.t_ftimwin = 4./cfg.foi yield a somewhat similar answer, cfg.t_ftimwin = 16 ./cfg.foi is completely different.
5) Am I correct that the input for ft_spiketriggeredspectrum_stat should be the decomposed spike data as in the code below (vs spike)? 
6) In contrast to the ang method in ft_spiketriggeredspectrum_stat, using angle(stsFFT.fourierspctrm{1}) in Example1 yields an array that I believe represents spikes * lfp channels * the same 151 frequency values.  I'm not sure I understand the difference between angle and the ft _stat ang method? 
7) is mtmfft just a faster version of fft?

Sample Code (multiple examples):
if Example1 
 cfg              = [];
 cfg.method       = 'fft';
 cfg.timwin       = [-0.5 0.5]; 
 cfg.foi          = 8;       
 cfg.taper        = 'hanning';
 cfg.spikechannel = FFTSpikeChannel;
 cfg.channel      = data_lfp.label;
 stsFFT  = ft_spiketriggeredspectrum(cfg, data_all);
 ang = angle(stsFFT.fourierspctrm{1});   
 cfgTfr1 = [];
 cfgTfr1.method = 'ang';
 tfr1 = ft_spiketriggeredspectrum_stat(cfgTfr1,stsFFT);
 if Example2 
  cfg.timwin       = [-0.25 0.25]; % time window of 500 msec
if Example3
 cfg.method       = 'mtmfft';
 cfg.foi       = 8;
 cfg.t_ftimwin = 8 ./ cfg.foi; % 8 cycles per frequency
if Example4
ConvolSpikeChannel = spike.label{1};   
cfg.spikechannel = ConvolSpikeChannel;
cfg.method    = 'convol';
cfg.foi       = 8;
cfg.t_ftimwin = 4./cfg.foi; % 4 cycles per frequency
stsConvol = ft_spiketriggeredspectrum(cfg, data_all);
 tfr4 = ft_spiketriggeredspectrum_stat(cfgTfr,stsConvol);
 if Example5
 cfg.t_ftimwin = 8./cfg.foi; % 8 cycles per frequency, also try 16 cycles
I apologize in advance as I am very new to dsp and suspect my problems may be related to my own ignorance and lack of understanding of the principles and not just fieldtrip usage, so if anyone can make sense out of this much too lengthy post I would greatly appreciate any guidance!  Thanks.


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

More information about the fieldtrip mailing list