<< Chapter < Page | Chapter >> Page > |
It is possible to modify this algorithm to allow entering the data in forward order rather than reverse order. The difference [link] becomes
if [link] becomes
for . This is the algorithm programmed later.
One of the reasons the first-order Goertzel algorithm does not improve efficiency is that the constant in the feedback or recursive path iscomplex and, therefore, requires four real multiplications and two real additions. A modification of the scheme to make it second-order removesthe complex multiplications and reduces the number of required multiplications by two.
Define the variable so that
This substituted into the right-hand side of [link] gives
Combining [link] and [link] gives the second order difference equation
which together with the output [link] , comprise the second-order Goertzel algorithm where
for initial conditions .
A similar development starting with [link] gives a second-order algorithm with forward ordered input as
with
and for .
Note that both difference [link] and [link] are not changed if is replaced with , only the output [link] and [link] are different. This means that the polynomial may be evaluated at a particular and its inverse from one solution of the difference [link] or [link] using the output equations
and
Clearly, this allows the DFT of a sequence to be calculated with half the arithmetic since the outputs are calculated two at a time. Thesecond-order DE actually produces a solution that contains two first-order components. The output equations are, in effect, zeros thatcancel one or the other pole of the second-order solution to give the desired first-order solution. In addition to allowing the calculating oftwo outputs at a time, the second-order DE requires half the number of real multiplications as the first-order form. This is because thecoefficient of the is unity and the coefficient of the is real if and are complex conjugates of each other which is true for the DFT.
Analysis of the various forms of the Goertzel algorithm from their programs gives the following operation count for real multiplications andreal additions assuming real data.
Algorithm | Real Mults. | Real Adds | Trig Eval. |
Direct DFT | |||
First-Order | |||
Second-Order | |||
Second-Order 2 |
Timings of the algorithms on a PC in milliseconds are given in the following table.
Algorithm | ||
Direct DFT | 4.90 | 19.83 |
First-Order | 4.01 | 16.70 |
Second-Order | 2.64 | 11.04 |
Second-Order 2 | 1.32 | 5.55 |
These timings track the floating point operation counts fairly well.
Goertzel's algorithm in its first-order form is not particularly interesting, but the two-at-a-time second-order form is significantlyfaster than a direct DFT. It can also be used for any polynomial evaluation or for the DTFT at unequally spaced values or for evaluating afew DFT terms. A very interesting observation is that the inner-most loop of the Glassman-Ferguson FFT [link] is a first-order Goertzel algorithm even though that FFT is developed in a very different framework.
In addition to floating-point arithmetic counts, the number of trigonometric function evaluations that must be made or the size of a table to storeprecomputed values should be considered. Since the value of the terms in [link] are iteratively calculate in the IIR filter structure, there is round-off error accumulation that should be analyzed in anyapplication.
It may be possible to further improve the efficiency of the second-order Goertzel algorithm for calculating all of the DFT of a number sequence.Perhaps a fourth order DE could calculate four output values at a time and they could be separated by a numerator that would cancel three of thezeros. Perhaps the algorithm could be arranged in stages to give an operation count. The current algorithm does not take into account any of the symmetries of the input index. Perhaps some of theideas used in developing the QFT [link] , [link] , [link] could be used here.
One stage of the QFT can use the symmetries of the sines and cosines to calculate a DFT more efficiently than directly implementing the definition Multidimensional Index Mapping: Equation 1 . Similar to the Goertzel algorithm, the one-stage QFT is a better DFT algorithm for arbitrary lengths. See The Cooley-Tukey Fast Fourier Transform Algorithm: The Quick Fourier Transform, An FFT based on Symmetries .
Notification Switch
Would you like to follow the 'Fast fourier transforms' conversation and receive update notifications?