Sound capture (Part 2)

Part 12345

Understand PlainADC functions which allow analog signals sampling and PlainFFT functions which allow Fast Fourier Transform. Make sure to use the latest versions of these libraries (Please check this page if you are interested in the code.)

The purpose of the next coming posts is to exemplify the combined use of PlainADC and PlainFFT for acquiring and managing signals. Many applications result from this combination, from the most artistic up to the most scientific ones. The sophistication of these applications is mainly limited by the amount of memory from Arduino: 1 Kb on the ATMEAGA 168 and 2 Kb on the ATMEGA328. The most advanced applications will have to be executed off line on a PC or so after downloading the raw signal. Any way, the aim of this blog is to get to the limits of Arduino, so that we will restrict our applications to the processor’s specifications.

The idea here is to detect one specific tone from ambient noise. As music is played in front of the interface microphone, the user presses a button at a certain time (and tone) so that MicroTUN (this is the corny application’s name, standing for micro tune) will record the actual frequency spectrum. Once the button is released, MicroTUN will listen to the music and turn a status Led ON as soon as it will recognize the reference tone.

Next is a rough description of the process:

Within the setup:

  • Setup the data acquisition parameters
  • Set up the FFT parameters
  • Set up the serial comm. Port (for diagnostics)
  • Set user interface (Button and Led)

Within the loop

  • Acquire raw data (10 bits wide ad conversions)
  • Compute FFT
  • Clean up frequency spectrum
  • If the button is pressed, copy the actual spectrum buffer in the reference spectrum buffer
  • Compare actual spectrum to the reference spectrum
  • If the matching is above quality criteria, blink status led

So simple!

In the next posts, I will describe the different steps in more details. This series of posts will end up with the publication of MicroTUN code in the download area.

Next post on same subject

One Comment

  1. […] Next post on same subject Tags: Data acquisition, Measuring instruments, Sensors, Sound capture Comment (RSS)  |  Trackback […]

Leave a Reply

You must be logged in to post a comment.