# [FieldTrip] plotting differences in power spectrum

McConnell, Keith Keith.McConnell at cchmc.org
Thu Sep 12 15:05:22 CEST 2013

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

```