Slightly larger section

advertisement
Slightly larger section
In fact MB could equal 125 and ME 128. Then MC = 4 and the expansion is of W[125] to
W[128] in terms of frequencies -3 through 0. In this case
R  m 
128
 W  m  n X n
m  125,128
(1.1)
n 125
Subtract 127 from the array elements of all entries – so that R[127] R[0]; W[127]
W[0] and X[127] X[0] so that (1.1) becomes
R  m 
1
 W  m  n X  n
m  2,1
(1.2)
n 2
Note that (1.2) contains W elements -2-1 = -3 through 1+2 = 3. Thus the matrix to invert
is from -4 to 3  8 terms – Note that W[-4] can be defined to be anything.
Form this inverse such that
3
 W  k  mW  m  n  
1
m 4
k ,n
(1.3)-- note that the minimum k and n of interest is -2 and
the maximum of interest is 1, but the sum involves potentially more terms. For m = -4
and n = 1, the value of W in (1.3) is W[-5]. For the inverse to work, we must have W[-5]
= W[3].
Multiply (1.2) by W-1[k-m] and sum m from -4 to 3. This requires a definition for R[-4],
R[-3]. R[2] and R[3]. These are defined by the values of
3
 W 1  k  m R  m 
m 4
1

n 2
k ,n
X  n   X  k  k  2, 1, 0,1
(1.4)
Equation (1.4) contains an argument -2-3 = -5 that is more negative than -4. This
becomes -5 + 8 = 3 owing to the periodicity of W-1. The term R[-4] is outside the range
of (1.1), but it is part of the general expression Periodic W.doc for the derivatives of the
derivatives of 2.
This contains a W[-5] that is not used in (1.2), but does appear in (1.3) – It was defined to
be periodic so that W[-5]=W[-5+8] = W[3]. W[-4] must be defined before W-1 can be
found.
Fundamentals
Equation 4.7 of ..\..\Fittery\Complex\WeightedFourierFit\WeightedFourierFit.doc
is the iteration equation. The terms Diffw and W are precisely defined. The equation is
relevant only for MB  m  ME
M
1 E
Diffw  DA,it 1 , f m     DA,it  n  DA,it 1  nW  m  n   0 M B  m  M E (2.1)
T nM B
With the specific example above Diffw  R[m], and DA,it[n] – DA,it-1[n]  X[n] so that
R  m 
128
 W  m  n X n
m  125,128
(2.2)
n 125
This equation need only be satisfied for the four values m = 125, 126, 127 and 128.
Subtract 127 from the array elements of all entries – so that R[127] R[0]; W[127]
W[0] and X[127] X[0] so that (2.2) becomes
1
 W  m  n X  n  R  m
m  2,1
(2.3)
n 2
W [2  2] W [2  1] W [2  0] W [2  1]  X  2  R  2
W [1  2] W [1  1] W [1  0] W [1  1]   X 1   R 1 

      

 

 (2.4)
X
0
R
0
W
[0

2]
W
[0

1]
W
[0

0]
W
[0

1]





 
 

 W [1  2]
W [1  1]
W [1  0]
W [1  1]   X 1   R 1 
Or
W [0] W [1] W [2] W [ 3]  X  2  R  2
W [1] W [0] W [1] W [ 2]  X 1   R 1 

      

 

 (2.5)
W [2] W [1] W [0] W [ 1]   X  0   R  0 
W [3] W [2] W [1] W [0]   X 1   R 1 

 

The values of W in (2.3) and (2.4) range from W[-3] through W[3]. These are
Fourier transforms of the weights for the various values of t
T N / 21
mi 

W  m 
w i  exp  j 2
(2.6)

 3 m  3
N i  N / 2
N

Extend the equation to include periodic W terms, by adding terms beyond m = -3. In
particular define
W  6   W   6  8   W  2 
W  5  W  5  8  W [3]
W  4  W  4  8  W [4]  0
W [4]  W  4  8  W  4  0
(2.7)
W 5  W 5  8  W  3
W  6  W  6  8  W  2
W  7   W  7  8  W  1
R  m 
3
 W  m  n X n
n 4
p
m  3,1
(2.8)
This solves as
X k  
3
 W  k  m R  m
