POV-Ray : Newsgroups : povray.off-topic : Frequency locked loop? : Re: Frequency locked loop? Server Time
6 Sep 2024 01:25:20 EDT (-0400)
  Re: Frequency locked loop?  
From: andrel
Date: 16 Mar 2009 13:57:22
Message: <49BE92EE.6080707@hotmail.com>
On 16-3-2009 16:49, triple_r wrote:
> andrel <a_l### [at] hotmailcom> 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.

<slaps head> Sorry, apparently problems with concentration yesterday.

> 
>>> 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

That refers yo the PLL as the main article. Anyway it assumes you know 
the frequency.

>> 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.

One thing you might do when you do know what string you will be working 
on is adjusting the sampling frequency so that the one you are looking 
for exactly fits.
When trying to fit powerline interference if it does not fit the 
sampling I use another trick. (powerline is 50Hz here, but my main AD 
system is 2048 Hz and even when it would have been 2000.000Hz the 
interference would still be often a fraction because it is slightly 
varying in time). What I do is not use an fft but compute a match with a 
sine and cosine of the fractional frequency over an interval that is as 
close as possible to an integer number of that sine. I.e. for your A4# 
at 44100Hz and taking roughly 10 updates per second, youd'd have 46.6164 
  cycles. Which explains the why you'd have a somewhat broadened peak. 
If you take eg. 4446 samples you should have nearly 47 complete cycles. 
(all modulo computational errors, I have the same problem as yesterday 
only slightly different)


>>> 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!

You apparently do not have absolute pitch.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.