Very stable audio oscillator?

po210

Member
2009-12-25 10:54 pm
Hi
I´m trying to measure temperature with my PC audio card. To do so, I have a 555 chip 0,5Khz oscillator, and a filter to change square wave into a sinusoidal one. A calibrated thermistor changes its resistence so oscillation frequency changes.I capture "sound" on my Linux machine.and use a special Linux library to extract "pitch" (main tone) from the signal in real time.It can easily detect small frequency changes due to temperature change.
But...I see my 555 has erratic frecuency changes of +/- 20Hz and more at higher frequencies.
So...do you know how a 500Hz stable audio oscillator can be built?.A Wien oscillator could do the job?
 

po210

Member
2009-12-25 10:54 pm
Thank you DF96.
My window is 256, but I´ve tested also 1024.I´m sampling at at 44100Hz with 16bit samples.Then, I take an average each 200 samples. If I use the same program to sample a 1khz wav file generated with a program, it perfectly matches the frequency within +-1Hz.
 
Last edited:
po210 said:
My window is 256, but I´ve tested also 1024.I´m sampling at at 44100Hz with 16bit samples.Then, I take an average each 200 samples.
I meant time window, but I guess I can estimate it from your figures. 256 samples at 44.1kHz means a sampling window of around 9ms, so each individual measurement could be out by about 110Hz. Averaging a regular set of measurements sounds fine, unless you are unlucky and still get an average which is way out.

Much better to sample more slowly. To get an accurate frequency measurement of 500Hz you need a window of at least a few seconds.

If I use the same program to sample a 1khz wav file generated with a program, it perfectly matches the frequency within +-1Hz.
Depending on exactly how you did this, you may be ensuring that the 'generator' and 'frequency meter' are always exactly in step with each other.