Here is a more complete explanation of FFT === hn= time values Hk= frequency values Hk= Sum[k=0 to N-1] hn *Exp[-2*Pi*i*(k*n/N)] hn= (1/N)*Sum[n=0 to N-1] Hk *Exp[+2*Pi*i*(k*n/N)] There must be 2^N points, 8 or above. ======== We will work with an 8 point FFT problem. | 0 0 0 0 0 0 0 0 | | 0 1 2 3 4 5 6 7 | | 0 2 4 6 8 10 12 14 | | 0 3 6 9 12 15 18 21 | | 0 4 8 12 16 20 24 28 | | 0 5 10 15 20 25 30 35 | | 0 6 12 18 24 30 36 42 | | 0 7 14 21 28 35 42 49 | Assome an arbitrary math function 'TIM' << {} 'G' STO 0 'X' STO 'Pi/4' 'P' STO WHILE X 8 < REPEAT ' 2 + 0.9 * Sin(X*P) + 0.8 * Cos(X*P) + 0.7 * Sin(2*X*P) + 0.6 * Cos(2*X*P)' EVAL 'Q' STO G Q + 'G' STO X 1 + 'X' STO END G >> Time sequence of amplitude of curve G ={ (3.4) (3.902) (2.3) (1.37) (1.8) (1.49) (.5) (1.22) } (a,b)=a + b * i Data giving amplitude of each frequency. [ (16,0) (3.2, -3.6 ) ( 2.4, -2.8 ) (0,0) (0,0) (0,0) ( 2.4, 2.8 ) ( 3.2, 3.6 ) ] DC CIS X*P CIS 2*X*P N= number of points=8 Interpret it this way 16/8 = 2 = DC value of equation = 16/N 3.6/4 = 0.9 = coefficient of Sin[X] 4=N/2 3.2/4 = 0.8 = coefficient of Cos[X] 2.8/4 = 0.7 = coefficient of Sin[2*X*P] 2.4/4 = 0.6 = coefficient of Cos[2*X*P] 0/4 = 0 = coefficient of higher harmonics =========== Compute Second term U=(-Pi * i / 4) n=0 3.4 *Exp[0*U)=3.4 n=1 3.902*Exp[1*U)=(2.75,-2.75) n=2 2.3 *Exp[2*U)=(0,-2.3) n=3 1.37 *Exp[3*U)=(-.96,-.96) n=4 1.8 *Exp[4*U)=(-1.8,0) n=5 1.49 *Exp[5*U)=(-1.05,1.05) n=6 0.5 *Exp[6*U)=(0,0.5) n=7 1.22 *Exp[7*U)=(.869,.869) ------------- (-3.2,-3.6) Compute third term n=0 3.4 *Exp[0*U)=3.4 n=1 3.902*Exp[2*U)=(0,-3.9) n=2 2.3 *Exp[4*U)=(-2.3,0) n=3 1.37 *Exp[6*U)=(0,1.37) n=4 1.8 *Exp[8*U)=(1.8,0) n=5 1.49 *Exp[10*U)=(0,-1.49) n=6 0.5 *Exp[12*U)=(-.5,0) n=7 1.22 *Exp[14*U)=(0,1.22)) ------------- (2.4,-2.8) Compute fourth term n=0 3.4 *Exp[0*U)=(3.4,0) n=1 3.902*Exp[3*U)=(-2.759.-2.759) n=2 2.3 *Exp[6*U)=(0,2.3) n=3 1.37 *Exp[9*U)=(.969,.969) n=4 1.8 *Exp[12*U)=(-1.8,0) n=5 1.49 *Exp[15*U)=(1.059,1.059) n=6 0.5 *Exp[18*U)=(0,-.5) n=7 1.22 *Exp[21*U)=(-0.869,0.9860)) ------------- (0,0) G=[(3.4,0) (3.902,0) (2.3,0) (1.37,0) (1.8,0) (1.498,0) (.5,0) (1.23,0)] ======= Compute FFT from G by running program WW. 'WW' << CLEAR '-0.25*Pi*i' 'U' STO 0 'V' STO DO R V 1 + 'V' STO UNTIL V 7 > END 8 ->LIST 'ZZZ' STO ZZZ >> 'R' << {(0.0)} 'S' STO 0 7 FOR K G K 1 + GET U K V * * EXP * S + 'S' STO S sigmaLIST 'ZZ' STO 1 STEP ZZ >> ZZZ = { (16,0) (3.2,-3.6) (2.4,-2.8) (0,0) (0,0) (0,0) (2.4,2.8) (3.2,3.6} ] This is harmonic data First = 16 which 16/N = 16/8 = 2.0 = DC value of time sequence equation. Last group of numbers 3.6/4 = 0.9 = Coef of Sin(P*X) 3.2/4 = 0.8 = Coef of Cos(P*X) 2.8/4 = 0.7 = Coef of Sin(2*P*X) 2.4/4 = 0.6 = Coef of Cos(2*P*X) ========= Do INVERSE FFT 'YY' << CLEAR '0.25*Pi*i' 'UU' STO 0 'V' STO DO RR V 1 + 'V' STO UNTIL V 7 > END 8 ->LIST '.125 * RE ABC' STO ABC 0.125 * RE 'ABC' STO ABC >> 'RR' << {0,0)} 'S' STO 0 7 FOR K ZZZ K 1 + GET UU K V * * EXP * S + 'S' STO S sigmaLIST 'ZZ' STO 1 STEP ZZ >> See { 3.4 3.902 2.3,0 1.37 1.8,0 1.497 .5,0 1.229, } This is the amplitude vs time data initially created. ===