Last change
on this file since 8 was
2,
checked in by post_it, 17 years ago
|
Initial import from ~/POST_IT/
|
File size:
331 bytes
|
Line | |
---|
1 | function spectrum, ts,tinc |
---|
2 | ; |
---|
3 | ; From a time serie of length T=tinc*N |
---|
4 | ; Return power spectrum and array of periods |
---|
5 | ; |
---|
6 | N=n_elements(ts) |
---|
7 | N21 = N/2 |
---|
8 | ps=ABS(FFT(ts, -1)) |
---|
9 | ps=ps(0:N21-1) |
---|
10 | |
---|
11 | period=tinc*N/(findgen(N21)+0.0000000000001) |
---|
12 | period(0)=99999999999. |
---|
13 | |
---|
14 | ret=findgen(2,N21) |
---|
15 | ret(1,*)=ps |
---|
16 | ret(0,*)=period |
---|
17 | |
---|
18 | return, ret |
---|
19 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.