Dear Psychtoolbox Experts,
I am using PTB3 in my behavioral experiment with monkey. The eye position of the animal is monitored by an eye tracker with the sampling frequency of 500 Hz. The x and y position of the corneal reflection is read via AI 00 and AI 01 of the DAQ (USB-1208FS), respectively. By using DaqAInScan and setting the options.f = 500, I confirmed that it can collect 500 samples per second for each of the AI 00 and AI 01 with some dropout of the data. However, since I want to monitor the position point by point (continuously) to check if the eye position is within a window, I used DaqAIn instead in the following code and found that only 16 samples are collected per second for each channel. Considering the sampling frequency of the eye tracker (500 Hz) and DAQ (50 and 25 kHz for the AI 00 and 01, respectively), this sampling rate is too low. How can I read out the analogue inputs point by point at higher frequency in PTB3?
clear all PsychDefaultSetup( 1 ); DaqID = DaqFind; cX = [ ]; xY = ; array_cX = ; % array to save x position array_cY = ; % array to save y position array_tX = ; % array to save time stamp of the x position array_tY = ; % array to save time stamp of the y position % read out analogue inputs for 3 s and save them with the time stamp T1 = GetSecs; T2 = GetSecs; while ( T2 - T1 ) < 3 cX = DaqAIn( DaqID, 8, 0 ); % read out AI 00 array_cX = [ array_cX; cX ]; array_tX = [ array_tX; GetSecs ]; cY = DaqAIn( DaqID, 9, 0 ); % read out AI 01 array_cY = [ array_cY; cY ]; array_tY = [ array_tY; GetSecs ]; % Usually some codes come here to check if the eye position is within a window: % if cX > 5 || cY > 5 % break fixation % break % exit the loop % end T2 = GetSecs; end
My operating environment is as follows:
PsychtoolboxVersion: 3.0.18 – Flavor: beta – Corresponds to SVN Revision 13009
Platform: Ubuntu 20.04 LTS, 64-bit
Matlab: R2021a (22.214.171.1242886, 64-bit)
CPU: Intel(R) Core™ i7-8700 CPU @ 3.20 GHz
RAM: 64 GB
Any suggestions would be greatly appreciated.