AurioTouch & FFT for instrument tuner

I am trying to write a simple tuner (no, not making another application for the tuner), and I am looking at the source of the AurioTouch example (did anyone try to comment on this code?).

My concern is that aurioTouch does not seem to work very well when viewing the frequency domain graph. I play one note on an instrument, and I do not see a beautifully ordered small set of frequencies with one string peak at the corresponding frequency of the note.

Has anyone used aurioTouch to find out if the underlying code is working or is it a rough code?

Other options that I have are to use FFTW or KISS FFT. Does anyone have experience with them?

Thank.

+3
iphone fft audio
Sep 18 '09 at 10:17
source share
4 answers

FFTs use frequency bins, and the bin frequency is based on FFT parameters. To find a frequency, you need to record it with a frequency of at least twice the highest frequency present in the sample. Then find the time between cycles. If this is not a pure frequency, it will of course be more difficult.

+2
Sep 20 '09 at 15:10
source share

You are expecting something wrong!

No library error

Regardless of whether the library creates it correctly or not, you are looking for a pattern that rarely exists in real sounds. Only an ideal sine wave generated electronically will cause a discrete discrete signal to appear in frequency. graph. If you do not believe this, try running the “spectrum analyzer” visualization in winamp or media player. This is not so much a PC error.

Real Sound Waves - Complex Animals

Depict a sawtooth or square wave in your brain eye. these sharp turns - angles or points on the wave, are like tons of higher harmonics on an FFT or even a real Fourier. And if you have ever seen a real “square wave / sawtooth” on the sight or even a “sinusoidal wave” created by the tool that was supposed to create a sinusoid, look at all the sharp corners and cracks only ONE note (if you don’t have a frame, just zoom in on the courage - the more you zoom in, the higher the notes you look at). Yes, these deviations are considered frequencies.

It is difficult to tell the difference between a single note and an entire orchestra, sometimes in spectral analysis.

But I hear solitary notes!

So how does the ear do it? He considers the whole waveform. Then your lower brain lies in your upper brain about what constitutes an input: one note, not a mess of overtones.

You cannot do it as completely, but you can get closer to it through "training."

Approximation: the creation of some skills

PLAY the notes on the instrument and “save” the frequency graph. Do this for notes in several frequency ranges or, better, all notes.

Then interpolate notes to fill in the blanks (1/2 or 1/4 steps) by multiplying the saved charts for this tool by 2 ^ (1/12) (or 1/24 by 1/4 steps, etc.).

Define how to store them in a rapidly changing data structure, such as BST or trie. Only he would have to return "how close is this account." He would have to identify the match through the proportions of frequencies, as well as if he came in different volumes.

Using smarts

The next time you look for a note from this tool, just take a “heard” frequency graph and find it in this data structure. You can record several instruments that form various waveforms and look for them too. If there are background sounds or a few notes, make the closest match. Then, if you want to identify other notes, "subtract" the found frequency diagram from the sample and rinse, repeat the repetition.

He will not work with your voice ...

If you've ever tried to tune yourself by drinking a guitar tuner, you will find out that tuners are not so smart. Of course, some instruments (esp voice) really float around the field and generate an ever-changing waveform (even without singing).

What are you trying to accomplish?

You didn’t need to fully take this fantasy for a “simple” tuner application, but if you do not use only one tuner application, I assume that you really want to identify notes (for example, maybe you want to automatically generate midi files from songs on the radio ; -)

Good luck. I hope you find a library that does all this stuff instead of collapsing your own.

Change 2017

Take a look at this web page: http://www.feilding.net/sfuad/musi3012-01/html/lectures/015_instruments_II.htm Well down, there is a spectral analysis of various organ tubes. There are many, many overtones. You can find them - with enough work - if you first train your application with them (just like telling a child, "this is what the clarinet sounds like ...")

+9
Jul 15 '10 at 1:10
source share

aurioTouch looks weird because the frequency axis is on a linear scale. It is very difficult to interpret the FFT output when the x axis is something other than the logarithmic scale (traditionally log2).

If you cannot use aurioTouch integer-FFT, check out my library: http://github.com/alexbw/iPhoneFFT

It uses double precision, supports several types of windows and implements the Welch method (which should give you more stable spectra when viewed over time).

@zaph, FFT computes the true Discrete Fourier Transform. This is just an efficient algorithm that uses a bit representation of digital signals.

+4
Dec 05 '09 at 19:48
source share

I use Ooura FFT to calculate the FFT of the accelerometer data. I do not always get the right spectrum. For some reason, the Ooura FFT produces completely incorrect results with spectral values ​​of the order of 10 ^ 200 at all frequencies.

0
Mar 17 '10 at 15:25
source share



All Articles