function [vector] = gauss(w) % function [vector] = gauss(w) % returns a 1D gaussian of w points. For symmetry, w must be an odd integer. % reference: The Fourier Transform and Its Applications, Ron Bracewell, % McGraw-Hill, Electrical and Electronic Engineering Series, 1965. % % width to half peak = 2.355*sig = ((w-1)/2)*0.9394 % thus the area under the curve is unity % % Written by David Luknowsky on November 25, 1996. % Modified on February 18, 1997. if ((w/2) - (floor(w/2))) == 0 disp('gauss requires an odd integer as input'); vector=zeros(w,1); else q=(w-1)/2; sig=((w-1)/2)*0.9394/2.355; i=[-q:1:q]; vector=(1/(sig*(sqrt(2*pi))))*exp(-i.*i./(2*sig*sig))'; end