Problems with frequency analysis...

Carina Graversen cgra05 at HST.AUC.DK
Thu Jun 12 14:17:07 CEST 2008


Hi Ingrid.

First I extract the data by:
dataFIC                                 = preprocessing(cfg1);
- And then overwrite the dataFIC.trial data with a sinusoid...

Next I do a frequency analysis:
TFRhann                                 = freqanalysis(cfg2, dataFIC);

And finally I try to plot the results of the frequency analysis:
multiplotTFR(cfg3, TFRhann)


I think this should plot the time-frequency results, right ???

Best regards, Carina



Quoting Ingrid Nieuwenhuis <ingrid.nieuwenhuis at FCDONDERS.RU.NL>:

> Hi Carina,
>
> I think this has nothing to do with the cfg settings of multiplot, but with
> the data that you are plotting. Did you first do time-frequency analysis?
> And what did you exactly plot? It looks like you plot the sinusoid itself
> isa the power of the sinusoid.
>
> Best Ingrid
>
> -----Original Message-----
> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
> Of Carina Graversen
> Sent: Thursday, June 12, 2008 2:01 PM
> To: FIELDTRIP at NIC.SURFNET.NL
> Subject: Re: [FIELDTRIP] Problems with frequency analysis...
>
> Hi Jan.
>
> Thanks for your reply - that helped quite a lot  :o).
>
> However, now I have another problem, when I want to plot the
> time-frequency results. I use the code below, and as you will notice I
> just load an .avg file, and overwrite all the data in the file to be a
> single sinusoid with a frequency of 5 Hz.
>
> However, the results I get from multiplotTFR doesn't look as expected :o(
>
> The data I put in dataFIC.trial for all channels can be watched at:
> http://www.hst.auc.dk/~cgra/fieldtrip_timeplot.jpg
>
> And the result from multiplot TFR can be seen at:
> http://www.hst.auc.dk/~cgra/fieldtrip_multiplotTFR.jpg
>
> - where I of course would have expected to have high power for all time
> instances at a frequency of 5 Hz. So I was wondering if anyone can tell
> which parameter to change in my configuration variables :o).
>
> Best regards, Carina
>
>
>
>
>
>
>
> function [] = diabetestest()
>
> close all
> clear all
> clc
>
> cfg1                                    = [];
> cfg1.datafile                           = 'diabetestest.avg'
> cfg1.headerfile                         = 'diabetestest.avg'
>
> dataFIC                                 = preprocessing(cfg1);
>
> % *************************************************************************
> % ------------------------------ DEBUG CODE ------------------------------
> % *************************************************************************
>
> test_frequency   =    5;      % Test frequency
> sample_frequency = 1000;      % Sample frequency
>
> % Generating the dummy signal:
> for i = 1:301
>     dummy_signal(i)= 5*sin(2*pi*test_frequency*i/sample_frequency);
> end
>
> for i = 1:1:68
>  dummy_matrix(i, :) = dummy_signal;  end
>
> dataFIC.trial{1} = dummy_matrix;
>
> figure(101)
> plot(dummy_matrix(1, :), 'r')
>
> % *************************************************************************
> % --------------------------- END OF DEBUG CODE ---------------------------
> % *************************************************************************
>
> cfg2                                    = [];
> cfg2.method                             = 'wltconvol'; %= 'mtmconvol';
> cfg2.output                             = 'pow';
> cfg2.channel                            = 'all';
> cfg2.foi                                = 0.1:0.05:20;
> cfg2.toi                                = 0.050:0.001:0.300
> cfg2.width                              = 0.0005;
>
> TFRhann                                 = freqanalysis(cfg2, dataFIC);
>
> % -------------------------------------------------------------------------
>
> cfg3.zparam     = 'powspctrm';
> cfg3.xlim       = [0.050 0.300];
> cfg3.ylim       = [1 10];
> cfg3.layout     = 'testlay_64.lay';
> cfg3.showlabels = 'yes';
>
> multiplotTFR(cfg3, TFRhann)
>
> % -------------------------------------------------------------------------
>
> % cfg4 = [];
> % cfg4.channel   = 'FP1';
> % clf
> % % singleplotTFR(cfg4, TFRhann);
>
> ----------------------------------
> 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.
>



- - -
Carina Graversen
M.Sc. Biomedical Engineering, Ph.D. student
Aalborg hospital
+45 26282093
cgra05 at hst.auc.dk

----------------------------------
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