Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you're just looking for a specific frequency then an FFT-based method is probably a bad choice for your particular application, for two reasons:</p> <ol> <li><p>it's overkill - you're computing an entire spectrum just to detect the magnitude at one point</p></li> <li><p>to get 3 ms resolution for your onset detection you'll need a large overlap between successive FFTs, which will require much more CPU bandwidth than just processing successive blocks of samples</p></li> </ol> <p>A better choice for detecting the presence or absence of a single tone is the <a href="https://en.wikipedia.org/wiki/Goertzel_algorithm" rel="nofollow noreferrer">Goertzel algorithm</a> (aka Goertzel filter). It's effectively a DFT evaluated at a single frequency domain bin, and is widely used for tone detection. It's <em>much</em> less computationally expensive than an FFT, very simple to implement, and you can test its output on every sample, so no resolution problem (other than those dictated by the laws of physics). You'll need to low pass filter the magnitude of the output and then use some kind of threshold detection to determine the onset time of your tone.</p> <p>Note that there are a number of useful questions and answers on SO already about tone detection and using the Goertzel algorithm (e.g. <a href="https://stackoverflow.com/questions/4456855/precise-tone-onset-duration-measurement/4461542#4461542">Precise tone onset/duration measurement?</a>) - I suggest reading these along with the Wikipedia entry as a good starting point.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload