DoubleExponentialHRFKernel#
- class brainmass.DoubleExponentialHRFKernel(tau_1=7.22, tau_2=7.4, f_1=0.03, f_2=0.12, amp_1=0.1, amp_2=0.1, a=0.1, duration=Quantity(40., 's'))#
Double-exponential (damped-oscillation difference) HRF kernel.
A difference of two damped sinusoids (Polonsky et al. 2000) [1]:
\[h(t) \propto a_1 e^{-t/\tau_1}\sin(2\pi f_1 t) - a_2 e^{-t/\tau_2}\sin(2\pi f_2 t),\]peak-normalised and rescaled to amplitude \(a\) (matching TVB’s
DoubleExponentialequation). \(t\) is in seconds.- Parameters:
tau_1 (float) – Time constants of the two exponentials in seconds (defaults
7.22,7.4).tau_2 (float) – Time constants of the two exponentials in seconds (defaults
7.22,7.4).f_1 (float) – Frequencies of the two sinusoids in Hz (defaults
0.03,0.12).f_2 (float) – Frequencies of the two sinusoids in Hz (defaults
0.03,0.12).amp_1 (float) – Amplitudes of the two terms (defaults
0.1,0.1).amp_2 (float) – Amplitudes of the two terms (defaults
0.1,0.1).a (float) – Amplitude after peak-normalisation (default
0.1).duration (brainunit.Quantity) – Kernel support (default
40 * u.second).
References
Examples
>>> import brainmass >>> import brainunit as u >>> import jax.numpy as jnp >>> k = brainmass.DoubleExponentialHRFKernel() >>> h = k(jnp.linspace(0., 40000., 512) * u.ms) >>> bool(jnp.isclose(h.max(), 0.1, rtol=1e-5)) True