Skip to main content
  • Description
  • Detects burst on time-frequency transforms of EEG single trials. It ouputs informations in a text file and a TF (.detect.tf file containing the ratio of burst detection for each time and frequency.

  • Usage
  • tfdetect myeegfile.eeg myposfile.pos myparfile.par subsampling mode coef [+v]

    with :

    • myeegfile.eeg: input EEG file to process (with extension).
    • myposfile.pos: input event file (with extension).
    • myparfile.par: text file containing computation parameters (with extension).
    • subsampling: time subsampling factor applied to the TF file created. In all cases, the time sample corresponding to the event onset (0 msec) is kept.
      1 : all time samples are saved,
      2 : one over 2 samples are saved,
      3 : one over 3 samples are saved,
      ….
    • mode: threshold type. May be one the following values :
      1: adaptative threshold (threshold = baseline average + coef * baseline standard deviation) and bursts detection is done on half-value of the local maximum. The baseline is computed for each frequency.
      2: adaptative threshold (threshold = baseline average + coef * baseline standard deviation) and burst detection is done on threshold. The baseline is computed for each frequency.
      3: same as one, but marks in TF file, the first sample of the first detected burst only.
      4: adaptative threshold (threshold = coef * maximum value of baseline) and burst detection is done on threshold. The baseline is computed for each frequency.
      5: adaptative threshold (threshold = coef * maximum value of baseline) and burst detection is done on threshold. The baseline is computed on the frequencies sum.
    • coef: multiplier of the baseline standard deviation.
    • options:
      +v : verbose mode on: all events are displayed during the processing progress. If omitted, verbose mode is off.


  • Fields of parameter file and examples
  • fileprefix myfilename Prefix of the output TF 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 .avg.tf files.
    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).
    bl_threshold_start -300 -300 Baseline start latency (in ms). One value for each event code. The threshold is computed from the mean and standard deviation of the baseline.
    bl_threshold_stop -50 -50 Baseline stop latency (in ms). One value for each event code. The threshold is computed from the mean and standard deviation of the baseline.


  • Examples
  • tfdetect myeegfile.eeg myposfile.pos myparfile.par subsampling 1 2
    In this example, all trials with codes 2 or 5 will be processed with a time window ranging from from 400 samples prior to 1000 samples after event code. The time-frequency analysis will be performed for each single trials on channels 1, 2 and 4, from 18 to 80 Hz by steps of 2 Hz with a Blackman window having 100 samples for the rise- and for the fall-time, and with Morlet wavelets with a m ratio set to 7. The mean value and standard deviation of the baseline are computed from -300 to -50 ms.
    For each trial, the threshold of each frequency is : baseline_average + 2*baseline_sd .

    Output files:

    Name Comments#
    myfilename.2.detect.tf
    myfilename.5.detect.tf
    Ratio of burst detection for each time and frequency (100*number of bursts / number of events).
    myfilename.2.detect.txt
    myfilename.5.detect.txt
    Text file containing information for each burst detection. The first line is the column labels.
    Meaning of labels :
    event : event code
    chan : channel number
    trial : indice of trial (for event code event)
    freq : frequency (Hz)
    burst : indice of burst at this frequency for this trial and channel
    lat_start : start of burst latency (ms)
    lat_stop : end of burst latency (ms)
    dur : burst duration in (ms)
    Emax : burst maximum amplitude
    lat_max : latency of burst maximum amplitude
    Eavg : burst mean value
    Eavgbl : baseline mean value
    Ethreshold : threshold used
    freq1 : starting frequency
    freq2 : ending frequency
    peak : indice of peak (local maximum) in the burst
    Emax_bl : baseline maximum value
    fmax : frequency of the burst maximum amplitude


  • Comments
    1. Note to CTF 275 MEG users : an example of parameter file with 275 channels is available to download (ctf275_meg.par)
    2. See eegchref to create a re-referenced .eeg data file (several referencing options available).
    3. See an example of use Rols, G., Tallon-Baudry, C., Girard, P., Bertrand, O. and Bullier, J. Cortical mapping of gamma oscillations in areas V1 and V4 of the macaque monkey. Vis Neurosci, 2001, 18(4): 527-40.


  • Current version
  • 1.05 12-06-2012

  • History
    • 1.00 01-08-2001 (OB) : 1st documented version.
    • 1.01 17-06-2002 (PEA) : supports readpos function (from libpos).
    • 1.02 26-09-2003 (PEA) : changes EEG values process.
    • 1.03 01-12-2003 (PEA) : adds 32 bits EEG support.
    • 1.04 19-05-2011 (PEA) : removes static allocations. Update to use cmake and free release of Elan. Modifies baseline parameters to each event (instead one for all events).
    • 1.05 12-06-2012 (PEA) : minor modification : output file name creation.


  • Files
  • $ELANPATH/bin/tfdetect

  • See also
  • tfavg