MRI trigger interfering with Psychtoolbox

I run a FMRi auditory experiment where I use the following auditory stimuli with parameters as such:


freq = 44100;                           % Frequency at which to present the stimulus

 tone_freq = 1000;                % Tone frequency


 dt = 1/freq;                            % Step between each sample.

t_beep = [dt:dt:stim_length];           % Beep length.


amplitude = 0.4*mod(floor(10*t_beep),2)+ 0.4*sin(2*pi*t_beep*10);

 aud_stim = amplitude.*sin(2*pi*tone_freq*t_beep);  


% Initialize sound drivers:
    InitializePsychSound(1);
    nrchannels = 2;
    pahandle = PsychPortAudio('Open', [],[], 1, freq, nrchannels);

    aud = [PsychPortAudio('CreateBuffer', pahandle, [aud_stim; aud_stim])];

% Close the audio device:
    PsychPortAudio('Stop', pahandle);
    PsychPortAudio('DeleteBuffer');
    PsychPortAudio('Close', pahandle);

The experiment ran for a about 18 subjects, but now whenever the MRI trigger is on, the sound is not being played.

Has anyone encountered this problem where the MRI trigger interferes with sound produced with psychtoolbox function.





knowing nothing bout this, i can tell you: it'll be impossible for anyone to tell you whats up without more relevant code (e.g., how do you send the mri trigger)

On Mon, May 9, 2016 at 3:20 PM, rudra_aloka@... [PSYCHTOOLBOX] <PSYCHTOOLBOX@yahoogroups.com> wrote:


I run a FMRi auditory experiment where I use the following auditory stimuli with parameters as such:


freq = 44100; % Frequency at which to present the stimulus

tone_freq = 1000; % Tone frequency


dt = 1/freq; % Step between each sample.

t_beep = [dt:dt:stim_length]; % Beep length.


amplitude = 0.4*mod(floor(10*t_beep),2)+ 0.4*sin(2*pi*t_beep*10);

aud_stim = amplitude.*sin(2*pi*tone_freq*t_beep);


% Initialize sound drivers:
InitializePsychSound(1);
nrchannels = 2;
pahandle = PsychPortAudio('Open', [],[], 1, freq, nrchannels);

aud = [PsychPortAudio('CreateBuffer', pahandle, [aud_stim; aud_stim])];

% Close the audio device:
PsychPortAudio('Stop', pahandle);
PsychPortAudio('DeleteBuffer');
PsychPortAudio('Close', pahandle);

The experiment ran for a about 18 subjects, but now whenever the MRI trigger is on, the sound is not being played.

Has anyone encountered this problem where the MRI trigger interferes with sound produced with psychtoolbox function.