Problems with frequency analysis...

jan-mathijs schoffelen j.schoffelen at PSY.GLA.AC.UK
Thu Jun 5 14:16:45 CEST 2008


Hi Carina,

What's the length and time axis of your original data segments?
If the length of your data is shorter than the t_ftimwin specified in
the
configuration for freqanalysis, and/or the time points specified in toi
do not overlap with the data's time-axis, NaNs will be the
consequence :o(.
Information about the time-axis can be found in data.time.
Take care that the units correspond. Thus when data.time is in
milliseconds,
the specification in the configuration to freqanalysis should also be
in milliseconds.

Hope this helps.

JM

On Jun 5, 2008, at 2:13 PM, Carina Graversen wrote:

> Hi.
>
> I have a problem regarding the function "freqanalysis", that I hope
> some of you can help me with.
>
> I have a Neuroscan .avg file called testdata.avg, and I would like
> to see a time-frequency plot of all the 64 channels.
> ___
>
> In order to do this, I try the following:
>
> cfg1                                    = [];
> cfg1.datafile                           = 'testdata.avg'
> cfg1.headerfile                         = 'testdata.avg'
> dataFIC                                 = preprocessing(cfg1);
>
> This gives me the data in dataFIC, and if I look at the data in
> dataFIC.trial{1} I get the correct data for all the 64 channels, so
> no problem here :o).
> ___
>
> The next I try is:
>
> cfg2                                    = [];
> cfg2.output                             = 'pow';
> cfg2.channel                            = 'all';
> cfg2.method                             = 'mtmconvol';
> cfg2.taper                              = 'hanning';
> cfg2.foi                                = 2:2:30;
> cfg2.t_ftimwin                          = ones(length(cfg2.foi),
> 1).*0.5;
> cfg2.toi                                = 0.050:0.005:0.500;
>
> TFRhann                                 = freqanalysis(cfg2, dataFIC);
>
> I would have expected to get the time-frequency coefficients in the
> TFRhann.powspctrm, but all I get is a lot of NaNs :o(.
>
> Am I doing something wrong, and should I set more parameters for
> the cfg2 ???
> ___
>
> When the problem with the freqanalysis is solved, I expect to be
> able to make the plots this way - does it look right (the
> testlay_64.lay file is one I have generated myself, and if I just
> run the code with the TFRhann with all the NaNs, at least the
> electrodes appear at the right location in the plot.
>
> cfg3.zparam     = 'powspctrm';
> cfg3.xlim       = [0 0.5];
> cfg3.ylim       = [1 29];
> cfg3.zlim       = [-3e-27 3e-27];
> cfg3.layout     = 'testlay_64.lay';
> cfg3.showlabels = 'yes';
>
> multiplotTFR(cfg3, TFRhann)
> ___
>
> I look forward to all suggestions regarding the problems with
> "freqanalysis".
>
> Best regards,
> Carina Graversen
> Ph.D student at Aalborg Hospital, Denmark
>
> ----------------------------------
> The aim of this list is to facilitate the discussion between users
> of the FieldTrip  toolbox, to share experiences and to discuss new
> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/
> archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip.

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip.



More information about the fieldtrip mailing list