Skip to main content

Endpoint flattening

The DFT assumes that the time domain sample is periodic and repeats. Suppose a price series starts at 400 and toggles and wobbles for 512 data samples and ends at the value 600. The DFT assumes that the price series starts at zero, suddenly jumps to 400, goes to 600, and suddenly jumps back to zero and then repeats. The DFT has to create all sorts of different frequencies in the frequency domain to try to achieve this kind of behavior. These false frequencies, generated to match the jumps and the high average price, mask the amplitudes of the true frequencies and make them look like noise.

Fortunately, this effect can be nearly eliminated by a simple technique called endpoint flattening.

Calculating the coefficients for endpoint flattening is simple. If x(1) represents the first price in the sampled data series, x(n) represents the last point in the data series, and y(i) equals the new endpoint flattening series then: