function h=kernel1d(type,para,ax) % Usage: h=kernel1d(type,para,ax) % return 1d vector that represent a particular type kernel % type = 0 (default) square h((|x-x0|) = 1 for |x-x0| <= T/2, 0 elsewhere % parameter: x0: center (default = 0), T: width (default = 1) % x0 = para(1), T = para(2) % = 1 Gaussian, h(|x-x0|) = (1/(sqrt(2pi)*sigma))*exp(-0.5*(x-x0)^2/sigma^2) % parameter: x0: center (default = 0), sigma: standard dev (default = 1) % x0 = para(1), sigma2 = para(2) % ******** Note: in some definitions, the gaussian kernel does NOT have % ******** the term 1/sqrt(2*pi*sigma^2) in front of it! % para(3) = 0 (or omitted): with the term, para(3)=1: no such term % = 2 triangular, h(|x-x0|) = 1 - |x-x0| for 0<=|x-x0|