05-18-2009 01:59 AM
I am trying to build a labview program that can tune the frequency of a function generator to a user specified frequency.I am hoping that the tuning tolerance be better than 1 percent.Only want to tune between 1 and 40KHZ. Should have one analogue input in order to read the frequency and one analog output to control the frequency.
Any pointers ? Any ideas ? Any source code or modules that I can build up on ?
Thanks in advance for your help//
05-18-2009 08:06 AM
05-18-2009 10:22 AM
What function generator are you talking about? Are you using a DAQmx card as a function generator, or are you trying to control a stand-alone instrument.
DAQmx cards run off of a 20 MHz time base so that will define your resolution. A 40kHz signal take 500 clock cycles for one signal cycle. The next lower step down will take 501 clock cycles, and that would equate to a 39.99216kHz signal which should meet your specification.
05-18-2009 10:44 AM
05-18-2009 10:55 AM
05-18-2009 11:12 AM - edited 05-18-2009 11:13 AM
So you want to vary the VCF input on the function generator until its output is the right frequency as measured by the DAQ card?
To get 1% tolerance, that means you have to differentiate between 1 kHz and 1.01 kHz. This requires a frequency step size of 10 Hz. To get this resolution, you would have to perform a FFT of 0.1 seconds of data. To get a maximum of 40 kHz, you would have to sample at a minimum of 80 kHz. This means performing an 8000 point FFT repeatedly.
To get this to work you need to design an adaptive filter that takes the FFT peak location and compares it to the desired location and uses this as the feedback to set the voltage to the VCF of the function generator. This would be difficult unless you have done something similar in the past.
You might try to create a lookup table by feeding voltages into the VCF and using the 8000 point FFT to determine which voltage corresponds to which frequency. See what the curve looks like and then use some interpolation to get specific values from the table.
05-18-2009 10:11 PM
This is a bit advanced stuff for me...Any ways I could get a pointer or a simple source to build up on..I have been using labview for 6 months but never have tried to do something this advanced...
Really apprciate your help...
05-19-2009 08:08 AM