Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
melindacy

Junior Member
Registered:
Posts: 6
Reply with quote  #1 
Hi all,

I'm trying to write up a classic stop signal task on MonkeyLogic (05-23-2016 build 1.1.85, win7 32 bit, MATLAB 2014a, two PCI-6221 cards), which requires high temporal precision. So far I've been having problems with time precision.

Using tic/toc before and after toggleobject, I found that it takes around 30ms to toggle an image (crc) and ~60ms to toggle a sound (sine wave defined in condition file). My screen refresh rate is 60Hz. Sometimes the first toggle of sound takes way longer than that (up to ~200ms). Are these values commonly seen with ML? If so is there any way I can acquire mouse click/eye fixation during this period of time? 

I'm reading Analog Input (AI Duplication turned on) from a button box. I treated the signal as eye signal and used eyejoytrack('acquirefix',...) for detecting button press. The time taken, if no fix acquired, is 15-20ms longer than the set max duration.

On a button related topic but not about time precision, if I want to use acquirbutton instead, what should I input for "object_number" with eyejoytrack('acquiretouch',...). Neither putting [] nor omitting this argument was working. 

Thank you for any suggestion!


0
Jaewon

Administrator
Registered:
Posts: 971
Reply with quote  #2 
The old ML does not support hardware acceleration in audio output and does not pre-load the sound, so you can't expect a latency any better than that in audio. (That is why I implemented XAudio2-based audio in NIMH ML.) Also the first call of a function usually takes a little longer because MATLAB compiles the code when it is called for the first time. 30 ms in toggling an image still looks a bit long though.

You shouldn't use 'acquirefix' for buttons. With 'acquiretouch', you can put the button number (1 for Button1, 2 for Button2, etc.) for "object_number".
0
melindacy

Junior Member
Registered:
Posts: 6
Reply with quote  #3 
Hi Jaewon,

Thank you for your help!
I've switched to the NIMH Monkeylogic and the time issue seems to be resolved now: apart from the first toggling, it takes ~16ms for toggling an image and <1ms for toggling a sound. The first toggle also takes much shorter time than before. The "acquiretouch" with button number as object number also works.

Best,
Yang 
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.