forked from SixByNine/sigproc
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathformspec.f
More file actions
43 lines (39 loc) · 1.06 KB
/
formspec.f
File metadata and controls
43 lines (39 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
c==========================================================================
subroutine formspec(npf,nf1)
c==========================================================================
implicit none
c
c Forms the power spectrum from the real and imaginary
c parts ffted array series(ntim) (see seek.inc)
c
include 'seek.inc'
include 'csamp.inc'
integer npf,nf1
integer i,j
real arl,ail,a1,a2,ar,ai,anf
anf=series(2)**2
arl=0.0
ail=0.0
do i=1,2*nf1
series(i)=0.0
enddo
c Trying to take out the nyqyst frequency
series(ntim) =0.0
series(ntim-1)=0.0
npf=ntim/2
do j=1,npf-1
ar=series(2*j+1)
ai=series(2*j+2)
a1=ar**2+ai**2
a2=((ar-arl)**2+(ai-ail)**2)/2.
samp(j)=sqrt(max(a1,a2))
arl=ar
ail=ai
enddo
samp(npf)=0.0
c ar=sqrt(anf)
c a1=anf
c a2=((ar-arl)**2 + ail**2)/2.
c samp(npf)=sqrt(max(a1,a2))
end
c==========================================================================