Here is the math behind the basic element of this contrast-defined stimulus:
xrot = x*cos(angle)-y*sin(angle)
carrier = sin(2*pi*sf*xrot)
envelope = exp(-(r*r)/(2*sigma*sigma))
z = carrier*envelope
This element is then replicated at different positions (x
i, y
i) and modified according to:
nbrc = 10; shift = (nbrc-1)/2; sep = sigma*10
for i = 0 : 99
x
i = (floor(i/nbrc)-shift)*sep
y
i = (mod(i,nbrc)-shift)*sep
angle = (100-coherence)*atan2(y
i ,x
i )/10