Skip to main content
  • Description
  • Computes mean or max values on time-frequency transformed single trials of an EEG file in time-frequency windows (output in a text file).


  • Usage
  • tfmval myeegfile.eeg myeventfile.pos myparfile.par [windows_file.tf.wnd]

    with :

    • myeegfile.eeg : input EEG file name (with extension) to read and transform.
    • myeventfile.pos : input event file (with extension) used to define single trials.
    • myparfile.par: text file containing computation parameters (with extension).
    • options:
      windows_file.tf.wnd : text file describing the windows. If omitted, windows will be created from parameter file (myparfile.par).
    • .


  • Fields of parameter file and example
  • fileprefix myfilename Prefix of the output files.
    nb_eventcode 2 Number of event codes to process.
    list_eventcode 2 5 List of the event codes to process.
    prestim_nbsample 400 400 List of the numbers of samples in the prestimulus period; one value for each event code.
    poststim_nbsample 1000 1000 List of the numbers of samples in the poststimulus period; one value for each event code; the total number of samples of the analysis is prestim_nbsample + poststim_nbsample + 1, the extra sample corresponds to the event itself.
    tf_channel_flag 1 1 0 1 0 0 0 List of the channels to process: 1/0 for selected/unselected channels; the total number of flags is N+2, N being the number of recorded channels in myeegfile.eeg file; the last 2 flags should be set to 0.
    In this example, N=5, and only channels number 1, 2, 4 will be processed and stored in the output files.
    tf_channel_ref 0 3 0 5 0 0 0 List of the new reference for each channel before processing (bipolar montage for instance):
    0: no change of the reference,
    ≠0: electrode number (rank) to which the current channel should be re-referenced.
    The total number of values is N+2, N being the number of recorded channels in myfile.eeg file; the last 2 flags should be set to 0.
    If omitted, the channels are not modified.
    In this example, N=5, and channel 1 is unchanged, channel 2 is referenced to channel 3, and channel 4 re-referenced to channel 5.
    tf_freq_start 18 18 List of the starting frequencies (in Hz) for the time-frequency analysis (one value for each event code).
    tf_freq_stop 80 80 List of the ending frequencies (in Hz) for the time-frequency analysis (one value for each event code).
    tf_freq_step 2 2 List of the frequency steps (in Hz) for the time-frequency analysis (one value for each event code).
    tf_nb_sample_blackman 100 100 List of the number of samples in the rise or fall time period of the blackman window applied on the single trials before the wavelet transform (one value for each event code).
    tf_wavelet_type 1 1 List of the types of wavelet used for the time-frequency analysis (one value for each event code):
    1: Morlet wavelet.
    2: Gabor wavelet.
    tf_morlet_m 7 7 In case of Morlet wavelet, list of the m ratio used for the time-frequency analysis (one value for each event code): m=f0/sigmaf
    Suggested values for m: m>5, usually m=7.
    This determines the number of cycles of the wavelet.
    tf_gabor_sigmat 100 100 In case of Gabor wavelet, list of the half-window durations of the wavelets (in msec) irrespective of the frequency band (one value for each event code).
    tf_flag_log 0 Flag to compute log10 of power. Possible values are :
    1 : compute log10(power).
    0 : compute power.
    This field is optionnal. If omitted, power is computed.
    tfmval_freq_hw 6 Frequency half window (Hz).
    tfmval_freq_step 12 Frequency step (Hz).
    tfmval_time_hw 50 Time half window (ms).
    tfmval_time_step 100 Time step (ms).

    These parameters are specific to time-frequency window definition with parameter file. A window file (.tf.wnd) is also created. This file can be used for further computation as input window file.
    In case of use of a window file (windows_file.tf.wnd), omit these fields, and create a text file as below :

    wnd_nb 2 Number of windows.
    wnd_list
    500 1000 9 12
    1500 2000 9 12
    Window description list : a window is defined by 4 values (on one line) :
    - start latency (ms).
    - stop latency (ms).
    - start frequency (Hz).
    - stop frequency (Hz).
    In this example, the 1st window is [500; 1000] ms and [9-12] Hz, and the 2nd window is [1500; 2000] ms and [9-12] Hz.
    wnd_label_list
    part1 10
    part2 10
    Label list (columns title in the results text file) : there is 2 labels for each window :
    - time label.
    - frequency label.
    In this example, the 1st window has "part1" for time label, and "10" for frequency label, and the 2nd window has "part2" for time label, and "10" for frequency label.

    Output file :
    The output file is a text file containing data extracted for each window in each signle trial.
    With the above parameters, a file myfilename.mval.tf.txt is created.
    The 1st line contains the title of each column :
    file_prefix event_code trial_number channel_number f t f_label t_label mean_value min_value t_min_value f_min_value min_on_border max_value t_max_value f_max_value max_on_border

    The following lines contain data corresponding to each columns.

  • Examples

  • Comments
    1. In output file, the "channel_number" columns refers to the indice of the channel in the EEG file.


  • Current version
  • 1.09 15-02-2011

  • History
    • 1.01 18-09-2002 (PEA) : 1st documented version.
    • 1.02 27-02-2003 (PEA) : changes output file extensions, frees memory.
    • 1.03 26-09-2003 (PEA) : changes in physical values of EEG.
    • 1.04 08-01-2004 (PEA) : adds 32 bits EEG support.
    • 1.05 13-08-2007 (PEA) : minor modification.
    • 1.06 15-02-2010 (PEA) : adds tf_flag_log field to compute log of power.
    • 1.07 25-03-2010 (PEA) : fixes log error : using log10f instead of logf.
    • 1.08 26-03-2008 (PEA) : fixes problem with float mathematical functions (using log10 instead of log10f).
    • 1.09 15-02-2011 (PEA) : updates to use cmake and free release of Elan. Fixes time limit problem.


  • Files
  • $ELANPATH/bin/tfmval

  • See also
  • tfavg, tfavgval, eegmval