KeithB wrote:KeithB wrote:Thanks xdebugx. Last question. I understand when your trying to reconstruct the frequency using half the value of numCrossing multiplied by the number of samples your buffer is per second. But how does 8000 fit into this.
For example if I was doing a zero crossings method on a tone that is only one second long and is passed directly to the for loop which calculates the numCrossing value as an array, to reconstruct the frequency would I have
Thanks very much.
Silly me, I figured this out. Looking at code too long really does not make things easier.
I got the 8000 from:
Your recording at 8khz so there should be 8000 samples per second. So:
frequency = (8000/buffersize) should give you the period of time for one buffer that we process.
frequency = (8000/buffersize) * (numCrossings/2); should give the period of time, times the number of crossings.
Is this wrong? Is counting the number of samples and multiplying by the number of crossings better?