macro showfft id0=2800 id1=2880 file=run28-1_traces/run1_trc gain=1.8
  sigma fft=array(32768,0)
  do id=[id0],[id1]
    v/read freq,fftr,ffti [file]_[id].dat.fft
    sigma fft=fft+sqrt(fftr**2+ffti**2)
  enddo
  sigma fft=fft/([id1]-[id0]+1)/[gain]/sqrt(65536)
  1dhist 9 '' 32768 0 41666.7
  put/cont 9 fft
  opt logx
  opt logy
  h/pl 9(2.:)
  gr/set xlab 1.4
  atit 'frequency (Hz)' 'FFT of beam position signal (cm)'
return
