Here is the comparison of my Elementary Fourier AFL analysis and FFT usual procedure. The sample was 921 bars of the Nikkei smoothed RSI. The error is decreased and, the most important, the fundamental period is more expressive.
You may see now the FFT comparison and the results. The concept of my Elementary Fourier analysis is a bit different.
What is complicated, the concept or the code ? The concept, ie the sinusoidal analysis of a non-periodic function is quite common in theoretical and applied maths/engineering etc The code is not bad, some friend may give a shorter one via C++ translation [if he comes to some result, I will let you know...] Using Amibroker 4.50 in a PIII/800, 64MB RAM, it takes ~8sec for a 1000bar history. FFT is quite faster but not that accurate.
Note also that the described procedure is innovative and unique in the T/A literature, as far as I know. The statistical softwares usually include FFT [or DFT] but their use is limited, inaccurate, work with 2^n series [512, 1024, 2048, ... bars], suffer from the end-point effect and, practically, are not designed for T/A applications.
Here is another comparison of the EFA [Elementary Fourier Analysis] versus the FFT [Fast Fourier Transformation]. In FFT I used the 7 most significant terms, filtering out the amplitude>0.05. In EFA I used the fundamental period P and the harmonics P/2, P/3, P/4 and P/5. The visual [and the detailed] comparison is obvious. Since FFT prefers 2^n bars [256, 512, 1024 etc] it has a lot of problems after the first 512 bars. [my sample was an 921-bar smoothed Nikkei RSI] Dimitris Tsokakis [I used DaDisp_SE2000 for FFT and Amibroker 4.50 for EFA ]