问题描述:

I'm sampling a guitar signal as part of a guitar tuning project.

The sampling (2048 Hz) is done in software using the arduino IDE on Galileo.

I have concerns that because the sampling isn't real-time , it may be fluctuating and creating bad data for the FFT that runs later in the program.

How would i go about checking the exact frequency of the samples to check if it is indeed causing the FFT to give back inconsistent data? And how would i fix this problem ? (it currently has an accuracy of +/- 2Hz which is unacceptable for a tuner)

Here's how i'm sampling incoming guitar signal:

 for (n = 0; n < 100; n++) // capture 100 data points

{

start = micros();

SigAmplitude = analogRead(Signal);

while (finish < start + (489)) //gives approx 2K Hz sample rate

{

finish = micros();

}

x[n] = (SigAmplitude - 512); //get rid of DC bias

y[n] = 0; // no imaginary part

}

相关阅读:
Top