Noise stimulus

Hi Chris,
I have some questions about the white noise stimulus.
First, in the documentation, I don’t see any variables that control the size of the stimulus. I would like to make the stimulus smaller than the full screen. I realize that this is a “background” stimulus and so may not have this functionality. Would applying a mask be a reasonable solution? Would you add this at the “Present noise” or “Generate noise” stage?
Second, I would like to add a brief stimulus that appears at the start of each frame to keep track of timing with our electrophysiology recordings. I am currently presenting frames at 10Hz. I would like a 50 ms stimulus to appear at the onset of each frame, so that the luminance is modulated and frames can be tagged. Is this something that I can add to the “Present noise” phase? It’s not obvious how since you just call the frame list once each trial.
Thanks,
Lindsey

Hi Lindsey,

I don’t see any variables that control the size of the stimulus. I would like to make the stimulus smaller than the full screen. I realize that this is a “background” stimulus and so may not have this functionality. Would applying a mask be a reasonable solution? Would you add this at the “Present noise” or “Generate noise” stage?

You’re correct that the stimulus is designed to always fill the background, so it doesn’t have size parameters.

A mask would be one way to control the size of the stimulus. You could use it either when generating the noise or presenting the noise. However, if you use it during generation, the position of the noise will be fixed in the captured images. The more flexible approach would be to use it during presentation. To do this, you would add a layer on top of the fullscreen noise. The layer would contain two stimuli: a blank screen for the desired background color, and an inverted mask that determines the shape and position of the visible noise.

Alternatively, you could control the size of the noise by adding size parameters to (and removing the “fullscreen” parameter from) the image file stimuli you use to present the noise frames. The only potential issue there is that you might need to present the images at their original aspect ratio (i.e. the aspect ratio of the display). Otherwise, the noise could look distorted. That said, I just tried it, and it looks OK to my eyes, so maybe this isn’t a valid concern.

I would like to add a brief stimulus that appears at the start of each frame to keep track of timing with our electrophysiology recordings. I am currently presenting frames at 10Hz. I would like a 50 ms stimulus to appear at the onset of each frame, so that the luminance is modulated and frames can be tagged. Is this something that I can add to the “Present noise” phase? It’s not obvious how since you just call the frame list once each trial.

Do you want the 50ms stimulus to be drawn on top of the noise frame (meaning it would be visible for half the presentation time of each noise frame)? Or do you want it to appear before the noise frame?

If you want it on top of the noise, you should be able to do it by adding another movie stimulus. The movie would run at 20 frames per second and be configured to loop. It would contain two stimuli: the 50ms stimulus, and a blank stimulus (e.g. a rectangle with alpha set to zero) to fill the other 50ms of the noise frame. As long as you queue it at the same time as the noise movie and set its autoplay parameter to true, it will stay in sync with the noise movie.

If you want the 50ms stimulus to display before the noise, you could probably also do that with an additional movie, but you’ll need more blank stimuli to fill out the interval where the noise is displayed.

Cheers,
Chris

Hi Chris,
Thanks- this is super helpful! I’ll try these out and let you know how it goes.
Lindsey.

Hi Chris,
The mask works beautifully and I modified the “generate noise” protocol to create my two frames for the 20 Hz movie.
It’s in the same directory as the noise movie frames, but a different folder. Given the pointer system (where thepath for the range replicator is just “images/”) what is the best way to make this second movie? Is the simplest thing to just copy the two frames into each noise stimulus movie folder and rename them as 3001.png and 3002.png (to follow the 3000 noise images) and then set the range replicator to grab those two frames? Or is there a different approach you’d recommend?
Lindsey.

Hi Lindsey,

Is there a need to pre-generate the frames for the 20Hz movie? The frames of a movie stimulus can be of any stimulus type (not just image_file). I was imagining you would just let MWorks render the frames at run time, in the usual way.

If you do need to pre-generate them, you could copy the frames to the “images” folder as you suggest. You could also put them in a subdirectory of the “images” folder. Then, when defining the stimuli for the 20Hz movie, the path attribute would use that subdirectory, e.g.

image_file onset_stim_frame_${rr_index} (
    path = 'images/onset_stim/frame_${rr_index}.png'
    ...

Chris

Oh- I didn’t know you could make a movie from a stimulus. I thought it had to be loaded from an image. Thanks!
Lindsey.