Skip to main content
  • Description
  • Conversion tool for EDF (European Data Format) files to EEG format.

  • Usage
  • edf2eeg myEDF_file.edf myparfile myeegfile

    with :

    • myEDF_file.edf : EDF file to convert (with extension).
    • myparfile : text file containing conversion parameters (electrode names and numbers in elec.dat, rejected channels).
    • myeegfile : output EEG file (no extension).


  • Fields of parameter file and example
  • electrodes
    P1.21
    P2.22
    H1.1091
    H2.1092
    A1.225
    A2.226
    Status.-1
    Output channel name list :

    Names and numbers corresponding to elec.dat definition for converted channels, or name and -1 if the channel is not defined in elec.dat.

    The order and number of channels should be the same as in the input EDF file.
    reject_channel_nb 2 Channel list to reject (not converted). If omitted, all channel are converted.
    reject_channel_list 49 50 Number of channel to reject (not converted). This field is required if the field "reject_channel_nb" is present.


  • Example
  • An EDF file (trial.edf) has 4 channels. Channels 1-2 use a sampling frequency of 1000Hz, and channels 3-4 use 2000Hz.
    The first channels will be converted with the following parameter file (edf1000Hz.par) :
    electrodes
    chan1.-1
    chan2.-1
    chan3.-1
    chan4.-1
    reject_channel_nb 2
    reject_channel_list 3 4

    And the command line :
    edf2eeg trial.edf edf1000Hz.par trial.1000Hz

    The last channels will be converted with the following parameter file (edf2000Hz.par) :
    electrodes
    chan1.-1
    chan2.-1
    chan3.-1
    chan4.-1
    reject_channel_nb 2
    reject_channel_list 1 2

    And the command line :
    edf2eeg trial.edf edf2000Hz.par trial.2000Hz

    These 2 command lines will create the output files trial.1000Hz.eeg (and trial.1000Hz.eeg.ent) and trial.2000Hz.eeg (and trial.2000Hz.eeg.ent). Each one have only 2 channels (one with channels 1 and 2, and the other with channels 3 and 4).

  • Comments
    • Elan supports only one sampling frequency in an EEG file as EDF files may have different sampling frequencies per channel in one file. In this case, one may convert only channels with the same sampling frequency (see fields reject_channel_nb and reject_channel_list of the parameter file), and create as many Elan files as different sampling frequencies in the EDF file. See example above.
    • Elan converts only data. No event are stored in EDF file. Events may be added by converting event files to Elan event file (.pos).


  • Current version
  • 1.04 25-09-2015

  • History
    • 1.00 16-02-2010 (PEA) : first version.
    • 1.01 25-03-2010 (PEA) : fixes output data allocation.
    • 1.02 29-05-2012 (PEA) : fixes an error at beginning of data.
    • 1.03 20-07-2015 (PEA) : read and convert the annotation triggers (only annotations with numbers, no string).
    • 1.04 25-09-2015 (PEA) : fixes crash when no annotation triggers.


  • Files
  • $ELANPATH/bin/edf2eeg

  • See also