Table of Contents

Common filters in beamforming

When you want to reconstruct and compare the sources of two (or more) conditions using a beamformer approach, you can either compute separate spatial filters for each condition, or use a common filter based on the combined conditions.

What are the advantages of common filters?

The main advantage of using common filters is that more data is used for constructing the spatial filters. The data of the conditions is appended, and the cross-spectral density matrix is based on this combined dataset. Generally, the more data is used in this step, the better the estimate, thus the more reliable the filters.
Another advantage is that you use the same filters for estimating the sources in both conditions. Differences in source activity can then be ascribed to power differences in conditions, not to differences between the filters.

When can you use common filters?

Common filters can be used when you want to compare conditions for which you assume the underlying sources are the same, but active to a different extent.
It is not a problem to have different amounts of trials in the conditions.
It is a requirement that the time windows in all conditions are of equal length.

How to do this in FieldTrip

In FieldTrip, common filters can be used both with the DICS and the PCC beamformer approach. If you are interested in calculating source reconstructed power, both methods can be used and will lead to similar results. PCC is faster but more memory-demanding, whereas DICS is slower but more memory-friendly. The choice of methods depends on personal preferences, your data (e.g. number of trials, number of tapers) and computer specs.

The general procedure is as follows:

calculate the cross-spectral density matrix of the combined conditions

compute the spatial filters

project all single trials through these filters

compute average for each condition (or do statistics)

Example code

Code for reconstruction of single trial data is incomplete

In the following, scripts for both approaches are presented.
Let’s say we have data for two conditions, condition A and B, and we assume that the same sources are active in both, but to a different extent.

We have the preprocessed data for both conditions (dataA and dataB) and we precomputed the grid and the volume conduction model (grid and vol). For more information on how to do this, have a look at the beamformer tutorial and the Fieldtrip functions ft_prepare_leadfield and ft_prepare_headmodel with method='singleshell'.