What is the function of the CMS and DRL electrodes. Ground, Reference or what ? 
BioSemi replaces the "ground" electrodes which are used in conventional systems with two separate electrodes:


  - Common Mode Sense (CMS) active electrode
  - Driven Right Leg (DRL) passive electrode.
These 2 electrodes form a feedback loop, which drives the average potential of the subject (the Common Mode voltage) as close as possible to the ADC reference voltage in the AD-box (the ADC reference can be considered as the amplifier "zero"), Click here for a picture showing the BioSemi "Zero-ref" setup.
The CMS/DRL loop has extra functions, which are not easily realized with a single standard Ground electrode:


Because of the feedback loop, the effective impedance of the DRL electrode is decreased with a factor of 100 at 50 Hz. This results in a 40 dB extra CMRR at 50 Hz when compared with using normal Ground electrodes with the same impedance.
2) The DRL electrode is the only current return path between the subject and the AD-box. The return current is limited electronically at 50 uA. This protects the subject against excessive flow of currents due to amplifier and/or electrode defects. In addition, the circuit provides an indication (blue LED off) indicating whether such an error condition has occurred
With BioSemi systems, every electrode or combination of electrodes can be the "reference"; the choice is made entirely in software. When no reference is selected in software, the signals are displayed with respect to the CMS electrode. This mode does not provide the full CMRR, and should only be use as a quick check of the electrodes. Only after a reference is selected, the full 80 dB CMRR is achieved.
Usual EEG reference selections are:


1 electrode on top of the head. (Cz)
- Average between electrodes on the two ears.
- Average of all connected electrodes.
- Bipolar leads between adjacent electrodes..
Usual ECG reference selections are:


Wilson Central Terminal (WCT), defined as the average between Left-Arm, Right-Arm and Left-Leg electrodes

The signals on file are the voltages between each electrode and CMS. These raw signals on file, still contain some CM signal (50 Hz, ADC reference noise, etc.). This CM signal cancels after a further subtraction step. It is important to realize that our front-end digitizes the EEG signal AND the common mode. The common mode is rejected by subtracting digital data. Thus, the signals are treated fully differential all the way, from electrode to digital output. This is different form many other systems where the subtraction step is made with analog circuitry before the ADC. One of the advantages our method is that noise and drift on the (common) ADC reference voltage can be eliminated too.
Suppose, for example, that you want to use the signals with respect to Cz for your further source estimation calculations. In that case. You simply subtract the signal in the Cz channel from all other channels. This generates a new array of data (with one channel less of course) that you can use for further analysis.
When the CMS electrode is located near Cz (which it usually is) the extra subtraction step in the example above (choosing Cz as a Reference) won't have much influence on the EEG part of the signals. However it will decrease the CM interference part of the signals.
Example: the BDF file contains data like:
  Channel 1 (Oz) = 110uV (Both Oz and Cz contain 50Hz Common Mode. In the BDF file there is no
  Channel 2 (Cz) = 101uV information about the amount of CM. In this example we suppose it is 100uV)
 From this you can calculate the voltage between Oz and Cz:
Oz - Cz = 110uV - 101uV = 9 uV of clean EEG signal (without 100 uV of 50 Hz and other noise)
In this example, the Cz and CMS are close together, and only 1 uV of EEG is present between them. But, when the recording is made in a shielded room, the amount of CM in the raw signals would be very small, and the extra subtraction step wouldn't make much difference. However, in a normal situation with some residual CM mode signal present, the subtraction in software is essential.

It would of course be possible to do referencing calculations online during acquisition (which we actually do for the signals displayed on screen during acquisition), and also stream the signals to BDF file in referenced form. But we choose not to do this because you loose information (the magnitude of the CM, and the offset value(s) of the reference electrode(s)) and flexibility (so long as CMS and DRL are OK, any problem electrode can be dropped from the calculations afterwards)