title: FFT analysis with JavaScript: How to find a specific frequency?
body: <p>I've the following problem:
  I analyse audio data using javascript and FFT. I can already write the FFT data into an array:</p>
  
  <pre><code>audioCtx = new AudioContext();
  analyser = audioCtx.createAnalyser();
  source = audioCtx.createMediaElementSource(audio);
  source.connect(analyser);
  analyser.connect(audioCtx.destination);
  analyser.fftSize = 64;
  
  var frequencyData = new Uint8Array(analyser.frequencyBinCount);
  </code></pre>
  
  <p>Every time I want to have new data I call:</p>
  
  <pre><code>analyser.getByteFrequencyData(frequencyData);
  </code></pre>
  
  <p>The variable "audio" is a mp3 file defined in HTML:</p>
  
  <pre><code>&lt;audio id="audio" src="test.mp3"&gt;&lt;/audio&gt;
  </code></pre>
  
  <p>So far so good.</p>
  
  <p>My problem now is that I want to check if the current array "frequencyData" includes a specific frequency. For example: I place a 1000 Hz signal somewhere in the mp3 file and want to get a notification if this part of the mp3 file is currently in the array "frequencyData".</p>
  
  <p>In a first step it would help me to solve the problem when the important part of the mp3 file only contains a 1000 Hz signal.  In a second step I would also like to find the part if there is an overlay with music.</p>