**File**: CreateDesignMatrixWithDCT.js (zipped)

**Description**: Script for generating a single-study/run design matrix with addition to generate DCT confound predictors.

**Explanation**: By default, 5 confound predictors are generated. The weights should be automatically adapted to the length of the time course, since the script uses the "NrOfVolumes" property. For each number of DCT basis functions, the cosine functions in BrainVoyager always seems to start with a cosine function of 0.5 period (where a full period is 2 * pi), adapted to the length of the time course, and increases with steps of 0.5. So the next basis function would be 1 period (1 * 2 pi), then 1.5, then 2.0, then 2.5, etc. In the script code below the periods of the 5 functions are declared in an array as:

var periods = [0.5, 1, 1.5, 2, 2.5];

For more basis functions, just add multiples of 0.5 to the array (3.0, etc). In case less basis functions are preferred, just remove the largest one(s). Also, please check the paragraph "Some elaboration on design matrix properties" in the Scripting Reference Manual for setting predictors of interest vs. confounds in a script.

For information about DCT confound predictors and high-pass filtering in BrainVoyager, see the User's Guide:

**File**: Other version of script (without generating predictors for example data): designmatrix_with_dct_basis_functions.js (zipped)

*Figure: basis functions in single-subject design matrix (*.sdm) generated by 2nd script*

*Latest change: 09-08-13*

< Prev | Next > |
---|