vlt.math.dog2dogf-convertdifferenceofgaussianparameterstodifferenceofgaussianFouriertransformparametersP_DOGF=vlt.math.dog2dogf(P_DOG)Givenparametersforadifferenceofgaussiansfunction:P_DOG=[a1b1a2b2],wherevlt.math.dog(X,P_DOG)=[a1*exp(-X.^2/(2*b1^2)-a2*exp(-X.^2/(2*b2^2))],thisfunctioncomputestheparametersforcalculatingthecurveinfrequencyspace(incycles/unitx).TheFouriertransformofvlt.math.dog(X,P_DOG)issqrt(2*pi)*[a1*b1*exp(-0.5*b1^2*(2*pi)^2*f^2)-a1*b2*exp(-0.5*b2^2*(2*pi)^2*f^2)]Thisfunctionisitselfadifferenceofgaussianfunction.Therefore,toexpressthesevaluesintermsoftheoriginalP_DOG,theparametersareconvertedtobeP_DOGF=[sqrt(2*pi)*a1*b11/(2*pi*b1)sqrt(2*pi)*a2*b21/(2*pi*b2)]Throughthemiracleofmath,thisfunctionisalsoit'sowninverse:p_dog=vlt.math.dog2dofg(vlt.math.dog2dogf(p_dog))Seealso:vlt.math.dogExample:x=-50:0.1:50;% space, in degrees of visual anglep_dog=[150.510]y=vlt.math.dog(x,p_dog);figure;subplot(2,2,1);plot(x,y);xlabel('Space (degrees)');ylabel('Response (sp/s)');boxoff;subplot(2,2,2);% plot the actual Fourier transform[Y,f]=vlt.math.fouriercoeffs(y(:),x(2)-x(1));plot(f,abs(Y),'bx-');xlabel('Frequency (cycles/deg)');ylabel('Abs response (sp/s)');boxoff;set(gca,'xlim',[00.25]);% plot the calculated versionp_dogf=vlt.math.dog2dogf(p_dog);Y2=vlt.math.dog(f,p_dogf);% convert from radial frequency to cyclesY2=[Y2(1)2*Y2(2:end)]/(x(end)-x(1));% convert to same units as fourier_coeffs holdon;plot(f,Y2,'go-');