1D gaussian smoothing
[xsm, Xsm] = gsm(x [, sigma, delta, in, out])
[xsm, Xsm] = gsm(x, <named_args>)
Function gsm
performs gaussian smoothing of the vector x, with
standard deviation sigma, using FFT. The optional arguments in
and out enables the user to reuse previously done FFTs. Here are
some possible uses of gsm:
sigma
defaults to 5, in
and out
both defaults
to 'time'.sigma
equals 15, in
and out
both defaults to 'time'.x
in time domain.
xsm
in frequency domain (inverse fft is NOT done by gsm)x
in frequency domain (fft has already been done).
xsm
in frequency domain (inverse fft is NOT done by gsm)delta f
is 0.1
sigma
defaults to 5
x
in frequency domain.
xsm
in time domain (inverse fft is done by gsm)In all above examples, Xsm is in the frequency domain. It is the second output parameter, and thus it was discarded in the above examples.
initial_dir = PWD; chdir (SIPDIR + 'images'); Img = imread('star.bmp'); xset('window',0); clf imshow(Img,2); [x,y] = follow(Img); // get the parametric contour t=1:size(x,'*'); xset('window',1) clf subplot(121) plot2d(t,x,2); subplot(122) plot2d(t,y,1); xsm = gsm(x,15); // gaussian-smooth the contour ysm = gsm(y,15); subplot(121) plot2d(t,xsm,2); subplot(122) plot2d(t,ysm,1); // builds an image from parametric contour: Img2=unfollow(xsm,ysm,size(Img)); xset('window',0); clf imshow(Img2,2); chdir(initial_dir); |
http://siptoolbox.sf.net