Problems with frequency analysis...
jan-mathijs schoffelen
j.schoffelen at PSY.GLA.AC.UK
Thu Jun 12 14:23:10 CEST 2008
Hi Carina,
I'm not a wavelet expert, but the cfg.width specification looks a bit
odd to me.
I would expect this to be an integer number, specifying the number of
oscillation-cycles at each frequency.
Irrespective of this, you might want to generate different surrogate
data in the first place:
the data segments are only 0.3 seconds long. This means that you can
only optimally fit
frequencies of multiples of 1/0.3, so 3.33333, 6.666667 etc. It only
makes sense to try to estimate low frequency
data, if the data segments are really long (and according to your
specification this would be at least 20 seconds).
Yours,
Jan-Mathijs
On Jun 12, 2008, at 2:17 PM, Carina Graversen wrote:
> 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.
----------------------------------
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