Drifting Grating stimulus: not odd-symmetric

mhisted's Avatar

mhisted

24 Jan, 2011 10:36 PM

The drifiting grating stimulus, when set to a sinusoidal grating, produces an even-symmetric stimulus. This means that its mean is in general not zero (or 127 for the usual case of a gray background).
Thus the onset of the stimulus produces a step in luminance.
The sinusoid should be generated so that the center of the stimulus is a zero-crossing (i.e. using cos()) rather than a peak (sin()).

Test case showing the effect attached.

Best
Mark

  1. Support Staff 1 Posted by Christopher Sta... on 26 Jan, 2011 03:24 PM

    Christopher Stawarz's Avatar

    Hi Mark,

    I see what you're saying. However, I'm uncomfortable with changing the default behavior of the stimulus, since other folks may expect/prefer the way it works now.

    As an alternative, I propose adding a "phase_shift" parameter to the drifting grating, which shifts the phase of the grating by a specified number of degrees. It would default to zero, but you could set it to 90 to get the effect you want. Would that be acceptable?

    Chris

  2. 2 Posted by mhisted on 27 Jan, 2011 07:32 PM

    mhisted's Avatar

    From John M:

    It is certainly better to have the phase controlled by a variable rather than fixed at a particular value (e.g., odd symmetric). However, a "phase_shift" parameter is only going to be confusing unless users can guess what the default phase is and where the phase applies, which they can't.

    The phase should refer to the center of the grating. That makes it easy to do odd or even symmetry, and avoids confusion over which corner the phase refers to (video, top-left or Cartesian, bottom-left). Because this is a drifting grating the phase can only refer to a static grating or the starting phase of a drifting grating. It should probably be called "initial_phase" or "starting_phase".

    John

  3. 3 Posted by mhisted on 27 Jan, 2011 07:36 PM

    mhisted's Avatar

    I would add on to say -
    I think 90 is a sensible default. I understand you're reluctant to change default behavior on people. But I can't think of any science advantage for having an even-symmetric grating, so I doubt you will be hurting anyone's experiments.
    Chris, you might want to poll Jim and Dave to see if they agree.
    The disadvantage of a 0 default is that you might burn people in the future who don't know about the parameter and end up leaving a luminance change from background in their grating.

  4. 4 Posted by mhisted on 27 Jan, 2011 07:37 PM

    mhisted's Avatar

    end up leaving a luminance change from background in their grating.

    nb: for certain science questions this is a very bad thing.
    Most people who ask those questions should know this. But the cost-benefit comes out far in favor of 90, if I was making the decision.

  5. Support Staff 5 Posted by Christopher Sta... on 27 Jan, 2011 08:11 PM

    Christopher Stawarz's Avatar

    The phase should refer to the center of the grating. That makes it easy to do odd or even symmetry, and avoids confusion over which corner the phase refers to (video, top-left or Cartesian, bottom-left). Because this is a drifting grating the phase can only refer to a static grating or the starting phase of a drifting grating. It should probably be called "initial_phase" or "starting_phase".

    That all makes sense. I'm happy with "initial_phase".

    I think 90 is a sensible default. I understand you're reluctant to change default behavior on people. But I can't think of any science advantage for having an even-symmetric grating, so I doubt you will be hurting anyone's experiments. Chris, you might want to poll Jim and Dave to see if they agree.

    Fair enough. I'll see what Jim and Dave have to say.

    Chris

  6. Support Staff 6 Posted by Christopher Sta... on 28 Jan, 2011 05:21 PM

    Christopher Stawarz's Avatar

    Well, now I feel stupid: I just noticed that the drifting grating already supports a parameter called "starting_phase" that does exactly what I've proposed. The default is zero, which we may want to change, but setting it to 90 seems to give the odd-symmetric grating that you want.

    That'll teach me to read the code more carefully!

    Chris

  7. Christopher Stawarz closed this discussion on 08 Apr, 2011 03:42 PM.

  8. Christopher Stawarz closed this discussion on 10 Nov, 2020 08:42 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac