# Current drifting grating plugin

**URL:** <https://mworks.discourse.group/t/current-drifting-grating-plugin/311>\
**Category:** Support\
**Created:** [July 6, 2018, 2:30pm UTC](https://mworks.discourse.group/t/current-drifting-grating-plugin/311 "2018-07-06T14:30:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [July 6, 2018, 2:30pm UTC](https://mworks.discourse.group/t/current-drifting-grating-plugin/311/1 "2018-07-06T14:30:56Z")

</div>

Hi Chris,

While awaiting your wonderful work porting our Grating plugin, we have been using the standard drifting grating and noticed a couple of behavior that are potentially incorrect.

1-At the highest contrast the gaussian window doesn’t look like a gaussian. I know that there is a perceptual effect whereby our visual system creates the illusion of a circle, but it does seem to meet there is a circle on top of that. Not clear what equation is being used, but it is almost like the top is flat circle that then gets rounded once it reaches a point. As you were suggesting earlier on, might be smarter to use a cosine instead of a gaussian anyway.

2-When opting of square instead of sinusoid, the resulting square wave isn’t anti-aliased. When the frequency is high, the bar are thing, the width of the black and white stripe are different making it a random rectangular wave as compared to an even square wave.

Again, not sure how important those things are to whoever wrote the first version of this plugin, but for unexperienced users these are major stimulus issues that are important to resolve.

Best  
Najib

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [July 6, 2018, 3:31pm UTC](https://mworks.discourse.group/t/current-drifting-grating-plugin/311/2 "2018-07-06T15:31:32Z")

</div>

Hi Najib,

> Not clear what equation is being used, but it is almost like the top is flat circle that then gets rounded once it reaches a point.

It sounds like you’re describing [this problem](https://mworks.tenderapp.com/discussions/problems/271). If you set the grating’s [normalized](https://mworks.github.io/documentation/latest/components/drifting_grating_stimulus.html#normalized) parameter to `NO`, does it look like you expect?

> When opting of square instead of sinusoid, the resulting square wave isn’t anti-aliased. When the frequency is high, the bar are thing, the width of the black and white stripe are different making it a random rectangular wave as compared to an even square wave.

Yes, I see what you mean. I think I know the right way to fix this. I’ll try to get the change in to the nightly build soon.

Thanks,  
Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [August 1, 2018, 6:37pm UTC](https://mworks.discourse.group/t/current-drifting-grating-plugin/311/3 "2018-08-01T18:37:32Z")

</div>

Hi Najib,

> When opting of square instead of sinusoid, the resulting square wave isn’t anti-aliased. When the frequency is high, the bar are thing, the width of the black and white stripe are different making it a random rectangular wave as compared to an even square wave.

This is fixed in the [nightly build](https://mworks.github.io/downloads/), for both square and sawtooth gratings.

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [July 19, 2022, 9:43pm UTC](https://mworks.discourse.group/t/current-drifting-grating-plugin/311/4 "2022-07-19T21:43:30Z")

</div>

Closed on July 19, 2022, 9:43pm UTC


