[Eeglablist] shifting event markers in time

Stefan Debener s.debener at uke.uni-hamburg.de
Wed Sep 27 05:18:19 PDT 2006


Hi Doerte,
below find a simple loop doing this, not elegant, but easy to read. 
Here, CODE is the TTL code/label you want to shift in time and SHIFT is 
the shift interval in sampling points. Do this for the continuous file 
before epoching, and make sure that you shift only those events you 
think are misplaced in time:

SHIFT = 12;         % shift interval in sampling points (e.g 12 sampling 
at 250 Hz sampling Rate = 48ms.
CODE = 'target';  % name of TTL to shift, e.g. target
for i = 1:length(EEG.event)
    if isequal(EEG.event(i).type, CODE)
        EEG.event(i).latency =  EEG.event(i).latency +SHIFT;
    end
end

Best,
Stefan


Dörte Spring wrote:
> Hi folks,
>
> I was wondering whether there is a possibility in eeglab to shift all 
> event markers by 50 ms backwards in time? I'm concerned that the ERPs 
> won't be right if I just create ERPs as usual and shift the revealed 
> components by 50 ms in my head for better interpretation. Namely, the 
> actual stimuli occurred 50 ms later then the event marker was sent out. 
> I really think that the baseline and its removal would yield much better 
> data/ERPs if I could include these 50 ms into the baseline as well and 
> let the ERP start 50 ms later.
>
> I'm open for any suggestions.
>
> Many thanks,
>
> Doerte
>
>   






More information about the eeglablist mailing list