🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #529

Re: using a NeXT for Reaction Time Experiments

#529
From: Izumi Ohzawa
Date: Tue, 11 Aug 1992 07:07
54 lines
3159 bytes
In article <9208101355.AA25079@watarts.uwaterloo.ca> 
"Bill E. Eickmeier" <bee@watarts.uwaterloo.ca> writes:
>
>Some people here are interested in doing reaction time experiments with
>sound and/or images. Essentially, we'd simply like to measure the
>precise time from when a sound or image is displayed until the subject
>presses a key on the keyboard or mouse. Using a NeXT, what sort of time
>resolution could we expect - 1ms, 10ms, more?

Keyboard and mouse events are time stamped with 1/68 second
(14.7msec) resolution [see Events section of the NeXT's Concepts
manual]. I don't know how reliable the time records are but this
should give you some idea.  68Hz is the frequency of vertical
refresh of the display.  


Hard part is getting the exact onset/offset time of sound or image
display.  I don't think this is possible to attain via normal (NeXT
recommended) programming practice of going through the
ApplicationKit and Display PostScript.  You could directly
write to screen memory for image, and this will give you
some control over when the stimulus is displayed.  You also
have to monitor the vertical retrace and count that because
the video frame refresh is the granularity of visual stimulus
presentations.  For sound, it is also difficult to know from a
program exactly when the actual sound come out.

If you are willing to use some external hardware (like external key
switches) instead of keyboard and mouse, then you can easily achieve
50 microsec (0.05 msec) resolution of subject responses by using the
DSP56001 chip as an intelligent timing device. 

You have to connect a switch to the NeXT DSP port and write
a short DSP program (most likely in assembly language for
56001).  Along with the switch input, you could actually input
a signal which indicates onset of sound or image.  For this,
you will need some external electronics to detect directly the
onset of sound or image from the actual sound output or
from the video.  Sound onset detection should be fairly simple.
Image onset detection can be done either directly sampling the
video signal at the correct timing, or can be done by a photo-cell
watching the location of interest.

My opinion is that, if you really want a reliable scheme, the DSP
timer and use of some external hardware is the only way to go.
Trying to do it with just the NeXT hardware, it seems to me, is a
futile fight with the pre-emptive multi-tasking OS.


-- 
Izumi Ohzawa             [ $BBg_78^=;(B ]
USMail: University of California, 360 Minor Hall, Berkeley, CA 94720
Telephone: (510) 642-6440             Fax:  (510) 642-3323
Internet: izumi@violet.berkeley.edu   NeXTmail: izumi@pinoko.berkeley.edu 
Technical Details
Message-ID: <167p0aINN6vj@agate.berkeley.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!ames!agate!mindseye.berkeley.edu!izumi
References: <9208101355.AA25079@watarts.uwaterloo.ca>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!ames!agate!mindseye.berkeley.edu!izumi
From: izumi@mindseye.berkeley.edu (Izumi Ohzawa)
Newsgroups: comp.sys.next.programmer
Subject: Re: using a NeXT for Reaction Time Experiments
Date: 11 Aug 1992 07:07:54 GMT
Organization: /etc/organization
Lines: 54
Message-ID: <167p0aINN6vj@agate.berkeley.edu>
References: <9208101355.AA25079@watarts.uwaterloo.ca>
NNTP-Posting-Host: mindseye.berkeley.edu