EnvelopeGrating

Attributes

Details

class psychopy.visual.EnvelopeGrating(win, carrier='noise', mask='none', envelope='sin', units='', pos=(0.0, 0.0), size=None, sf=None, envsf=None, ori=0.0, envori=0.0, phase=(0.0, 0.0), envphase=(0.0, 0.0), beat=False, texRes=128, rgb=None, dkl=None, lms=None, color=(1.0, 1.0, 1.0), colorSpace='rgb', contrast=0.5, moddepth=1.0, opacity=1.0, depth=0, rgbPedestal=(0.0, 0.0, 0.0), interpolate=False, blendmode='avg', name=None, autoLog=None, autoDraw=False, maskParams=None)

Second-order envelope stimuli with 3 textures; a carrier, an envelope and a mask

Examples:

env1 = EnvelopeGrating(win,ori=0, carrier=’sin’, envelope=’sin’,
mask = ‘gauss’, sf=24, envsf=4, size=1, contrast=0.5, moddepth=1.0, envori=0, pos=[-.5,.5],interpolate=0) # gives a circular patch of high frequency carrier with a # low frequency envelope
env2 = EnvelopeGrating(win,ori=0, carrier=noise, envelope=’sin’,
mask = None, sf=1, envsf=4, size=1, contrast=0.5, moddepth=0.8, envori=0, pos=[-.5,-.5],interpolate=0) # If noise is some numpy array containing random values gives a # patch of noise with a low frequency sinewave envelope
env4 = EnvelopeGrating(win,ori=90, carrier=’sin’, envelope=’sin’,
mask = ‘gauss’, sf=24, envsf=4, size=1, contrast=0.5, moddepth=1.0, envori=0, pos=[.5,.5], beat=True, interpolate=0) # Setting beat will create a second order beat stimulus which # critically contains no net energy at the carrier frequency # even though it appears to be present. In this case carrier # and envelope are at 90 degree to each other

With an EnvelopeStim the carrier and envelope can have different spatial frequencies, phases and orientations. Its position can be shifted as a whole.

contrast controls the contrast of the carrier and moddepth the modulation depth of the envelope. contrast and moddepth must work together, for moddepth=1 the max carrier contrast is 0.5 otherwise the displayable raneg will be exceeded. If moddepth < 1 higher contrasts can be accommodated.

Opacity controls the transparency of the whole stimulus.

Because orientation is implemented very differently for the carrier and envelope using this function without a broadly circular mask may produce unexpected results

Using EnvelopeStim with images from disk (jpg, tif, png, …)

Ideally texture images to be rendered should be square with ‘power-of-2’ dimensions e.g. 16x16, 128x128. Any image that is not will be upscaled (with linear interpolation) to the nearest such texture by PsychoPy. The size of the stimulus should be specified in the normal way using the appropriate units (deg, pix, cm, …). Be sure to get the aspect ratio the same as the image (if you don’t want it stretched!).

mro() → list

return a type’s method resolution order


Back to top