Hick
Hick

Reputation: 36394

How to compare a sound input with a pre-determined sound?

Elaborate:

Suppose I play a G on my guitar and my sound card has taken an input. How to make my computer recognize that it is G? (No constraints on programming language, though prefer Python or C)( Links to articles or certain ideas would help. No code snippets)

Upvotes: 8

Views: 679

Answers (3)

hotpaw2
hotpaw2

Reputation: 70673

Neither the Goertzel filter nor an FFT are good musical pitch estimators. The FFT is a frequency estimator, and peak spectral frequency is different from psycho-acoustic pitch (due to perceptual oddities and the physics of actual musical instruments, such as missing or weak fundamentals).

Search on stackoverflow for musical pitch estimation algorithms. There are a bunch.

Upvotes: 1

fnl
fnl

Reputation: 2239

If you only want to check for a few frequencies, the Goertzel algorithm might be simpler to implement. (And faster at runtime)

Upvotes: 0

Richard Green
Richard Green

Reputation: 2062

Use the Fast Fourier Transformation. Here's some code : http://www.codeproject.com/KB/audio-video/FftGuitarTuner.aspx

Upvotes: 0

Related Questions