Back to the main page.

Bug 2959 - prepare_freq_matrices does not work on data that is derived from 'mtmconvol'

Reported 2015-09-10 18:29:00 +0200
Modified 2016-01-14 21:27:06 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: Other
Operating System: Linux
Importance: P5 normal
Assigned to: Jan-Mathijs Schoffelen
Depends on: 2762
See also:

rené scheeringa - 2015-09-10 18:29:15 +0200

While performing beamforer on EEG data an error occurs in the 'nearest' function used for selecting the data. This bug was discussed during the EEG lunch meeting at the DCCN of 07/09. The error report is below. I used the internal fieldtrip version central storage and the bug/error still ocurred on 09/10. The cfg and data set I Used can be downloaded from: error message: [source] = ft_sourceanalysis(cfg, freq_LR2_t04_f25); Error using nearest (line 58) The limits you selected are outside the range available in the data Error in ft_selectdata_old (line 541) toitmp=nearest(data.time,[seltoi(1) seltoi(2)]); Error in ft_selectdata (line 77) [varargout{1:nargout}] = ft_selectdata_old(varargin{:}); Error in prepare_freq_matrices (line 197) freq = ft_selectdata(freq, 'foilim', cfg.frequency, 'toilim', cfg.latency); Error in ft_sourceanalysis (line 513) [Cf, Cr, Pr, Ntrials, cfg] = prepare_freq_matrices(cfg, data);

Jan-Mathijs Schoffelen - 2015-09-10 19:27:11 +0200

A workaround for now may be to follow the recipe on the wiki: - use ft_redefinetrial to cut out a time window of interest - use ft_freqanalysis with 'mtmfft' as a method - call ft_sourceanalysis.

Jan-Mathijs Schoffelen - 2015-09-11 10:36:26 +0200

I think the cause of Rene's problem is due to the fact that within ft_sourceanalysis already some processing is done on the 'mtmconvol'ed data with 'powandcsd'. These processing steps already entail a latency and frequency selection, as well as a conversion of the linearly indexed cross-spectral densities into a chan_chan representation. Next prepare_freq_matrices chokes on this, when attempting a next round of latency and frequency selection (not needed anymore). On top it was trying to use ft_selectdata_old for this :o). In short, it's time to update prepare_freq_matrices

Jan-Mathijs Schoffelen - 2015-09-11 10:57:00 +0200

fixed on revision 10659