Skip to main content
  • Description
  • Performs a statistical analysis of the time-frequency representation of single-trials between 2 conditions, with randomization.
    The False Detection Rate (FDR) procedure is possible on the statistical results (see comments).

  • Usage
  • tfcmppower myeegfile.eeg myeventfile.pos myparfile.par subsampling nb_drawings

    with :

    • myeegfile.eeg : input EEG file name (with extension).
    • myeventfile.pos : event position file (with extension) (this is usually the output pos file of eegavg, after artifact rejection).
    • 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,

    • nb_drawings : number of drawings that are made to estimate the distribution of differences under the null hypothesis (example: 10000 drawings enables a resolution of p=0.0001).

  • Fields of parameter file and example
  • fileprefix myfilename Prefix of the output TF file.
    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.
    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 10 10 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).
    tfstat_flag_fdr 0 Flag allowing to compute False Detection Rate (FDR) after the statistical test:
    0: no FDR computation
    1: FDR computation, and generation of a TF file with a mask of the statistical results with the computed FDR (see output files below). This requires a probability (p) threshold value (tfstat_threshold_fdr).
    If omitted, the default value is 0.
    tfstat_threshold_fdr 0.05 To be used in case of tfstat_flag_fdr = 1.
    Defines the probability (p) threshold value to be used for masking the statistical results by the threshold FDR statistics.

  • Examples
  • tfcmppower myeegfile.eeg myeventfile.pos myparfile.par 1 1000
    In this example, all trials with codes 2 and 5 be processed with a time window ranging from 400 samples prior to 1000 samples after event code. The time-frequency analysis will be performed on channels 1 (not re-referenced), 2 (re-referenced to channel 3),and 4 (re-referenced to channel 5), from 10 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. All samples are saved to output file. The program performs 1000 randomizations of the 2 conditions.

    Output file : (if FDR applied)

  • Comments
    1. This program works with 2 conditions. The computing parameters (the frequencies, number of samples pre and post-stimulus, wavelet parameters) must be the same for the 2 conditions.
    2. tfstat_flag_fdr : This option allows to compute the False Detection Rate statistics after a Wilcoxon or a Kruskal-Wallis test. This is a possible solution for multiple testing problem. See: Genovese, C. R., N. A. Lazar, et al. (2002). "Thresholding of statistical maps in functional neuroimaging using the false discovery rate." Neuroimage 15(4): 870-8.

  • Current version
  • 1.06 12-06-2012

  • History
    • 1.00 01-08-2001 (CTB/OB) : 1st version.
    • 1.01 17-06-2002 (PEA) : changes event file reading.
    • 1.02 26-09-2003 (PEA) : changes in physical values of EEG.
    • 1.03 01-12-2003 (PEA) : adds 32 bits EEG support.
    • 1.04 04-04-2011 (PEA) : updates to use cmake and free release of Elan. Fixes memory allocations. Optimizes memory allocation and loops. Adds FDR correction.
    • 1.05 15-04-2011 (PEA) : changes Shell sort to Heap sort in FDR (faster algorithm).
    • 1.06 12-06-2012 (PEA) : minor modification : output file name creation.

  • Files
  • $ELANPATH/bin/tfcmppower

  • See also
  • tfavg, tfstat, tfcmpsync