Winvs test

advertisement
Winvs test
The tests made here differ from those in MatLocWinv.doc by the fact that WF
enters as a 1 to M array, but the inverse wants to be only of the middle JB-JE to JE-JB
terms as described in Periodic W.doc. This implies that the 1 to M array has a large
number of unused values at the beginning.
This is handled by passing a beginning to FFTSR so that instead of the usual
CALL FFTSR(wt,DAT,Wf,TINT,Nt,1)
The call is made as
NB=MLOC(Nt,JB)
NE=MLOC(Nt,JE)
CALL FFTSR(wt(NB),DAT,Wf(NB),TINT,Nt,1)
The time array runs from 1 to Nt in the code, with times defined by
TS2=TINT/2
DELTAT=TINT/Nt
T=(I-1)*DELTAT-TS2
The desired transform is from JB to JE centered about 0. The value 0 corresponds to
Nt/2+1 = MLOC(Nt,0).
2/14/2007 Bob suspects that these should be NB=MLOC(Nt,JB-JE) and
NE=MLOC(Nt,JE-JB)
The code for/winvs/twinvs.wpj tests the use of for/winvs/FFTSR.FOR to invert a
matrix. The inversion derivation is in Diagonal Matrices.doc. The code FFTSR is tested
in ..\..\Fourier\symmrange\Welcome.htm. The code for\winvs\mloc.for is the same as
that described in MatLocWinv.doc. The principle difference between the code
for\winvs\winvs.for and the code for\winv\winv2.for described in MatLocWinv.doc is
w(t)  wh(t) where wh is the transform
( JE  JB ) 1
iT
m
wˆ i    W  m exp   j 2 ti f m  ti 
; fm 
2( JE  JB  1)
T
m  ( JE  JB )
This is the transform described in Periodic W.doc#small
The test is
Mp / 21

n  Mp / 2
W 1  m  nW  n  k    m,k
 Mp / 2  m, k  Mp / 2
These values are stored in W and W-1 starting at location NB and ending at
location NE. The do loops are
NMID=(NE+NB+1)/2
DO M=-Mp/2,Mp/2-1
DO K=-Mp/2,MP/2-1
SUMP(K)=0
DO N=-Mp/2,Mp/2-1
MMN=M-N
IF(MMN.LT.-MP/2)MMN=MMN+MP
IF(MMN.GE.MP/2)MMN=MMN-MP
NMK=N-K
IF(NMK.LT.-MP/2)NMK=NMK+MP
IF(NMK.GE.MP/2)NMK=NMK-MP
SUMP(K)=SUMP(K)+WINV(NMID+MMN)*W(NMID+NMK)
ENDDO
ENDDO
WRITE(1,’(I3,(11F11.8)’)N,(SUMP(K),K=-MP/2,MP/2-1)
ENDDO
Testing
Figure 1 Time domain data.
Figure 2 Fourier Domain Wf
WfINV * Wf - a single element should equal 1
J
J
J
J
J
J
J
J
R
R
R
R
R
R
R
R
I
I
I
I
I
I
I
I
-32
-31
-30
-29
-28
-27
-26
-25
-24
-23
-22
-21
-20
-19
-18
-17
-16
-15
-14
-13
-12
-11
-10
-9
-8
-7
-6
-5
-4
-3
-2
-1
0
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
-0.105E-08-0.116E-09 0.582E-09 0.233E-09-0.349E-09 0.189E-09-0.393E-09 0.646E-10
0.588E-09 0.398E-10-0.113E-08 0.275E-09 0.792E-09-0.435E-09-0.201E-09 0.765E-09
-0.250E-09-0.745E-09 0.128E-09 0.383E-09 0.575E-10 0.191E-09-0.127E-09-0.318E-09
-0.145E-09 0.505E-09 0.755E-10-0.102E-09-0.393E-09 0.313E-10 0.687E-09-0.460E-09
-0.161E-09-0.162E-09 0.293E-09 0.221E-09-0.204E-09 0.828E-10-0.337E-09 0.674E-10
0.240E-09-0.435E-10-0.360E-09 0.300E-09 0.145E-10 0.130E-09 0.529E-10-0.393E-10
-0.572E-09 0.284E-09 0.497E-09-0.265E-10-0.100E-09-0.543E-09-0.134E-09-0.800E-10
0.684E-09 0.611E-09-0.437E-10-0.146E-08-0.902E-09 0.100E+01 0.698E-09-0.105E-08
0.349E-09 0.931E-09-0.116E-09-0.466E-09 0.873E-10 0.466E-09 0.109E-10-0.331E-09
0.237E-09-0.223E-10-0.563E-09-0.121E-09 0.107E-08 0.136E-09-0.907E-09-0.170E-09
0.450E-09-0.306E-10 0.147E-09-0.599E-10-0.482E-09 0.235E-09 0.589E-09-0.280E-09
-0.365E-09 0.357E-09 0.656E-10-0.654E-09 0.475E-09 0.104E-09 0.180E-09-0.131E-09
-0.370E-09 0.791E-10 0.910E-10 0.370E-09-0.600E-09-0.726E-10 0.507E-09 0.164E-09
-0.165E-09-0.258E-09-0.360E-09 0.361E-09 0.614E-09-0.426E-09-0.481E-09 0.347E-09
0.474E-09-0.596E-09 0.349E-10 0.153E-09 0.399E-09-0.491E-09-0.446E-09 0.501E-09
0.509E-09-0.153E-09-0.931E-09 0.262E-09 0.233E-09 0.105E-08-0.466E-09-0.151E-08
Download