#closeall; clear; # get data from point time monitor m = "time_through"; t = getdata(m,"t"); Ey_through = getdata(m,"Ey"); # remove high frequency components zero_pad = 2^16; w = fftw(t,1,zero_pad); Ey_through_w = 2*((1:length(w))<=(length(w)/2+0.1))*fft(pinch(Ey_through),1,zero_pad); Ey_through_t = invfft(pinch(Ey_through_w)); Ey_through_t = Ey_through_t(1:length(t)); plot(t*1e15, abs(Ey_through_t)^2,'time (fs)','field intensity');