Units powspctrm

Martin Bleichner bleichner.martin at GMAIL.COM
Mon Aug 16 12:46:14 CEST 2010


Hi Arijen,

my question simply was how I can get the actual difference in microvolt
between two signals when using fieldtrip.
I now have a prtty good idee how to do that.

Thanks
Martin


2010/8/16 a.stolk at fcdonders.ru.nl <a.stolk at fcdonders.ru.nl>

> Hi Martin,
>
> I'm not exactly sure what your question is but I just simulated your
> example with the following:
>
> % simulate one second of data, samplefreq = 512 hz
> fs = 512;
> t = (1:fs)/fs;
> a = sin(2*pi*20*t);
> b = 2*sin(2*pi*20*t); % twice the amplitude
> figure; plot(t,a);
> hold on; plot(t,b,'r');
> hold off;
>
> % simulate preprocessed data
> cfg           = [];
> cfg.layout    = 'CTF275.lay';
> cfg.layout    = prepare_layout(cfg);
> data.label    =  cfg.layout.label(1:273,1);
> data2.label   = data.label;
> data.fsample  = fs;
> data2.fsample  = data.fsample;
> for j = 1:273
>    data.trial{1,1}(j,:) = a;
>    data.time{1,1}(j,:)  = t;
>    data2.trial{1,1}(j,:) = b;
>    data2.time{1,1}(j,:)  = t;
> end
>
> % ft_freqnalysis_mtmfft
> cfg              = [];
> cfg.output       = 'pow';
> cfg.channel      = 'MEG';
> cfg.method       = 'mtmfft';
> cfg.taper        = 'rectwin';
> cfg.foilim       = [1 40];
> cfg.keeptrials   = 'no';
> cfg.keeptapers   = 'no';
> mtmfft           = ft_freqanalysis(cfg, data);
> mtmfft2          = ft_freqanalysis(cfg, data2); % four (2^2) times the
> power
>
> figure; plot(mtmfft.powspctrm(1,:));
> hold on; plot(mtmfft2.powspctrm(1,:),'r');
>
> Notice that I used a rectangular window in stead of the hanning taper. One
> of the features of the Hanning taper is that it cuts off the ends of a
> window. It, therefore, is much more difficult to make a prediction about the
> scaling.
>
> I'm not sure if this has satisfied you but it's the most I can do. For more
> information of fft, have a read on
> http://fieldtrip.fcdonders.nl/tutorial/fourier
>
> Best regards,
> Arjen
>
> ----- Original Message -----
> From: "Martin Bleichner" <bleichner.martin at GMAIL.COM>
> To: FIELDTRIP at NIC.SURFNET.NL
> Sent: Monday, August 16, 2010 10:46:15 AM GMT +01:00 Amsterdam / Berlin /
> Bern / Rome / Stockholm / Vienna
> Subject: Re: [FIELDTRIP] Units powspctrm
>
> Hi Arjen,
>
> my point is that I am interested not in the relative difference between
> signals but in the actual difference in microvolt. I know that this is not
> the standard thing to do but that is what I need .
>
> After playing aroud a bit i come to the following conlcusion
>
> Lets say I have two signals (pure sine 20 Hz; sampling freq 512) one with
> an
> amplitude of 100uV and one with an aplitude of 200uV.
> Computing a power spectrum using matlab fft function I can eventually  read
> out that the difference between my two signals is 100uV.
>
> In ft_freqanalysis_mtmfft the signal is multiplied by a taper
> line 340 dum=fft([data.trial{perlop}(sgnindx(sgnlop),:).*tap(taplop,:)
> pad],[],2);
>
> The output can hence not be transformed back right away to the real
> microvolt values, but happens to be scaled (in my case ) by a factor of
> ~0.036 (which is the mean value of the taper)
>
> At least that is what I think happens.
>
> Regards
> Martin
>
>
>
>
>
> 2010/8/13 a.stolk at fcdonders.ru.nl <a.stolk at fcdonders.ru.nl>
>
> > If you use the same mtmfft settings for both conditions, in theory it
> > should be fine. Make sure that you compute the fourier transformation on
> > equal window lenghts.
> >
> > If you happen to have variable triallengths per condition, my suggestion
> > would be to cut the trials in (e.g.) 1 second pieces. This way your
> > 'frequency resolution' is the same for condition A and B.
> >
> > If your experimental setup allows you, you could choose to normalize your
> > data (e.g. a baselinecorrection) first before making the A and B
> comparison.
> > This way you correct for (non-)cognitive powerchanges over time (case
> it's
> > not an ABABABAB etc. design). Such as conductivity reducal of the EEG
> paste
> > over time, subject habituation effects and whatelse you have.
> >
> > Best,
> > Arjen
> >
> >
> >
> >
> > ----- Original Message -----
> > From: "Martin Bleichner" <bleichner.martin at GMAIL.COM>
> > To: FIELDTRIP at NIC.SURFNET.NL
> > Sent: Thursday, August 12, 2010 10:48:14 PM GMT +01:00 Amsterdam / Berlin
> /
> > Bern / Rome / Stockholm / Vienna
> > Subject: Re: [FIELDTRIP] Units powspctrm
> >
> > Yes, typically, but is it the case for the powspctrm you get from the
> > mtmfft
> > freqanalysis?
> > I am asking for the following reason:
> >
> > Lets say, I have two experimental conditions  A and B and I compute the
> > powerspectra for both of them.
> > When the units actually are uV^2/Hz i could tell for each frequency by
> how
> > much uV A and B differ.
> >
> > What confuses me is that in
> > ft_freqanalysis_mtmfft<
> > http://fieldtrip.fcdonders.nl/reference/ft_freqanalysis_mtmfft>the
> > signal is multiplied with a taper (tap) and thereby scaled.
> > The resulting powspctrm hence does  not reflect the the true changes in
> > microvolt.
> > Do I see that correctly, or am I missing something here? Is the
> > powerspectrum corrected for that somewhere else?
> >
> > Regards,
> > Martin
> >
> >
> >
> > 2010/8/12 a.stolk at fcdonders.ru.nl <a.stolk at fcdonders.ru.nl>
> >
> > > Hello Martin,
> > >
> > > A powerspectrum typically has the frequencies on one axis and the power
> > of
> > > the corresponding frequencies on the other. The power represents how
> > strong
> > > a certain frequency occurs in a signal, given by the square of the
> > voltage
> > > per frequency.
> > >
> > > In your case: square of the microvolts per frequency: uV^2/ Hz
> > >
> > > Best regards,
> > > Arjen
> > >
> > > ----- Original Message -----
> > > From: "Martin Bleichner" <bleichner.martin at GMAIL.COM>
> > > To: FIELDTRIP at NIC.SURFNET.NL
> > > Sent: Thursday, August 12, 2010 5:52:19 PM GMT +01:00 Amsterdam /
> Berlin
> > /
> > > Bern / Rome / Stockholm / Vienna
> > > Subject: [FIELDTRIP] Units powspctrm
> > >
> > > Hello together,
> > >
> > > What units does the powspctrm have?
> > > Starting with an EEG signal in microvolts and computing the
> powerspectrum
> > > using freqanalysis what are the units of powspctrm?
> > > I tried to figure it out on my own but I am stuck somehow.
> > >
> > > Here some example code
> > >
> > > cfg=[];
> > > cfg.method='mtmfft';
> > > cfg.output='pow';
> > > cfg.pad ='maxperlen'
> > > cfg.foilim=[1 130]
> > > cfg.taper='hanning'
> > > cfg.channel=1
> > > cfg.keeptrials='no'
> > >
> > > R=ft_freqanalysis(cfg,data);
> > >
> > > I am interested in the units of R.powspctrm
> > >
> > > Thanks
> > > Martin
> > >
> > > ----------------------------------
> > > 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/neuroimaging/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/neuroimaging/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/neuroimaging/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/neuroimaging/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/neuroimaging/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/neuroimaging/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/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100816/a253b735/attachment-0002.html>


More information about the fieldtrip mailing list