Hello,
Sorry for being slow to reply.
There might be 2 reasonable ways to do this. But to be sure, if the onset is at time t=0 and the duration is 5s, for example, you are hoping to model a square wave from what, 4-12s?
In any case 3dDeconvolve has an 'EXPR()' basis function, though it does not incorporate duration modulation.
To make a simple square wave, consider "timing_tool.py -timing_to_1D". That gives a lot of control, such as the TR, the fraction of the TR that would lead to a '1' in the output, and varying run lengths. Please see examples 6a, b and c from
timing_tool.py -help.
- rick