Specifying Epochs within GLM process

Hello! I am running a GLM analysis on fNIRS data and have a question about setting stimuli duration and establishing baseline. The chunks of data + stimuli to be analyzed are 10 seconds long. I have been setting my stimuli duration in the design matrix to 10 seconds. However, I would also like to capture a snippet of the baseline state about 2 seconds before the stimuli onset. I can do this easily with block averaging but is there a way to do this within the design matrix for the GLM function? I appreciate any insight or help, thanks so much!

  • NE version: e.g. 1.6.1
  • operating system: Windows 10
raw_haemo = beer_lambert_law(raw_od, ppf=0.1)
    sht_chans = get_short_channels(raw_haemo)
    raw_haemo = get_long_channels(raw_haemo)

    design_matrix = make_first_level_design_matrix(raw_haemo, 
                                                   drift_model = 'cosine',
                                                   high_pass = 0.015,
                                                   hrf_model = 'spm',

    # Append short channels mean to design matrix
    design_matrix["ShortHbO"] = np.mean(sht_chans.copy().pick(picks="hbo").get_data(), axis=0)
    design_matrix["ShortHbR"] = np.mean(sht_chans.copy().pick(picks="hbr").get_data(), axis=0)
    # Run GLM
    glm_est = run_glm(raw_haemo, design_matrix)