# [FieldTrip] different frequency bins

Eelke Spaak eelke.spaak at donders.ru.nl
Mon Jul 22 15:00:39 CEST 2013

```Dear Johanna,

The slight differences in frequency bins was probably caused by a
slightly different trial length for some of your participants. When
doing frequency analysis, the frequency resolution is determined by
the length of your data. (You can have a look at e.g. this FAQ entry:

You mention that the differences in frequency bins are very small. In
your case, therefore, I would solve (or 'patch' ;) ) the problem by
simply doing something like:

participantB.freq = participantA.freq;

for all participants B with the aberrant frequency axis. Of course,
this only makes sense if the frequency axes between participants A and
B are actually almost identical!

Hope this helps,
Best regards,
Eelke

On 22 July 2013 14:40, Johanna Fieß <Johanna.Fiess at uni-konstanz.de> wrote:
> Dear all,
>
> whenever I try to compute the statistics for (MEG) time-frequency data, this
> error message comes up:
>
> computing statistic over the frequency range [8.000 11.000]
> computing statistic over the time range [0.300 1.100]
> Error using ft_appendfreq (line 250)
> the input data structures have non-unique frequency bins, concatenation
> across frequency is not possible
>
> Error in ft_appendfreq (line 139)
>       freq = ft_appendfreq(tmpcfg, varargin{:});
>
> Error in ft_freqstatistics (line 231)
>     data = ft_appendfreq(cfg, varargin{:});
>
> Out of 35 participants in total, (only) three show slightly different
> frequency bins (starting point 2.0001 instead of 1.9998) – if I remove them
> from the average, the error message disappears.
> If renaming the freq-structure of those three participants, the error
> message disappears, too.
>
> Could anyone tell me what causes this problem or how I should handle it?
>
> Thanks a lot in advance!
>
> Johanna
>
>
> PS: I'm running Matlab R2012b & fieldtrip-20130515
> %% stats
> design=[1:10,1:10; ones(1,10),ones(1,10)*2];
>
> cfg = [];
> cfg.frequency       =  [8 11];
> cfg.latency         =  [.3 1.1];
> cfg.method           = 'montecarlo';
> cfg.statistic       = 'indepsamplesT';
> cfg.correctm         = 'cluster';
> cfg.clustertail     = 0;
> cfg.clusteralpha   = 0.05;
> cfg.clusterstatistic = 'maxsum';
> cfg.numrandomization = 500;
> cfg.alpha            = 0.05;
>
> cfg.avgoverfreq     = 'yes';
> % cfg.avgovertime     = 'yes';
> cfg.design          = design;
> cfg.neighbours      = neighbours;
> cfg.ivar  = 2;
>
>
> stat = ft_freqstatistics (cfg,patUr{:}, konUr{:});
> cfg = [];
> cfg.alpha  = 0.3;
> cfg.parameter = 'stat';
> cfg.zlim   = [-3 2];
> cfg.layout = '4D148.lay';
> ft_clusterplot(cfg, stat);
>
>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

```