Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Thread Subject:
response time uncertainities

Subject: response time uncertainities

From: RaVe

Date: 6 Apr, 2013 03:51:11

Message: 1 of 2


I am sorry if my question seems weird on this forum, but I really don't know and get no reposen from other forums.

I'd like to understand and to know how Matlab is working for timing reaction time (e.g. response time with a keyboard, etc...).

In fact, after reading the documentation about uncertainity on this website, I'd like to know how to compute accurately the uncertainities similar to the ones reported by Presentation software with PTB. In Presentation website-> documentation, uncertainity is defined as follows (

For most systems and experiments, timing problems are very unlikely. However, to produce accurate scientific results, you need some method to detect any confounds in measurement. Presentation does this by reporting timing uncertainties. There are two major sources for the uncertainties in the times reported:

    interruptions from the operating systems or device drivers (this can affect all events)
    Presentation is dedicating resources to preparing stimuli (this affects non-stimulus events)

As previously discussed, uncertainties from the first category are unavoidable. In order to simultaneously monitor responses while presenting complicated and high rate multimodal stimuli, we optimized Presentation to avoid spending long uninterrupted periods of time preparing stimuli. Presentation segments the preparation of stimuli into small pieces. However, depending on the demands of the experiment and the quality of your hardware support these interruptions may remain problematic. For example, presenting videos can be very demanding on system resources and subsequently introduce further timing uncertainties.

For the majority of experiments, timing will never be a problem. However, we designed Presentation so that you receive explicit notification if either of the two problems mentioned above occur. For each event in the log file (except for pause, resume, and quit events and events for certain specialized hardware), Presentation provides a time of occurrence T and an uncertainty dT. These two numbers provide bounds on the time of occurrence of what we define as a Presentation event. The relationship between Presentation events and actual events can be complicated and in general depends on the particular type of event and the hardware involved.

Then, they present some explanation and method:

Presentation performs this timing cycle for every event. If any interruptions occur during the experiment due to operating system functions which affect the reported times of events this will be in the reported uncertainties.

Presentation allows you to send output codes associated with events from the standard serial and parallel ports. You will notice from the timing cycle that the beginning of these codes is also bounded between times T and T + dT. Therefore, the start of an output code and the associated Presentation event are never separated by more than dT.

For parallel port output, the "beginning" of the code indicates the rising edge of the pulse. For serial codes, the time of receipt of the code will be delayed by some value depending on the speed of your serial transmission.

I'd like to know if someone can explain how those incertainities are dealt with Matlab only or by Matlab + PTB if anyone use it, how to determine those values if possible and ideally give some advice on how to compute them. Thanks also for redirecting me to PTB source codes (C open source codes).

Thank you very much,

Subject: response time uncertainities

From: dpb

Date: 7 Apr, 2013 14:17:56

Message: 2 of 2

On 4/5/2013 10:51 PM, RaVe wrote:

> I'd like to know if someone can explain how those incertainities are
> dealt with Matlab only or by Matlab + PTB if anyone use it, how to
> determine those values if possible and ideally give some advice on how
> to compute them. ....

A) They're not -- your application would have to deal with timing.

B) While I didn't look at the external interface API stuff at all, it
would seem that what would happen would be that the additional interface
w/ Matlab would likely simply add some additional overhead into the
timings obtained directly.


Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us