lam0=1; omg0=2*pi/lam0; t=(0:0.1:100); ft=exp(-(t-50).^2/100).*exp(-1i*omg0*t)/sqrt(length(t)); ft=ft.'; [w,fw]=dftF(t,ft,omg0); % ng=1/(n0+2dnw0); ng=3; n0=1; dn=(ng-n0)/2/omg0; n=n0+dn*(w-omg0); k=n.*w; figure(2) x=(0:0.1:40).'; for tc=-10:0.2:100 clf t0=tc+0*x; fld=exp(-1i*t0*w+1i*x*k)*fw; plot(x,fld) ylim([-1 1]) drawnow end