Diagonal Matrices These are almost band matrices. Form of the matrix The matrix to invert in Weighted Fourier Series.doc is of the form (1) An,m A f n f m An m Sample numbers are in Periodic Array3.doc - SampleNumbers. Values in the upper right corner and the lower left corner are beyond –M/2 and M/2-1. The periodicity condition is that A[j+kM]=A[j]. For M=4, this requires that A[3] = A[-1], A[-3] = A[1] and that A[2] = A [-2]. In this case the matrix of indices becomes 0 1 2 3 0 1 2 1 1 0 1 2 1 0 1 2 (2) 2 1 0 1 2 1 0 1 3 2 1 0 1 2 1 0 In this specific case the indices are {-2, -1, 0, 1}. All other indices are reached by adding k4 until one of these is found. Defining the inverse A111 A12 1 A131 A14 1 A11 1 A22 1 A231 A24 1 A21 A21 1 A32 1 A331 A34 1 A31 A31 A411 A42 1 A431 A44 1 A41 The inverse is defined by M / 2 1 n M / 2 Am1,n An , j m , j A12 A13 A22 A32 A42 A23 A33 A43 A14 1 A24 0 A34 0 A44 0 0 0 0 1 0 0 (3) 0 1 0 0 0 1 (4) If A-1, like A is assumed to be a function of the coordinate differences, this becomes M / 2 1 n M / 2 A1 m n A n j j ,m (5) The original derivation took j =0 OriglDerOfAinv.doc. Define the transform pair of A over M points as iT m ti ; fm M T M / 2 1 1 a i A m exp j 2 f m ti (6) T m M / 2 T M / 21 a i exp j 2 f m ti N i M / 2 This requires that A[m+M]=A[m]. Then A m m n i M / 21 n j k T 2 M / 21 M / 21 1 a i exp j 2 a k exp j 2 j ,m (7) 2 N N M n M / 2 i M / 2 k M / 2 Evaluate the sum over n first T 2 M / 21 1 M / 21 jk mi M / 21 a i a k exp j 2 exp j 2 i k n j ,m (8) N n M / 2 M 2 i M / 2 k M / 2 The sum on n is Mi,k T 2 M / 21 1 M / 21 jk mi a i a k exp j 2 i ,k j ,m M i M / 2 N k M / 2 So that the sum on k is easy to evaluate, leading to j m i T 2 M / 21 1 a i a i exp j 2 j ,m M i M / 2 N For a-1[i]=1/(T2 a[i]), this is satisfied. This is the equation used to test the inversion in MatInvFFT.doc The –T/2 to T/2 range is treated in ..\Fourier\Symmetric range.doc The zip ..\Fourier\for\symfft.zip contains the relevant fft code. This code is modified here to have input from an unformatted file and output to an unformatted file . Operations required Using 1 N / 21 A f m exp j 2 f m t j T m N / 2 1 a 1 t j N / 21 T A f m exp j 2 f m t j a t j (9) (10) m N / 2 Or 1 1 exp j 2 f m t j (11) A1 f m M j M / 2 N / 21 A f m exp j 2 f m t j m N / 2 This is an FFT from A to a, then a division and finally an FFT from a-1 to A-1. The time required goes as 2Mlog(M) M / 2 1