Goertzel Algorithm
Goertzel Algorithm
2𝜋𝑘
1 − 𝑒 𝑖 𝑁 𝑧 −1
𝐻𝑘 (𝑧) =
2𝜋𝑘 −1
1 − 2 cos ( ) 𝑧 + 𝑧 −2
𝑁
For i = 0, 1, …, N – 1
2𝜋𝑘
𝑞𝑖 = 𝑥𝑖 + 2 cos ( 𝑁
) 𝑞𝑖−1 − 𝑞𝑖−2 where 𝑞𝑣 = 0 when 𝑣 < 0.
For i = N
𝑞𝑁−1 𝑞𝑁−2
𝑞𝑁−1 = 𝑁
, 𝑞𝑁−2 = 𝑁
2𝜋𝑘
𝑞𝑁 = 2 cos ( ) 𝑞𝑁−1 − 𝑞𝑁−2
𝑁
2𝜋𝑘
𝑦𝑁 = 𝑞𝑁 − 𝑒 𝑖 𝑁 𝑞𝑁−1
or
2𝜋𝑘
𝑅𝑒(𝑦𝑁 ) = 𝑞𝑁 − cos ( ) 𝑞𝑁−1
𝑁
2𝜋𝑘
𝐼𝑚(𝑦𝑁 ) = sin ( ) 𝑞𝑁−1
𝑁
2𝜋𝑘
𝐴𝑚𝑝𝑘 = 𝑞𝑁 2 + 𝑞𝑁−1 2 − 2 cos ( ) 𝑞𝑁 𝑞𝑁−1
𝑁
For trigonometric form Discrete Fourier Transform, amplitude is equal to square root of the
sum of squares of real and imaginary parts of the DFT coefficient; that is