da_find_fft_trig_funcs.inc
References to this file elsewhere.
1 subroutine da_find_fft_trig_funcs(n, trig_functs)
2
3 !---------------------------------------------------------------------------
4 ! Purpose: Set up constants required for Fourier, sine and cosine transforms
5 !---------------------------------------------------------------------------
6
7 implicit none
8
9 integer, intent(in) :: n
10 real, intent(out) :: trig_functs(:)
11
12 integer :: k, nil, nhl
13 real :: del, angle
14
15 !---------------------------------------------------------------------------
16 ! [1.0] Trig functions for real periodic transform:
17 !---------------------------------------------------------------------------
18
19 trig_functs(:) = 0.0
20
21 DEL=4.0*ASin(1.0)/FLOAT(N)
22 NIL=0
23 NHL=(N/2)-1
24
25 do K=NIL,NHL
26 ANGLE=FLOAT(K)*DEL
27 trig_functs(2*K+1)=COS(ANGLE)
28 trig_functs(2*K+2)=Sin(ANGLE)
29 end do
30
31 ! [1.1] Extra trig functions for cosine transform:
32
33 DEL=0.5*DEL
34 do K=1,NHL
35 ANGLE=FLOAT(K)*DEL
36 trig_functs(2*N+K)=Sin(ANGLE)
37 end do
38
39 ! [1.2] Extra trig functions for shifted cosine transform:
40
41 DEL=0.5*DEL
42 do K=1,N
43 ANGLE=FLOAT(K)*DEL
44 trig_functs(N+K)=Sin(ANGLE)
45 end do
46
47 end subroutine da_find_fft_trig_funcs
48
49