[FieldTrip] plotting differences in power spectrum

Lam, N.H.L. (Nietzsche) n.lam at fcdonders.ru.nl
Thu Sep 12 15:53:14 CEST 2013


Hi Keith,

In addition, it is helpful for future questions if you include a display of the fields in your data structure.  As Izabela pointed out, it looked lke you were missing all the other necessary fields in order for ft_multiplotTFR to recognise the data as freq data:

e.g., on the fieldtrip website we show the data as follows:

TFRhann = 

        label: {149x1 cell}
       dimord: 'chan_freq_time'
         freq: [2 4 6 8 10 12 14 16 18 20 22 24 26 28 30]
         time: [1x41 double]
    powspctrm: [149x15x41 double]
    cumtapcnt: [77x15 double]
         grad: [1x1 struct]
          cfg: [1x1 struct]

Best,
Nietzsche 

----- Original Message -----
> From: "Izabela Mikula" <Izabela.Mikula at mpi.nl>
> To: "FieldTrip discussion list" <fieldtrip at science.ru.nl>
> Sent: Thursday, 12 September, 2013 3:48:56 PM
> Subject: Re: [FieldTrip] plotting differences in power spectrum
> Hi Keith,
> 
> The diff object that you created only contains powspctrm field, so it
> doesn't have freq data structure anymore.
> I would suggest using:
> 
> cfg=[];
> cfg.operation='subtract'
> cfg.parameter = 'powspctrm';
> diff=ft_math(cfg, data1,data2)
> 
> Hope that helps.
> 
> Best,
> Izabela
> 
> -----Original Message-----
> From: fieldtrip-bounces at science.ru.nl
> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of McConnell, Keith
> Sent: Thursday, September 12, 2013 3:05 PM
> To: FieldTrip discussion list
> Subject: Re: [FieldTrip] plotting differences in power spectrum
> 
> Thank you Nietzsche for your kind offer of help.
> 
> First, to your aside, I am trying to use ft_multiplotTFR. Sorry for my
> lack of clarity.
> 
> Now to the matter: I have calculated the power spectrum for each level
> of stimulus intensity using ft_freqanalysis(cfg, data1) and
> ft_freqanalysis(cfg, data2). The result is a 3D double precision array
> arranged (#ChannelsX#FrequencyBinsX#TimeBins).
> 
> 
> I then calculate the difference using
> 
> for i = 1:NUMBER_CHANNELS
> diff(i,:)=(data1.powspctrm(i,:))-(data2.powspctrm(i,:));
> end
> 
> The result is a 2D double precision array with the form of
> (#ChannelsX(the product of the number freq bins and the number of time
> bins))
> 
> So, I guess that my problem is that I've gone from a 3D array to a 2D
> array in the course of the subtraction. I am not sure how to correct
> this error.
> 
> Thanks again for the help.
> 
> Keith
> 
> Keith McConnell, M.S.
> 
> 513.636.0739 (desk)
> 513.504.9907 (cell)
> 
> Division of Pulmonary Medicine
> Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229
> 
> 
> -----Original Message-----
> From: fieldtrip-bounces at science.ru.nl
> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Lam, N.H.L.
> (Nietzsche)
> Sent: Thursday, September 12, 2013 5:25 AM
> To: FieldTrip discussion list
> Subject: Re: [FieldTrip] plotting differences in power spectrum
> 
> Hi Keith,
> 
> I could try to help you (this will be more first attempt with this
> mailing list...!) Could you provide more information about how you
> calculated the difference between the two spectra, and precisely what
> 'freq' (your difference spectra) looks like when you feed it as an
> argument into ft_multiplotTFR?
> 
> As a side, I'm aware that there is ft_multiplotXX, where XX can be
> replaced with "CC", "ER", "TFR", but I haven't seen a function with
> the name "ft_multiplot" on its own.
> 
> Best,
> Nietzsche
> 
> ----- Original Message -----
> > From: "Keith McConnell" <Keith.McConnell at cchmc.org>
> > To: fieldtrip at science.ru.nl
> > Sent: Wednesday, 11 September, 2013 7:48:43 PM
> > Subject: [FieldTrip] plotting differences in power spectrum Hello,
> >
> >
> >
> > I have an MEG experiment in which I expect my stimulus to incite
> > multiple reactions. I have run the experiment so that the stimulus
> > is
> > applied at two different intensities. I would like to use the lower
> > intensity stimulus response as a 'mask' for the higher intensity
> > response.
> >
> >
> >
> > I can calculate the power spectrum for both intensities and find the
> > difference.
> >
> >
> >
> > Although I can generate an ft_multiplot for each individual power
> > spectrum, I cannot generate a ft_multiplotTFR of the difference
> > between the two spectra.
> >
> >
> >
> > I get the following error messages:
> >
> >
> >
> > Error using ft_checkdata (line 366)
> >
> > This function requires freq data as input.
> >
> >
> >
> > Error in ft_multiplotTFR (line 135)
> >
> > data = ft_checkdata(data, 'datatype', 'freq');
> >
> >
> >
> > Can anyone provide some help?
> >
> >
> >
> > Thanks,
> >
> >
> >
> > Keith
> >
> >
> >
> > Keith McConnell, M.S.
> >
> >
> >
> > 513.636.0739 (desk)
> >
> > 513.504.9907 (cell)
> >
> >
> >
> > Division of Pulmonary Medicine
> >
> > Cincinnati Children's Hospital Medical Center
> >
> > Cincinnati, OH 45229
> >
> >
> > _______________________________________________
> > fieldtrip mailing list
> > fieldtrip at donders.ru.nl
> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> 
> --
> Nietzsche H.L. Lam, MSc
> PhD Candidate
> 
> Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD
> Nijmegen, The Netherlands
> 
> Donders Institute for Brain, Cognition and Behaviour, Centre for
> Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The
> Netherlands
> 
> n.lam at fcdonders.ru.nl
> +31-24-3668219
> 
> 
> neurobiologyoflanguage.com
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> 
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

-- 
Nietzsche H.L. Lam, MSc 
PhD Candidate 

Max Planck Institute for Psycholinguistics 
Wundtlaan 1, 6525 XD Nijmegen, The Netherlands 

Donders Institute for Brain, Cognition and Behaviour, 
Centre for Cognitive Neuroimaging, 
Kapittelweg 29, 6525EN Nijmegen, The Netherlands 

n.lam at fcdonders.ru.nl 
+31-24-3668219 


neurobiologyoflanguage.com 



More information about the fieldtrip mailing list