I found this toolbox online.
There is one thing I cannot understand. The toolbox use:
X = [ones(numTimeStampPerRun,1) [1:numTimeStampPerRun]']; % account for both offset and drift
to account for both offset and drift. I cannot understand what "offset" and "drift" represent in fMRI signal? Why the toolbox use this format to account for both offset and drift?
My guess is that they are detrending the signal by regressing out x. In this case
onespart is the offset, and1: numTimeStampPerRunis the linear trend.You can always just use
detrendin MATLAB though.EDIT: more explicitly, the linear fit has the form:
x(t) = a*t + b*1
where
t = 1:numTimeStampPerRun.