;+ ; ; From a time serie of length T=tinc*N ; Return power spectrum and array of periods ; ; @version ; $Id$ ; ;- FUNCTION spectrum, ts, tinc ; compile_opt idl2, strictarrsubs ; N=n_elements(ts) N21 = N/2 ps=ABS(FFT(ts, -1)) ps=ps[0:N21-1] period=tinc*N/(findgen(N21)+0.0000000000001) period[0]=99999999999. ret=findgen(2,N21) ret[1,*]=ps ret[0,*]=period return, ret end