m 4
1
p
(2.9)
Note however that each line of (2.8) contains an X[-4], X[-3], X[2] and X[3] that make
the equations true, but are unrelated to the solution used. Define these to be zero. Then
use (2.8) as a defining equation for R’s outside the range -2 to 1. That is
 W [0] W  1 W  2 W  3
0
W 3 W  2 W 1   0   R  4 




W [0] W  1 W  2 W  3
0
W 3 W  2    0   R  3 
 W 1


 W  2 W 1
W [0] W  1 W  2 W  3
0
W 3   X  2  Ro  2



 
W [0] W  1 W  2 W  3
0   X  1   Ro  1 
 W 3 W  2 W 1




W 3 W  2 W 1
W [0] W  1 W  2  W  3  X  0   Ro  0 
 0
W  3
0
W 3 W  2 W 1
W [0] W  1 W  2   X 1   R0 1 


 

0
W 3 W  2 W 1
W [0] W  1   0   R  2 
W  2 W  3
W  1 W  2 W  3
0
W 3 W  2 W 1
W [0]   0   R 3 

(2.10)
The values of R[-4], R[-3]. R[2] and R[3] need to be determined such that X[-4],
X[-3], X[2] and X[3] are zero.
R  4 
3
 W  4  n  X  n 
p
n 4
 W p  0 X  4  W p  1 X  3  W p  2 X  2  W p  3 X  1  W p  4 X  0  W p 3 X 1  W p  2  X  2 
 W p  2 X  2  W p  3 X  1  W p  4 X  0  W p 3 X 1
(2.11)
And
R  3 
3
 W  3  n  X  n 
p
n 4
 W p 1 X  4  W p  0 X  3  W p  1 X  2  W p  2 X  1  W p  3 X  0  W p  4 X 1  W p 3 X  2 
 W p  1 X  2  W p  2 X  1  W p  3 X  0  W p  4 X 1
(2.12)
And
R  2 
3
 W  2  n  X  n 
p
n 4
 W p  2 X  4  W p 1 X  3  W p  0 X  2  W p  1 X  1  W p  2 X  0  W p  3 X 1  W p  4  X  2 
 W p  0 X  2  W p  1 X  1  W p  2 X  0  W p  3 X 1
(2.13)
Note that this equation is identical to (2.3) for m = -2.
…
R  2 
3
 W  2  n X n
n 4
p
 W p  2 X  4  W p  3 X  3  W p  4 X  2  W p 3 X  1  W p  2 X  0  W p 1 X 1  W p 0  X  2  
 W p  4 X  2  W p 3 X  1  W p  2 X  0  W p 1 X 1
(2.14)
And
R 3 
3
 W 3  n  X  n 
p
n 4
 W p  1 X  4  W p  2 X  3  W p  3 X  2  W p  4 X  1  W p 3 X  0  W p  2 X 1  W p 1 X  2 
 W p  3 X  2  W p  4 X  1  W p 3 X  0  W p  2 X 1
Chi-square
 X  m X  m
2 

(3.1)
m M B
mM E
Ri  m  W  n  m X i  n  (3.2)
n
X i [ m] 

M B n M E
Wp 1  n  m Ro  n  
 W  n  m R  n 
1
n M B
nM E
p
i
(3.3)
 X o  m  X i  m
Form a summation X from a series of Ri’s, so that (3.1) becomes



    X o  m    i X i  m   X o  m     i X i  m  
m M B 
i
i


2

(3.4)
mM E
Set the derivative with respect to k equal to zero.

 2


   X o  m     i X i  m   X k  m   c.c.
 k m M B 
i

(3.5)
mM E
Define the matrices A and B
Bk   X o  mX k  m  c.c.
(3.6)
And
Ai ,k 
(3.7)
m M B
m M E

m M B
m M E
X i  m X k  m  c.c.

So that the equation for the alphas is
(3.8)
 Ai,ki  Bk
i
By changing alpha to
di  i  j i (3.9)
The c.c. ‘s in (3.6) and (3.7) can be dropped to yield the complex equation
 Ai,k di  Bk (3.10)
i
This may seem to have come full circle in solving a matrix equation for the d’s that is
formally similar to the original, but there are only a few terms in (3.10) whose purpose is
to handle over-relaxation and to control the iteration procedure.
Download