Hi.
I am trying to create drifting bars of the type demonstrated in the
DriftDemo that comes with the psychtoolbox. But I have a hard time
understanding their algorithm especially the part below
for i=1:frames
phase=(i/frames)*2*pi;
% grating
[x,y]=meshgrid(-200:200,-200:200);
angle=30*pi/180; % 30 deg orientation.
f=0.05*2*pi; % cycles/pixel
a=cos(angle)*f;
b=sin(angle)*f;
m=exp(-((x/90).^2)-((y/90).^2)).*sin(a*x+b*y+phase);
w(i)=SCREEN(whichScreen,'OpenOffscreenWindow',0,[0 0 size
(m)]);
SCREEN(w(i),'PutImage',gray+inc*m);
end
Where is exp(-((x/90).^2)-((y/90).^2)).*sin(a*x+b*y+phase) formula
coming from?
Any help would be appreciated.
Thank you
I am trying to create drifting bars of the type demonstrated in the
DriftDemo that comes with the psychtoolbox. But I have a hard time
understanding their algorithm especially the part below
for i=1:frames
phase=(i/frames)*2*pi;
% grating
[x,y]=meshgrid(-200:200,-200:200);
angle=30*pi/180; % 30 deg orientation.
f=0.05*2*pi; % cycles/pixel
a=cos(angle)*f;
b=sin(angle)*f;
m=exp(-((x/90).^2)-((y/90).^2)).*sin(a*x+b*y+phase);
w(i)=SCREEN(whichScreen,'OpenOffscreenWindow',0,[0 0 size
(m)]);
SCREEN(w(i),'PutImage',gray+inc*m);
end
Where is exp(-((x/90).^2)-((y/90).^2)).*sin(a*x+b*y+phase) formula
coming from?
Any help would be appreciated.
Thank you