This function convolves a hemodynamic response function (HRF) with a block duration, producing a time-varying response for the specified duration. The function supports various HRFs, block widths, precision levels, half-lives, and normalization.
Usage
convolve_block(
t,
hrf = hrf_gaussian,
width = 5,
precision = 0.2,
half_life = Inf,
summate = TRUE,
normalize = FALSE,
...
)
Arguments
- t
A vector of time points in seconds at which the convolved response will be evaluated
- hrf
The hemodynamic response function to be convolved, provided as a function (default: hrf_gaussian)
- width
The fixed width of the response block in seconds (default: 5)
- precision
The sampling precision of the response in seconds (default: 0.2)
- half_life
The half-life of the exponential decay function in seconds, used to model attenuation (default: Inf)
- summate
A logical value indicating whether to sum the impulse response functions (default: TRUE) If FALSE, the function returns the maximum value at each time point.
- normalize
A logical value indicating whether to normalize the output so that its peak value is 1 (default: FALSE)
- ...
Additional arguments passed to the HRF function