Concatenating TF from trials

Hello brainstorm developers,

I am using the following code to concatenate trials and create files for each channel:

% Process: Extract values: [all] 30-150Hz for Group A
FileA = bst_process('CallProcess', 'process_extract_values', GroupAFiles, [ ], ...
'timewindow', [ ], ...
'freqrange',  [30, 150], ...
'rows',       chan, ...
'isabs',      0, ...
'avgtime',    0, ...
'avgrow',     0, ...
'avgfreq',    0, ...
'matchrows',  1, ...
'dim',        1, ...  % Concatenate signals (dimension 1)
'Comment',    [GroupALabel ' HG: 30-150 Hz ' chan]);

The idea is to create files for each channel that contain all the trials in GroupA. I am also trying to preserve some metadata from the trials (specifically which session the trial was recorded on). I have that data elsewhere.

My question is: can I be confident that the order of the trials in FileA matches the order of the trials in GroupAFiles?

Thank you!

Best,

Dan

Hi Dan, that's correct the signals in the FileA follow the sequence of the files in GroupAFiles. Thus, each signal will have the name chan @ GroupAFiles(i).FileName

You can double-check this by:

  • Looking at value of the variable RowNames in the resulting TimeFreq,
    (right-click on the TimeFreq file, then File > View file contents), or

  • Plotting the time-series of the resulting TimeFreq file
    (right-click on the TimeFreq file, then Time series)