function [zz,ricke,ricker,c,r,npt,t]=rickercal(fre,nx,dx,dt)
% Ricker wavelet calculation
npt=3/fre;t=(-npt/2):dt:npt/2;
zz=dx*(1:1:nx);
ricke=(1-t .*t * fre^2 *pi^2  ) .*exp(- t.^2 * pi^2 * fre^2 ) ;
[c,r]=size(ricke);ricker(1:r)=ricke(1:r);
plot(t,ricke);title('Ricker Wavelet');xlabel('Time (s)');pause(.1);