|
![](/i/fill.gif) |
andrel <a_l### [at] hotmail com> wrote:
> Your resolution can be computed by dividing your sample frequency by the
> number of samples.
Thanks for all of your input!
The number of samples is the sample frequency * the sample duration. So if the
sample duration is 1/10 second, then this is 44100 / (44100*1/10) = 10 Hz.
> > 1) Zero-pad the data pre-fft.
> It might sharpen your peaks as would using a Hamming or Hanning window.
> I think I would also use overlapping windows to increase the number of
> samples.
Overlap the windows? Do you mean something like Welch's method? I could
combine one sample with some adjacent samples as long as the duration is still
relatively short. I'll try that. Thanks.
> > 2) Use a feedback loop to control the frequency of a test wave.
> Me neither ;) I actually don't know what you mean.
That makes two of us. I just thought it might be possible to have an output
wave sin(omega*t) and dynamically adjust omega to match the signal. This was a
VERY rough interpretation of circuits that would do the same. This didn't give
me much to go on:
http://en.wikipedia.org/wiki/Frequency-locked_loop
> You know what frequency you are expecting, so you don't need to locate
> your maximum.
Ideally I wouldn't know in advance. I play a note on the piano and it locates
the nearest key and tells the error. This is how most musical tuners work.
> > Count zero-crossings? (Not robust for noisy signals?)
> depends on the bandwidth of the filter. Can be very robust. ...
> BTW how are you going to count
> exactly 93.2328 crossings with your 10 updates per second?
I guess you'd have to take into account the exact time for the first and last
crossing. That was my fear, though, that you'd get spurious crossings from
even slightly higher harmonics.
> You may want to have a look at phase locked loops, because you can
> digitize the voltage that drives the frequency.
Maybe that would be wise. I'll see what I can find.
> > or other more sophisticated tools for this purpose?
> I think you can buy them, at least I knew them for guitars... Yep, you
> can find them by googling. Not as much fun as building one oneself though.
Certainly not! As an update, I used PortAudio, OpenGL, and FFTW to put a
spectrum on top of a keyboard. You can follow some of the Chopin nocturnes
pretty well, but it doesn't pick up low frequencies well. As for my sister's
piano, it looks to be at least fifty cents low, but it still plays just fine!
- Ricky
Post a reply to this message
|
![](/i/fill.gif) |