Why is integer k used for Goertzel algorithm?

28 Views Asked by At

When doing frequency detection (dtmf for example), the Goertzel algoritmhm is commonly used. One precomputes a number of parameters for subsequent use. One of these parameters is usually called k and is just the frequency of interest/sampling frequency * bin size.

This parameter is then rounded to nearest integer, before it is used to calculate a few other parameters.

Now, my question is why we round k? In the actual calculations, we're using a cosine(2 * Pi * k/bin size) so we are not gaining any speed by rounding k before applying the cosine (the result of the cosine will still be a float/double/whatever your language uses for rather high precision number).

0

There are 0 best solutions below