Welcome! Log In Create A New Profile

Advanced

Grating Edges

Posted by CEBpitt4401 
Grating Edges
February 09, 2026 04:12PM
I’ve noticed that our sine‐grating stimulus shows barely visible edges when presented on our OLED true-black subject display (Aorus FO32U using 2560x1440). These edges do not visibly appear when using our LED control display (2560x1440).

Below is the snippet of MATLAB code we use to generate the sine grating:

% For grating stimuli
        crc_radius = crc_size / 2;
        color2 = [0, 0, 0];  % Secondary color (black)
        spatial_frequency = 1 / stripe_width;
        temporal_frequency = 0;  % Static grating
   
 % Create the sine grating stimulus
        grat = SineGrating(null_);
        grat.Position = crc_pos;
        grat.Radius = crc_radius;
        grat.Direction = orientation;
        grat.SpatialFrequency = spatial_frequency;
        grat.TemporalFrequency = temporal_frequency;
        grat.Color1 = crc_color (white);
        grat.Color2 = color2;
        grat.WindowType = gaussian;

Let me know if you have any ideas on what to change to avoid the edges being visible.

Happy to provide more details if needed.



Response from Jaewon as this was originally an email:


Since you are using the ‘gaussian’ window, you can play with the WindowSize property of SineGrating.
https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#SineGrating
I guess you can try increasing Radius and decreasing WindowSize.

Also try using a different background color. For example, if Color1 is white and Color2 is black, you can switch to a gray background.

Jaewon



Using darker colors as well as reducing the window size/increasing radius seems to help (doesn't completely remove the edges) but the sample is bordering too dark for our task, anything else you can think might help?
Re: Grating Edges
February 10, 2026 03:19PM
If it is a static grating, you may be able to edit pixels so that the edge can be vaguer. As long as you are using a moving grating, however, I do not think this can be easily solved. You may have to go back to the LED display, if this is a big issue.

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.