beamforming: length of data pieces

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Wed Apr 19 17:25:32 CEST 2006

Hi Daniel,

On 19 Apr 2006, at 16:42, Daniel Jokisch wrote:
> I am localizing oscillatory sources using beamforming. When
> comparing the activation in the prestimulus to the activation in
> the poststimulus interval I was wondering if the data pieces must
> have the same length.
> A prerequisite is that the length of a data piece must have the
> length of a fix number of oscillatory cycles. Is it theoretically
> possible to compare activation in a prestimulus interval to
> activation in a poststimulus interval which is twice as long as the
> prestimulus interval?

It is possible to compare different lengths, but a direct comparison
is not valid, or at least difficult: 1) the frequency resolution in
the longer segment (either before or after the stimulus) is higher,
resulting in a different amount of spectral bleeding/leakage. 2) the
amount of data in the longer segment is higher, resulting in a better
estimation of your signal compared to the noise. If you fit a sine
wave to a twice-as-long segment, it will be less affected by noise.

So if the direct comparison between the two shows a difference, that
difference can be (trivially) explained by different frequency
resolutions or amounts of noise. You can try to compensate for the
amount of noise by comparing the neural activity index (beamed power
divided by estimated beamed noise), but that does not solve the
different frequency resolutions. You could compensate the difference
in frequency resolution by splitting the long post-stimulus interval
in two sections, and estimate the power on each of them and average
(i.e. you would have twice as many trials), which is a simplified
version of Welch power estimate with no overlap.

So there are tricks available with which you can make the comparison
less problematic, but they are not nice. Also a statistical
comparison using a parametric or non-parametric (randomization) tests
would be messy. So I suggest to sacrifice some of your post stimulus
data to make the intervals equally long. Alternatively, a better idea
is to use a time-frequency decomposition over the whole interval, and
compare each post-stimulus TFR frame to the single pre-stimulus TFR
frame. That could be done in a methodologically and statistically
clean comparison.

> A second question concerns the averaging over the same subjects in
> different recording sessions (meaning that there are two sets of
> headlocalization parameters and two headmodels for the same
> subject). Is it necessary to normalize the data before using the
> function sourcegrandaverage or can I use directly the output of the
> function sourceanalysis as input for sourcegrandaverage?

No, you want to spatially normalize your functional data before
averaging. The averaging is done on the same voxel over subjects,
therefore you want voxel (i,j,k) in subject 1 to correspond
anatomically with voxel (i,j,k) in subject 2. See

best regards,

More information about the fieldtrip mailing list