Sphere lab
Biophysics Sphere lab - General information
Technical specifications
Designing and presenting stimuli with TDT hardware
With the TDT system we can create and control sound stimuli in realtime. Stimulus parameters such as loudness, duration and onset timing can be controlled using the circuit components of the RPvdsex software. To create a stimulus, a relevant circuit has to be loaded onto the RP2 Realtime Processing unit. These files are called .rcx/.rpx files and can be found on the C:\MATLAB\experiment\RPvdsex drive on the experimental pc in the Biophysics lab.
Let's start with an example of gaussian white noise to see what is needed to present a stimulus.
In the circuit shown above, we can see that there is a separate component called "GaussNoise". This generates random numbers that can be used to produce whitenoise through a speaker. After the GaussNoise component, there are two "Biquad" components in serie. The Biquad components both have input from "ButCoef1"; Butterworth filter coefficient generators. The result is a sound that is Lowpass filtered with cutoff frequency "LPFreq" and highpass filtered with "HPfreq". Both LPfreq and HPfreq are so called parameter tags, wich can be controlled via matlab with the command RP2.SetTagVal('HPfreq',MatlabHPfreq) where MatlabHPfreq is the Matlab variable with the value you want to assign to HPfreq in the circuit.
The filtered noise signal is passed to "BPGwn" (bandpassed Gaussian White noise) which is a simple linker component to create a clear flow in the circuit. The BPGwn reappears in the lower left part of the circuit, where it functions as input for a gating component "Cos2Gate". The gating component makes sure that the signal onset is a smooth transition from 0 to maximum amplitude, to prevent highfrequency onset artefacts. The Cos2Gate has additional green input in the form of Ctrl=Open, meaning that this is a digital (0 or 1) value. Likewise, the main input of Cos2Gate is light blue, meaning that it is a floating point value. When you create and compile your own circuits, the software checks if the input type matches the type of signal you connected. The Ctrl=Open port gets its input from the "Schmitt" component which creates a digital pulse of length "Thi" milliseconds. This is the stimulus duration, which you can change by altering the "StimLength" tag value. The Schmitt pulse is triggered by a linker called "Engage" which you can trace back to the top of the circuit. There and "EdgeDetect" looks for sharp positive change in the external trigger labeled "Src=Extern". This is the trigger input on the RP2 machine, usually you connect a button that the participant presses.
The output of the Cos2Gate is multiplied by "GWNAmp" to create a fixed loudness change. Note that you can also change the loudness by altering the "Amp" parameter in the GaussNoise component. After the multiplier, there are two components called "Ch=1" and "Ch=2". These are Digital to Analog Converters (DAC outputs) and they correspond to the two output channels on the RP2.
After the RP2, the sound signal is led through a PM2relay ("MUX machines" or Multiplexers) to assign which speaker should present the sound.
In this part of the circuit, we will start with the output instead of the input. Output here is the "WordBitOut" on the right with "M=-1" written inside. The wordbitout is a digital output with 8 bits. From the TDT system manual: Bits 0 - 3 identify the channel number. Integer 0, or bitpattern (xxxx 0000), is channel 0 and integer 15, or bitpattern (xxxx 1111), is channel 15. Bits 4 and 5 identify the device number. Integer value 0, or bit pattern (xx00xxxx), is device number 0 and integer value 48, or bit pattern (xx11xxxx), is device number 3. The device number is set internally for each PM2R and allows for an RP2 to control up to four PM2R modules. If only one PM2R is being used, it should have device number 0. Bit 6 is the set-bit. When this bit is set high, the channel and device from the previous six bits is activated. Bit 7 deactivates all channels across only the specified device.
This means that you need to add several integer values to switch on the speaker you want. To select the channel (0-15) on a multiplexer, you can change the "GwnChan" tag. To select a multiplexer device, change the "DeviceSelect" tag value. Finally, to switch on the selected speaker, choose value 64 for "SetReset" and trigger the software trigger (the "Src=Soft1" component) via matlab. To know which speaker (azymuth, elevation location) belongs to which configuration of multiplexerindex and channel, use the SoundSpeakerLookUp function in matlab (more on this function and other matlab functions in another section).