How can you detect an audio frequency?
lardom
Posts: 1,659
I'm trying to design an object where an led will blink if a microphone detects a certain pitch. I see how a musical note could be transmitted with a counter configured for nco but detecting it is another matter.
Comments
...I think I'm thinking of this without considering background noise. Don't do this, I bet it won't work.
I'd be inclined to use a Fast Fourier Transform for this. The workings of that is hard to understand but using a ready made FFT object is quite easy.
My FFT object for the Prop is here :http://forums.parallax.com/showthread.php?128292-Heater-s-Fast-Fourier-Transform.
Ale has an FFT implementation here: http://propeller.wikispaces.com/FFT
Alternatively there is the Fast Hartley Transform which can also pull frequencies out of signals and should use a bit less space in your Prop:
http://forums.parallax.com/showthread.php?134261-Fast-Hartley-transform-%28interactive-demo-included%29
@groggory, I've found out an op amp is unnecessary. The "Microphone to VGA" object displays great waveforms even from a distance.
@Leon. I know that Goerztel uses frequencies but I don't have the experience to tweak PASM yet.
-Phil
If you know what frequency you want, then something like a (venerable) LMF100 in bandpass mode, would give good noise filtering and simple detection ?
The Prop can nicely generate the clock the LMF100 needs.
If you want to define that frequency to many digits, then a LMF100 into a Prop Pin, would check period more precisely.
-Phil