fitzsturgill wrote[quote='fitzsturgill' pid='77' dateline='1480285539']
Hi Josh,
I want to implement an auditory "house light", i.e. play a white noise during my ITI period. Because the animal must stop licking for 1.5s the duration of the ITI is indeterminate. Essentially I want a pulse train to play whenever a particular digital out is set to high.
Other people in our lab lab already use pulse pal to approximate a white noise stimulus:
SendCustomPulseTrain(1,cumsum(randi(9,1,601))/10000,(rand(1,601)-.5)*20); % White(?) noise on channel 1+2
Can I use the SetContinuousPlay function combined with the pulse gated trigger mode to do this?
Thanks,
Fitz
Hi Fitz
I'd suggest setting your auditory channel to "loop" mode. This will cause custom train playback to loop back to sample 1 when it reaches the end. If trigger mode is "Pulse Gated" and the pulse train duration is 3,000 seconds, you'll always have the amount of playback you need.
I pasted the white noise code into MATLAB. It looks like the output range is +/- 20V. Amplified speakers usually expect a "line level" signal of +/- 1V - so I'd multiply by 2 instead of 20 to avoid damaging your speaker amp. You can also make the pulse train significantly longer (if you're using Pulse Pal 2) - up to 5,000 samples. The pulse onset times don't have to be randomized - I'm pretty sure that will act as a low-pass filter on your signal. Instead, you can use SendCustomWaveform with SamplingPeriod = 0.0001, to get the whitest noise possible with Pulse Pal's bandwidth.
There is a caveat to this looping method, which you might care about, depending on what you're measuring. Since you're looping a segment of white noise at ~20x per second, it will create an auditory pattern in the low beta frequency band. To get around this, if Pulse Pal isn't simultaneously being used for stimulation, you can use Pulse Pal 2's new WaveGen firmware to make pulse-gated continuous white noise, sampled at 50kHz. Your setup code would be:
WaveGen = PulsePalWaveGen('COM3');
WaveGen.waveform = 'noise';
WaveGen.playbackMode = 'gated';
I hope this helps!
Josh