pyntbci.eeg.generate_impulse_response
- pyntbci.eeg.generate_impulse_response(fs: int, components: list[tuple[float, float, float]] = None, dtype: str | dtype = 'float32') NDArray[source]
Generate a temporal response function (i.e., a VEP / impulse response kernel) as the sum of one or more Ricker wavelets (a biphasic bump, similar to a single-component visual evoked potential).
- Parameters:
fs (int) – The sampling frequency in Hz.
components (list[tuple[float, float, float]] (default: None)) – A list of (amplitude, latency, width) tuples, each in (a.u., seconds, seconds), that are summed to form the impulse response. If None, three component are used (-0.5, 0.075, 0.020), (1.0, 0.1, 0.05), and (-0.4, 0.125, 0.020), representing a prototypical VEP.
dtype (str | np.dtype (default: "float32")) – The dtype of the returned array. Computation is always done in float64 internally; this only controls the precision of the final result.
- Returns:
impulse_response – The impulse response of shape (n_samples,), where n_samples covers the longest component with some margin.
- Return type:
NDArray