Common Average reference - excluding channels

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Wed Jul 29 11:12:12 CEST 2009


Hi Martin

On 24 Jul 2009, at 11:14, Martin Bleichner wrote:
> I want to compute the common average reference for an ecog dataset.
> But I have to exlude some of the channels due to epileptic activity.
> I am currenlty using the code below. Do I have to specify the
> channels I would like to include in my CAR in cfg.channels or in
> cfg.refchannel?

You would specify the channels that you want to average over in
cfg.refchannel. The average of those channels will subsequently be
subtracted from cfg.channel (which defines the channels on which the
preprocessing function works).

So

cfg.channel = {'EEG1020', 'M1', 'M2'}
cfg.refchannel = {'M1', 'M2'}

would result in a linked ears reference, and

cfg.channel = 'EEG1020'
cfg.refchannel = 'EEG1020'

would result in an average over all EEG1020 channels. Note that the
channels to which you want to reference should be included in
cfg.channel. For EEG data files the reference channel usually is not
included in the file (because it is zero anyway). If the reference
used during recording is a mastoid, and you want to refer to both
mastoids, you can add the implicit reference as all zeros and define
its name with the cfg.implicitref option.

The documentation at
   http://fieldtrip.fcdonders.nl/example/re-referencing
and
   http://fieldtrip.fcdonders.nl/tutorial/continuous
contains more examples for rereferencing.

best regards,
Robert

-----------------------------------------------------------
Robert Oostenveld, PhD
Senior Researcher
Donders Institute for Brain, Cognition and Behaviour
Centre for Cognitive Neuroimaging
Radboud University Nijmegen
-----------------------------------------------------------


>
> Thanks a lot
> Martin
>
> cfg=[];
> cfg.trackconfig='cleanup';
>
> %compute common average reference
> cfg.channels=ch_in_avref;
> cfg.reref='yes';
> cfg.refchannel='all';
>
> %filter out the line noise using bandstop filter
> cfg.bsfilter='yes';
> cfg.bsfiltord=3;
> cfg.bsfreq=[49.5 50.5; 99.5, 100.5];
>
>
> data=preprocessing(cfg,data);
> ----------------------------------
>
> The aim of this list is to facilitate the discussion between users
> of the FieldTrip toolbox, to share experiences and to discuss new
> ideas for MEG and EEG analysis.
>
> http://listserv.surfnet.nl/archives/fieldtrip.html
>
> http://www.ru.nl/fcdonders/fieldtrip/
>

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.



More information about the fieldtrip mailing list