Ehlers Discrete Fourier TransformThe Discrete Fourier Transform Indicator was written by John Ehlers and more details can be found at www.mesasoftware.com
I have color coded everything as follows: blue line is the dominant cycle, orange line is the power converted to decibels, and I have marked the other line as red if you should sell or green if you should buy
Let me know if you would like to see me write any other scripts!
Fouriertransform
FUNCTION: Goertzel algorithm -- DFT of a specific frequency binThis function implements the Goertzel algorithm (for integer N).
The Goertzel algorithm is a technique in digital signal processing (DSP) for efficient evaluation of the individual terms of the discrete Fourier transform (DFT).
In short, it measure the power of a specific frequency like one bin of a DFT, over a rolling window (N) of samples.
Here you see an input signal that changes frequency and amplitude (from 7 bars to 17). I am running the indicator 3 times to show it measuring both frequencies and one in between (13). You can see it very accurately measures the signals present and their power, but is noisy in the transition. Changing the block len will cause it to be more responsive but noisier.
Here is a picture of the same signal, but with white noise added.
If you have a cycle you think is present you could use this to test it, but the function is designed for integration in to more complicated scripts. I think power is best interrupted on a log scale.
Given a period (in bars or samples) and a block_len (N in Goertzel terminology) the function returns the Real (InPhase) and Quadrature (Imaginary) components of your signal as well as calculating the power and the instantaneous angle (in radians).
I hope this proves useful to the DSP folks here.
Low Frequency Fourier TransformThis Study uses the Real Discrete Fourier Transform algorithm to generate 3 sinusoids possibly indicative of future price.
I got information about this RDFT algorithm from "The Scientist and Engineer's Guide to Digital Signal Processing" By Steven W. Smith, Ph.D.
It has not been tested thoroughly yet, but it seems that that the RDFT isn't suited for predicting prices as the Frequency Domain Representation shows that the signal is similar to white noise, showing no significant peaks, indicative of very low periodicity of price movements.