Helvetica>2. Measure the microphone
input as a frequency value (kHz).
There are a number of ways to determine the incoming frequency each has
usual pros and cons. They are,
1. FFT or Fast Fourier Transform. This is from all the research that
I've done the
best and most accurate way to archive what you want. However the main
is that I have not been able to get a working FFT routine going in FB.
This to be
honest could well be my fault. Ted was kind enough to send me a
but as I say I have been unable to get it working in FB. With Ted's
would be only too happy to send you a copy. I'm sure there are a few
people on the
list that would be interested in this. FFT is the method used by all
"professional," signal processing systems that I've come across. If you
examine complex waveforms this is the only way to go.
2. As you mentioned Zero Crossings is a possibility. Problems are that
what sample rate you are using you will not be able to get fast enough
a sample rate to
detect every single zero crossing. For example even at a sampling rate
you mac or any other sampler for that matter will still only be to take
a sample every
0.000002267 seconds. Simple question what happens if the zero crossing
between two samples, (which from experience I can tell you that 9 times
out of 10 it will)
answer you failed to detect it and your calculation goes to pot. To get
over this problem
a process called Interpolation can be used. This is a simple formula to
position of a Zero Crossing that happened between to sample points.
This method is not
very accurate nor very linear however you may decide that you can live
It is relatively straightforward to implement and I can give you more
this if you need it.
I guess my real questions would be what you need to used this for, how
it need to be ?
Have to you look at Digital Oscilloscope ? It's a really neat little
programme that will
either calculate the frequency of an incoming frequency or display it's
screen As Ted mentioned in his posting this is only any good if you are
trying to examine
a fixed input frequency. You can get a copy of
Digital Oscillscope from my WEB site
Hope this helps,