[FieldTrip] Difference wave calculation

Eelke Spaak eelke.spaak at donders.ru.nl
Tue Jun 19 09:06:37 CEST 2012


Hi Peter,

In that case, welcome to the Fieldtrip list :) Actually, I think your
approach of calculating a difference between event-related activities
is pretty much the recommended standard way. So:

cfg = [];
tl1 = ft_timelockanalysis(cfg, data1);
tl2 = ft_timelockanalysis(cfg, data2);

tlDiff = tl1;
tlDiff.avg = tl1.avg - tl2.avg;

Of course, this is assuming all trials have the same time axis. And
also, if needed, you can change the configuration to whatever is
appropriate for your data.

One note of caution: while the above is perfectly valid for the
averages, you cannot simply subtract the variances from eachother, and
expect to end up with the variance of your difference wave. I had to
refresh my memory, but wikipedia tells me that the variance of two
random variables subtracted from each other is equal to the variances
added, minus twice the covariance between them.

Best,
Eelke

On 19 June 2012 01:51, Peter Goodin <PGOODIN at groupwise.swin.edu.au> wrote:
> Hi Fieldtrip list,
>
> I'm quite new to using Fieldtrip for analysis and can't find any information
> on how to create difference waves, for example to examine MMN activity.
> Currently I've just been making a new structure and adding items from the
> ft_timelockedanalysis function, subtracting the standard from the deviant
> for the .avg and .var fields while keeping the rest intact.
>
> Are there any tutorials available that can show me the recommended way to go
> about this? Alternatively, can anyone working with difference waves give an
> example of how they calculate them?
>
> Thanks,
>
> Peter.
>
>
>
> Peter Goodin
> Ph.D Candidate
> Brain and Psychological Research Centre (BPsyC)
> Swinburne University of Technology
> 400 Burwood Road, Hawthorn, VIC 3122
>
> Monash Alfred Psychiatric Research Centre (MAPrc)
> Alfred Hospital
> Level 1, Old Baker Building,
> Vic 3008
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip



More information about the fieldtrip mailing list