Periodic Array The fundamental equations are ME W n m X m R n m M B MB n ME (1) (2) MC M E M B 1 Note that MB is frequently less than 0, e.g MB = -Mc/2 and ME = Mc/2-1. MB n ME W n W p n W n M n ME (3) W n M n MB Sample set of numbers - This section is coded into winv.for which is called from Wfit.wpj. The code is described in ..\..\Fittery\Complex\WeightedFourierFit\WinvfitCode.doc This is for 3107 pts with err = 1e-5, w=1e10, centered in 4096 points with a beginning 494 points with w=0 and an ending 495 with w=0. >WFIT -B-2 -E1 The periodic array in one dimension Frequency Real Wp Imag Wp -0.669110E-01 -0.650957E+13 -0.199712E+11 -0.334555E-01 -0.896845E+13 -0.137574E+11 0.000000E+00 0.310700E+14 0.000000E+00 0.334555E-01 -0.896845E+13 0.137574E+11 The two d version Af mat 0.311E+14 0.000E+00 -0.897E+13-0.138E+11 -0.651E+13-0.200E+11 -0.897E+13 0.138E+11 -0.897E+13 0.138E+11 0.311E+14 0.000E+00 -0.897E+13-0.138E+11 -0.651E+13-0.200E+11 -0.651E+13-0.200E+11 -0.897E+13 0.138E+11 0.311E+14 0.000E+00 -0.897E+13-0.138E+11 -0.897E+13-0.138E+11 -0.651E+13-0.200E+11 -0.897E+13 0.138E+11 0.311E+14 0.000E+00 ALMf mat 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.566E+13-0.290E+11 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.399E+11 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.566E+13 0.290E+11 0.000E+00 0.399E+11 0.000E+00 0.000E+00 0.000E+00 0.000E+00 Afinv mat 0.569E-13 0.109E-15 0.319E-13 0.121E-15 0.303E-13 0.124E-15 0.319E-13 0.101E-15 0.319E-13 0.101E-15 0.569E-13 0.109E-15 0.319E-13 0.121E-15 0.303E-13 0.124E-15 0.303E-13 0.124E-15 0.319E-13 0.101E-15 0.569E-13 0.109E-15 0.319E-13 0.121E-15 0.319E-13 0.121E-15 0.303E-13 0.124E-15 0.319E-13 0.101E-15 0.569E-13 0.109E-15 ME ME W n m X m W n m W n m X m R n m M B p m M B winv.for Multiply by Wp-1(k-n) and sum on n p MB n ME (4) ME ME mM B n M B Wp1 k n Wp n m X m ME m M B X m ME ME W k n W n m W n m nM B 1 p (5) W k n R n 1 p nM B p MB n ME Define X p k ME W k n R n nM B 1 p (6) And Aˆ LM k , m ME W k n W n m W n m 1 p nM B p MB k m (7) The exact evaluation of A cannot be done by convolution owing to the fact that it is not periodic. winv.for To find X k ME X m Aˆ k , m X k LM m M B p (8) Or adding a 1 to the diagonal elements of ALM, so that ALM k , m k ,m ME W k n W n m W n m nM B 1 p p (9) Afinv * ALM F -0.669E-01-0.335E-01 0.000E+00 0.335E-01 R 0.118E+01-0.405E-05 0.000E+00 0.322E+00 I 0.271E-02 0.127E-02 0.000E+00-0.103E-02 F -0.669E-01-0.335E-01 0.000E+00 0.335E-01 R 0.172E+00 0.100E+01 0.000E+00 0.180E+00 I 0.285E-02 0.121E-02 0.000E+00-0.351E-03 F -0.669E-01-0.335E-01 0.000E+00 0.335E-01 R 0.180E+00-0.482E-05 0.100E+01 0.172E+00 I 0.388E-02 0.127E-02 0.000E+00-0.179E-03 F -0.669E-01-0.335E-01 0.000E+00 0.335E-01 R 0.322E+00-0.437E-05 0.000E+00 0.118E+01 I 0.354E-02 0.227E-02 0.000E+00-0.240E-03 So that (8) becomes ME m M B ALM k , m X k X p k (10) Iteration X it k X p k M / 2 1 M / 2 1 m M / 2 n M / 2 Wp1 k n W n m W p n m X it 1 m (11) For each value of m, the terms in the sum are different. The sum over W p is a convolution, but not the sum over W. For Wp-1(k-n)=k,n/W(0) 1 M / 2 1 X it k X p k W k m Wp k m X it 1 m W 0 m M / 2 (12) Note that for -M/2k-m<M/2 that the term in parenthesis is zero. Or M/2+k m > -M/2+k. The sum is not zero for m-M/2+k and for m >M/2+k k M / 2 W k m W p k m X it 1 m 1 m M / 2 X it k X p k M / 2 1 (13) W 0 W k m Wp k m X it 1 m m M / 2 k 1 1 1 Wk , n Wn , m W1,2 W1,2 S k .m S1.2 1 S 2,1 W2,1 W2,1 For k=-M/2, the first term is from -M/2 to -M or zero. The second term is from m=1 to M/2-1. For k=M/2-1, the first term is from M/2 to -1, and the second term is zero. There is a sum of ~ M/4 terms for each k, so that the time requires is M 2/4. To evaluate for the L terms in each corner requires 2*L*L/2 or L2 operations. Start with Xp X 2 k X p k X 3 k X p k M / 2 1 W k m W k m X m W 0 m M / 2 1 p p M / 2 1 W k m W k m X m W 0 m M / 2 p M / 2 1 (14) p M / 2 1 W k m W k m W k m ' W k m ' X m 0 1 W2 1 m M / 2 p p m ' M / 2 p This converges as 1/W[0], 1/(W[0])2 etc. The convergence works as long as the W difference is < W(0) which in our case is almost a given. Evaluation of Xp The equation for Xp is a convolution. #Xp X p k ME W k n R n nM B 1 p (15) ../../Fourier/DiscreteConvolution.doc (1.4) MC M E M B 1 X p k ME nM B R nWp1 k n 1 MC ME ki r i w i exp j 2 M i M B 1 p C (16) The sum, with the usual problem of locations, is returned by FFT. ..\WeightedFourierFit\for\Wfit.wpj