Drifting Grating Mask Question

Hi Chris,

I’m new to MWorks and I hope you can help me with generating a particular stimulus.

I want to make circular gabor stimuli (sinusoid enveloped by a gaussian). I tried using the drifting grating stimuli with a gaussian mask but it doesn’t look like a gaussian, it is a rectangle. Using a circular mask resulted in a shape that I want, but with a sharp edge between the stimuli and the background. I also tried to use a smaller SD but then it is difficult to know what the true size of the stimulus is and the stimulus looks elongated instead of circular. Is there a way to make a circular grating stimulus with a gaussian mask and no sharp edge between the grating and the background? From my understanding, this is what people in vision science regularly use.

Sorry if my question is not clear enough.

Thank you

Attachment: gabor_patch.jpg (26.6 KB)

Hi Tenri,

Until very recently, MWorks’ drifting grating always included a normalization term that made the maximum amplitude of the Gaussian mask dependent on its standard deviation (more info). In recent nightly builds, the drifting grating has a new parameter, normalized. If you set this parameter to NO, then the normalization term is omitted, and the maximum amplitude is always 1.

If you add normalized="NO" to your grating definition and run your experiment on a nightly build, I think you’ll find that the stimulus behaves as you expect.