Give a single spike as input to dipole

Hi Brainstorm users,

I am trying to see the forward solution( MEG and EEG sensor signal amplitudes) for a dipople at a certain MNI Coordinate. My input signal is just a spike at 0 seconds and the recording should go upto lets say -200 ms to 500 ms from the onset of spike. How can I generate that using brainstorm generate generic signals? And upto what length of EEG/MEG recording can I generate from one spike as input?

Hi @SubratBastola!

In the text box of the Simulate generic signals process, you can write any piece of Matlab code.

For example. This script generates 1-second segment (from -200 to 800 ms) with a spike at t=0 s.

t = t - 0.2;
Data(1,:) = zeros(size(t));
[~, ix_t0] = min(abs(t));
Data(1,ix_t0) = 1;


Hi @Raymundo.Cassani and what length of sensor recording ( MEG, EEG) can I generate from one spike? How can I change the length of recording that I want?

The duration of the sensor recording is equal to the duration of the simulated dipole

The duration is given as: Number of time samples ÷ Signal sampling frequency*.
In the example above, there were 1000 samples and sampling frequency was 1000 Hz, thus the duration of 1 second.