;Boxcar smoothing demo Nt=1000L dt = !PI*4/Nt t = findgen(Nt)*dt omega = 1 + t ;chirp signal = sin(omega*t) noise = randomn(seed,Nt) data = signal + noise smoothed = smooth(data, 15) tek_color window, 1, xsize=1024,ysize=768 temp_P = !P !P.charsize=2.5 !P.charthick=2.0 plot, t, data, psym=1, color=1, yrange=[-2,2],$ xtitle="time", ytitle="signal" oplot, t, signal, color=3, thick=2 oplot, t, smoothed, color=2, thick=2 legend,["data","smoothed","underlying signal"], psym=[1,-3,-3], $ color=[1,2,3], thick=[1,2,2] !P = temp_P end