Computes from an EEG file the mean of the time-frequency powers obtained from each single-trial (mean squared modulus of the wavelet transform). The output is stored in TF file format (one .avg.tf file by event code). The stimulus phase-locking factor is also computed for each event code and stored in TF file format (one .pl.tf file by event code). An averaged EP file (.p) can be substracted to each single trial prior to time-frequency transform.
These computations requires a parameter file .par and an event position file .pos. Usually, the .pos file is the output of the averaging/rejection program eegavg [1].
tfavg myeegfile.eeg myposfile.pos myparfile.par subsampling [+v] [+ri] [+s] [+z] [+allchannels] [+noreref]
with :
1 : all time samples are saved,
2 : one over 2 samples are saved,
3 : one over 3 samples are saved,
….
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. |
baseline_msec_start -200 -200 | Required only for computing the Z-transform in .Z.avg.tf file (option +z in the command line); list of the baseline start latencies (in ms); one value for each event code. |
baseline_msec_stop -50 -50 | Required only for computing the Z-transform in .Z.avg.tf file (option +z in the command line); list of the baseline stop latencies (in ms); one value for each event code. |
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_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_substract_epfile ep.2.p ep.5.p | List of the EP file names with extension (.p) used for substracting an averaged response to each single trial prior to time-frequency computation (one string for each event code). These .p files should be compatible to the time-frequency analysis parameters (number of channels, number of samples pre and post-stimulus). If omitted, no .p file is substracted to the single trials. |
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 on channels 2 and 5, 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.Wavelet transform is performed on channels 1, 2 and 4; channel 1 is unchanged, channel 2 is re-referenced to channel 5, and channel 4 to channel 6.
Output files:
Name | Comments# |
myfilename.2.avg.tf myfilename.5.avg.tf |
Mean of the time-frequency power across single trials (event codes 2 and 5 in this example). |
myfilename.2.pl.tf myfilename.5.pl.tf |
Stimulus-phase-locking factor in the time-frequency domain computed across single trials (event codes 2 and 5 in this example). |
myfilename.2.avgr.tf myfilename.2.avgi.tf myfilename.5.avgr.tf myfilename.5.avgi.tf |
If option +ri: Normalized mean real and imaginery parts of the time-frequency transforms obtained over single trials (event codes 2 and 5 in this example). |
myfilename.2.avg2.tf myfilename.5.avg2.tf |
If option +s: Mean of the squared values of the time-frequency power across single trials (event codes 2 and 5 in this example). |
myfilename.2.Z.avg.tf myfilename.5.Z.avg.tf |
If option +z: Z-transform of the data with respect to the baseline computed on each single trial and averaged across trials (event codes 2 and 5 in this example). |
1.38 23-07-2014
$ELANPATH/bin/tfavg
Links:
[1] http://elan.lyon.inserm.fr/?q=eegavg
[2] http://elan.lyon.inserm.fr/?q=sites/default/files/ctf275_meg.par
[3] http://elan.lyon.inserm.fr/?q=eegchref
[4] http://elan.lyon.inserm.fr/?q=tfep
[5] http://elan.lyon.inserm.fr/?q=tfsync