define hwid 15 set x=1,512 set y=x*0 set w=-1**x define N 512 # set random 1001 set x=1,$N do i=1,10 { set t=random($N)-0.5 set y=y+t } set y=y/10 window 1 2 1 2 limits x -.3 .3 set filt={0.25 .5 0.25} smooth2 y ys filt box ltype 1 connect x y ltype 0 ctype red connect x ys ctype default relocate 0 .25 label Hanning smooth window 1 2 1 1 set z=x*0 set y=ys*w fft 1 y z r i set r=r*w set i=i*w set xt=x-257 set xx=xt concat xt set yy=r concat i limits xx -.008 .009 box connect xt r ctype red connect xt i ctype default set x=3.1416*(xt+.01)/256 set y=.007*(sin(x)/x)**2 ltype 1 connect xt y set y=-y connect xt y ltype 0 relocate -240 .007 expand 1.5 label [sin(x)/x]^2 expand 1.0