xinit('mem.1.ps')
//define macro which computes the Blackman-Tukey periodogram
deff('[xm,fr]=bt(x)',...
  'xsize=maxi(size(x));...
   [xf,fr]=frmag(x,256);...
   xm=xf.*conj(xf)/xsize;')

//rand('seed',12345),
 
 y=(0:10);
 x1=sin(2*%pi*y/20);
 x2=sin(3.5*%pi*y/20);
 w=.4*(rand(y)-.5*ones(y));
 x=x1+2*x2+w;
 [sm,fr1]=mese(x,10);
 [xm,fr]=bt(x);
 plot(x);
 xend()
xinit('mem.2.ps')
 plot(fr1,sm)
 xend()
xinit('mem.3.ps')
 plot(fr,xm)
 xend()



