-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcosft.dem
38 lines (38 loc) · 909 Bytes
/
cosft.dem
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
PROGRAM D12R5
C Driver for routine COSFT
PARAMETER(EPS=1.0E-3,NP=16,WIDTH=30.0,PI=3.14159)
DIMENSION DATA(NP),SIZE(NP)
1 WRITE(*,'(1X,A,I2,A)') 'Period of cosine in channels (2-',NP,')'
READ(*,*) PER
IF (PER.LE.0.) STOP
DO 11 I=1,NP
DATA(I)=COS(2.0*PI*(I-1)/PER)
11 CONTINUE
CALL COSFT(DATA,NP,+1)
BIG=-1.0E10
SMALL=1.0E10
DO 12 I=1,NP
IF (DATA(I).LT.SMALL) SMALL=DATA(I)
IF (DATA(I).GT.BIG) BIG=DATA(I)
12 CONTINUE
SCAL=WIDTH/(BIG-SMALL)
DO 13 I=1,NP
NLIM=SCAL*(DATA(I)-SMALL)+EPS
WRITE(*,'(1X,I2,F6.2,1X,60A1)') I,DATA(I),('*',J=1,NLIM+1)
13 CONTINUE
WRITE(*,*) 'press continue ...'
READ(*,*)
CALL COSFT(DATA,NP,-1)
BIG=-1.0E10
SMALL=1.0E10
DO 14 I=1,NP
IF(DATA(I).LT.SMALL) SMALL=DATA(I)
IF(DATA(I).GT.BIG) BIG=DATA(I)
14 CONTINUE
SCAL=WIDTH/(BIG-SMALL)
DO 15 I=1,NP
NLIM=SCAL*(DATA(I)-SMALL)+EPS
WRITE(*,'(1X,I4,1X,60A1)') I,('*',J=1,NLIM+1)
15 CONTINUE
GOTO 1
END