function [g]=DG(param) % DG - Derivative of Gaussian function % % Usage: g = DG(param) % % param = [n,dim,sigma,loc] % This function creates a function which is the nth derivative % of a Gaussian of width sigma. The function is dim long and is % centered at loc. Default values are n=0, dim=256, sigma=3, % and loc=(dim+1)/2 % % Written by Jeffrey A Bloom % % This function calls the following M-file functions: % Hermite.m default=[0,256,3,128.5]; if (nargin<1) param=default; elseif (size(param,2)<3) param(size(param,2)+1:3) = default(size(param,2)+1:3); end if (size(param,2)<4) param(4) = (param(2)+1)/2; end n = param(1); dim = param(2); sigma = param(3); loc = param(4); globalx = 1:dim; x = globalx-loc; g = polyval(Hermite(param),x) .* exp(- x.^2/(2*sigma^2)); return end % function