NB. read in data and subtract linear background D14=: |: mread 'your_path/14Hz.dat' 't d'=. D14 k=. i. 130 t0=: k{t NB. take only the first 130 frequency points d0=. k{d NB. and the corresponding Fourier transform data linear=: {{ 0.6 + 0.0286*(y-11.5) }} lin=. linear t0 NB. evaluate points on the linear baseline d1=: d0-lin NB. Fourier data with baseline subtracted lhs=: t0;d1 NB. we define global values "lhs" pwh=: 14 2 0.3 NB. just an example of the 1st guess