Thursday 16 April 2015

audio - Extending Goertzel algorithm to 24 kHz, 32 kHz and 48 kHz



I'm learning to implement Goertzel's algorithm to detect DTMF tones from recorded wave files. I got one implemented in python from here. It supports audio sampled at 8 kHz and 16 kHz. I would like to extend it to support audio files sampled at 24 kHz, 32 kHz and 48 kHz.


From the code I got from the link above, I see that the author has set the following precondition parameters/constants:


self.MAX_BINS = 8
if pfreq == 16000:
self.GOERTZEL_N = 210
self.SAMPLING_RATE = 16000
else:
self.GOERTZEL_N = 92
self.SAMPLING_RATE = 8000


According to this article, before one can do the actual Goertzel, two of the preliminary calculations are:



  1. Decide on the sampling rate.

  2. Choose the block size, N


So, the author has clearly set block size as 210 for 16k sampled inputs and 92 for 8k sampled inputs. Now, I would like to understand:



  1. how the author has arrived at this block size?

  2. what would be the block size for 24k, 32k and 48k samples?





No comments:

Post a Comment

readings - Appending 内 to a company name is read ない or うち?

For example, if I say マイクロソフト内のパートナーシップは強いです, is the 内 here read as うち or ない? Answer 「内」 in the form: 「Proper Noun + 内」 is always read 「ない...