Digital Input delays

Post Reply
C Kalfaoglu
Posts: 2
Joined: Mon Sep 20, 2010 9:25 am
Location: Sheffield, UK

Digital Input delays

Post by C Kalfaoglu »

Hello,
I am trying to send digital inputs to the EEG amp using MATLAB via the parallel port. I’ve run some timing test to check the delay between the time a pulse is sent by MATLAB and the time when it is received by the recording computer (Actiview). I have two questions:

Are the signals time-stamped by the amp itself, or by the actiview?

Usually the delays (time the signal is received - time the signal was sent) are in the acceptable range (at the speed mode 4, delays are less than half a millisecond), but I get a delay of more than 1.5ms almost regularly every 10 signals or so. I tried running the actiview software on high priority on Windows 7 and on XP, but the delays were still there. Is there a way to get around this problem?
Thanks,
C

Coen
Site Admin
Posts: 1125
Joined: Fri Mar 26, 2004 7:00 pm
Location: Amsterdam, Netherlands
Contact:

Post by Coen »

The trigger pulses are added to the data stream from the AD-box in hardware (in the USB receiver, before streaming the combined data to the USB port). So, ActiView and/or Windows cannot cause (varying) time shifts between the EEG data and the trigger pulses. The timing between the EEG data and the trigger pulses is accurate with a precision of a sample period (plus or minus 0.5 ms on speedmode 4).

How did you measure the timing of your trigger pulses with respect to the timing of the EEG data ?

Best regards, Coen (BioSemi)

C Kalfaoglu
Posts: 2
Joined: Mon Sep 20, 2010 9:25 am
Location: Sheffield, UK

Post by C Kalfaoglu »

I actually haven't checked the timing of the pulses with respect to the EEG data. I just compared the time at which MATLAB sent the signal using the GetSecs function to the time at which the triggers were received by Actiview (using EEGLAB code: received = [EEG.events.latency]/1000).

code for recording time MATLAB sent the signals:
is = zeros(255,1);
for i = 1:255;
lptwrite(888,i);
is(i,1)= GetSecs;
WaitSecs(0.0005);
end

I then calculated the inter-signal-intervals (ISI) for each sent signals (time of the nth pulse minus the time of the n-1st pulse), compared them to those for the received signals. The difference between ISIs of the sent signals and ISIs of the received signals is typically less than half a millisecond, but I get a difference of about 1.45ms every 10 or so signals (or every 5ms).

p.s. I can send you the codes and the plot of delays to make it clear what Ive done and what I got.[/img]

Coen
Site Admin
Posts: 1125
Joined: Fri Mar 26, 2004 7:00 pm
Location: Amsterdam, Netherlands
Contact:

Post by Coen »

In that case, you can be quite sure that the timing jitter is caused by your Matlab setup.

Best regards, Coen (BioSemi)

Post Reply