I've often seen i my DSP book, that when they record a sound, they use a sample rate at 10khz or 8 khz, which makes sense since the fs is 2 times bigger than the sampling signals max freq.
What i don't understand is why they only take 205 samples, rather than 10000 samples or 8000 samples, wouldn't each sample be "unperiodic"??.. What is the magic behind the number 205 ???

EDIT: I know they aren't able to sample 8000 times here, but why not take 320 samples then?? than just 205??


Estimating DTMF Tones with the Goertzel Algorithm

The minimum duration of a DTMF signal defined by the ITU standard is 40 ms. Therefore, there are at most 0.04 x 8000 = 320 samples available for estimation and detection. The DTMF decoder needs to estimate the frequencies contained in these short signals.

One common approach to this estimation problem is to compute the Discrete-Time Fourier Transform (DFT) samples close to the seven fundamental tones. For a DFT-based solution, it has been shown that using 205 samples in the frequency domain minimizes the error between the original frequencies and the points at which the DFT is estimated.

Nt = 205; original_f = [lfg(:);hfg(:)] % Original frequencies original_f =


k = round(original_f/Fs*Nt); % Indices of the DFT estim_f = round(k*Fs/Nt) % Frequencies at which the DFT is estimated estim_f =


To minimize the error between the original frequencies and the points at which the DFT is estimated, we truncate the tones, keeping only 205 samples or 25.6 ms for further processing.

tones = tones(1:205,:);

  • $\begingroup$ Reference please? Where did you see that people only use 205 samples ?? $\endgroup$
    – Hilmar
    Commented Nov 9, 2013 at 23:02

1 Answer 1


The frequency of DFT bin centers is i*Fs/N, for integer i. Thus different N will create different arrays of frequencies. For some N, this will produce an array that has the lowest nearest bin center distance from the frequency set that you wish to measure (in thus case, a vector of DFT frequencies). According to the referenced document, for some standard sample rate, N=205 will produce that vector with the closest DFT bin centers to DFT frequencies.

Since each DFT bin has a Sinc shaped roll-off, the closer a bin frequency is to a desired measurement frequency, the lower the magnitude measurement error will be without needing further interpolation computation.

For N greater than 320, the DFT will have greater frequency resolution, but the time resolution gets worse and will overlap multiple tones, which creates greater ambiguity in which tone is being detected.

  • $\begingroup$ but why aren't they using 320 samples then ? $\endgroup$
    – Guest
    Commented Nov 10, 2013 at 11:13
  • $\begingroup$ How close are the dft bin centers to dtmf tone frequencies at N=320 ? Calculate it. $\endgroup$
    – hotpaw2
    Commented Nov 10, 2013 at 14:38
  • $\begingroup$ Round[(Round[697/8000*320]*8000)/320] = 700 The estimated freq. is closer to the one the one we want.. $\endgroup$
    – Guest
    Commented Nov 10, 2013 at 15:12
  • $\begingroup$ That's one point. You'll need more to compute the distance between the 2 vectors. $\endgroup$
    – hotpaw2
    Commented Nov 10, 2013 at 21:46
  • $\begingroup$ On what base is the number 205 choosen, If it's just to compute less, we could have choosen 100.. and still get values with distance between them?? Round[(Round[770/8000*100]*8000)/100] = 800 $\endgroup$
    – Guest
    Commented Nov 10, 2013 at 22:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.