+ Post New Thread
Results 1 to 19 of 19

5th February 2016, 03:49 #1
 Join Date
 Feb 2016
 Posts
 10
 Helped
 0 / 0
 Points
 653
 Level
 5
Constant precision frequency generator?
Hi,
I am looking for method of constant precision frequency generation in audio range 20Hz  20kHz with precision dF/F ~ 1E3. For example, for the set frequency 20kHz, the output should be in range 20'000+/20 Hz, and for set frequency 20Hz, the output should be within range 20+/0.02Hz. Can you advise on what approach should I use?
To exemplify the problem, using PWM, precision increases as dF/F ~ F  good for low frequency, not so much for high one. With DDS, precision behaves like dF/F ~ 1/F (good for high frequency).
Q: how to get constant accuracy over entire range: dF/F ~ const?

Advertisement

5th February 2016, 05:04 #2
 Join Date
 May 2015
 Location
 Melbourne, Australia
 Posts
 2,213
 Helped
 754 / 754
 Points
 13,005
 Level
 27
Re: Constant precision frequency generator?
Direct digital synthesis driven by a crystal oscillator will do all of that easily, and it will give you either square, triangle, or sine waves.
Something like an AD9837 perhaps, which is not an expensive chip.
http://www.analog.com/en/products/rf...oductoverviewLast edited by Warpspeed; 5th February 2016 at 05:11.
Cheers, Tony.

5th February 2016, 05:19 #3
 Join Date
 Feb 2016
 Posts
 10
 Helped
 0 / 0
 Points
 653
 Level
 5
Re: Constant precision frequency generator?
Tony,
Thank you for reply, but I am familiar with DDS. In this simple case 2020'000 Hz, to get 1E4 precision we need 32bit DDS already.
I hope there are other known solutions, as I don't want to invent a bicycle.

5th February 2016, 05:59 #4
 Join Date
 Nov 2012
 Posts
 3,148
 Helped
 777 / 777
 Points
 17,233
 Level
 31
Re: Constant precision frequency generator?
1e3 is not really a high precision. Conventional analog circuits can do the job if you pay attention to (i) regulate well the supply voltage (ii) regulate the temperature (iii) age the components (whatever that may mean).
We had a HP function generator that had a jumbo dial and a range switch. We connected a speaker to the output and check the frequency with a tuning fork! The good old days.

5th February 2016, 06:12 #5
 Join Date
 Feb 2016
 Posts
 10
 Helped
 0 / 0
 Points
 653
 Level
 5
Re: Constant precision frequency generator?
c_mitra,
I would like to implement it with uC or FPGA, and was thinking that there is some wellknown solution, as problem seems very common.

5th February 2016, 06:40 #6
 Join Date
 Nov 2012
 Posts
 3,148
 Helped
 777 / 777
 Points
 17,233
 Level
 31
Re: Constant precision frequency generator?
Using uC or other digital techniques, you can get highly stable frequencies (in NMR and ESR we need frequencies that are stable to 0.01Hz at 500 MHz) but they will not be continuously variable.

Advertisement

5th February 2016, 08:27 #7
 Join Date
 Feb 2016
 Posts
 10
 Helped
 0 / 0
 Points
 653
 Level
 5
Re: Constant precision frequency generator?
c_mitra,
Thank you for reply, it kinda reminded me the the old days, when I was actually doing ESR and NMR work. Now I am a hobbyist trying to understand how uC works and how to produce with it accurate tones with same precision over the large span. Some keywords may be helpful to stirr me in right direction.

5th February 2016, 08:29 #8
Awards:
 Join Date
 Apr 2014
 Posts
 15,768
 Helped
 3590 / 3590
 Points
 77,803
 Level
 68
Re: Constant precision frequency generator?
Hi,
As said before, I also agree that a DDS is what you need.
And for a 10E3 frequency resolution .... why do you think you need 32 bits?
For the NCO you need 14 bits for the 10E4... and extra 10bits for the 20Hz to 20kHz range.
It makes at least 24 bits....with 26..28 bits you should be on the save side. (For sure you need to adjust the range)
(But even 32 bits should be no problem when you build it in an FPGA, the NCO is mainly a simple adder)
Do you have additional requirements regarding THD or so?
Klaus

5th February 2016, 08:42 #9
 Join Date
 Feb 2016
 Posts
 10
 Helped
 0 / 0
 Points
 653
 Level
 5
Re: Constant precision frequency generator?
KlausST,
I have DDS programmed into FPGA, but was quite disappointed that it's relative accuracy drops at low frequencies as ~const/F. You have to add ~8bit on top of high frequency range to avoid phase jitter, which brings 24 bits you have calculated to 32 bits.
Again, my question is rather theoretical. Lacking background in electronics I just want to understand if any standard approach to this problem exists.

Advertisement

5th February 2016, 09:57 #10
Awards:
 Join Date
 Apr 2014
 Posts
 15,768
 Helped
 3590 / 3590
 Points
 77,803
 Level
 68
Re: Constant precision frequency generator?
Hi,
One can see it as a benefit, that the DDS has a constant frequency resolution. But for audio maybe a logarithmic solution has it´s improvements.
With a constant deltaf stepsize, you have absolute resolution. No relative reolution. This is a drawback at low frequencies.
But accuracy is different. The accuracy should be very cloase to +/ 1/2 LSB.
And the precision should be far better.
For sure it generates phase jitter. But i think (I´m not sure of) the jtter mainly depends on NCO input frequency, and not that much on NCO resolution. It also depends on sine lookup table resolution.. and if you use some interpolation between phase values in the lookup table.
You could improve phase jitter to certain frequencies, if there are any of special interest. Just try meet exactely the phase steps of the table at those frequencies.
****
besides DDS which uses the NCO with it´s drawback..
you could use a high frequency source and use integer dividers to get your DAC sampling frequency. And use a fixed table with the sine values.
The divider method has improvents in frequency resolution at lower frequencies. (n steps per octave)
You need a DAC that can operate with varying sample frequency.
Instead of the integer divider you coud use an external adjustable PLL (often FPGA inside PLLs are difficult to configure on the fly),
or try to implement a DLL (I think it operates similar to an NCO, so first check if this is really an improvement against DDS).
Klaus

5th February 2016, 10:38 #11
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 45,443
 Helped
 13826 / 13826
 Points
 260,228
 Level
 100
Re: Constant precision frequency generator?
You have to add ~8bit on top of high frequency range to avoid phase jitter, which brings 24 bits you have calculated to 32 bits.
I don't see what's the problem in making a 32 bit or even wider DDS generator, particularly in a FPGA design. DDS is clearly the standard solution you are asking for.

5th February 2016, 17:29 #12
 Join Date
 Feb 2016
 Posts
 10
 Helped
 0 / 0
 Points
 653
 Level
 5
Re: Constant precision frequency generator?
I know what is PLL, but what is DLL stands for?

5th February 2016, 17:31 #13
 Join Date
 Feb 2016
 Posts
 10
 Helped
 0 / 0
 Points
 653
 Level
 5
Re: Constant precision frequency generator?
What is "logarithmic solution"?

5th February 2016, 19:07 #14
Awards:
 Join Date
 Apr 2014
 Posts
 15,768
 Helped
 3590 / 3590
 Points
 77,803
 Level
 68
Re: Constant precision frequency generator?
Hi,
I know what is PLL, but what is DLL stands for?
What is "logarithmic solution"?
Maybe you have a stepsize of 1Hz, then you could generate 20Hz, 21Hz, 22Hz...so from 20Hz to 21 Hz there is a deviation of 5%
But you could generate 20000Hz, 20001Hz, 20002Hz.. the deviation from 20000Hz to 20001 Hz is only 0.005%
With logarithmic I meant how the musical scale is made. 440Hz is an A.. the next A is at 880Hz, the next is at 1760Hz...
So if you draw frequencies of the "A"s (or any other notes) of different ocatves in a logarithmic scale then they have equal distance.
From G to A in different octaves there is not a fixed frequency step size, but a fixed % step size.
The same is with the Eseries of resistors.
****
Correct me if I´m wrong.
To me it seems you rather need a constant "percentage" step size than a fixed frequency step size.
Klaus

5th February 2016, 19:43 #15
 Join Date
 Feb 2016
 Posts
 10
 Helped
 0 / 0
 Points
 653
 Level
 5
Re: Constant precision frequency generator?
KlausST,
Thank you for reply.
Exactly, to have dF/F = const, dF has to be proportional to F.
From the feedback I get feeling that there is no established solution, which may justify developing my own. I have no application in mind, this is just "theoretical" exercise which I want implement in Verilog.

5th February 2016, 19:52 #16
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 45,443
 Helped
 13826 / 13826
 Points
 260,228
 Level
 100
Re: Constant precision frequency generator?
You didn't yet tell what you expect from your own solution compared to a "wide" DDS design, except for saving a few logic cells in the DDS logic (and possibly spending the tenfold amount in a different place). Maximum jitter will be set by the system clock period, or you need analog PLLs to generate a continuously variable clock. And frequency resolution is just a matter of word width.
It's a different point to possibly use a logarithmic or whatsoever scaling for the frequency control word, but it doesn't change the above mentioned parameters of signal generation.

Advertisement

5th February 2016, 20:08 #17
 Join Date
 Nov 2012
 Posts
 3,148
 Helped
 777 / 777
 Points
 17,233
 Level
 31
Re: Constant precision frequency generator?
Yes, we need to start with 1 and keep on multiplying with 1.001 and wait till you reach 10. Multiply the series with 10 and get the next series for 10 to 100. Each series will have 2303 members (like the E96 series). Now you will have 10100, 1001000, 100010000, 10000100000  four series each with 2000 numbers. All these will be within 0.1% of each other. They will be discrete steps but will look linear on a log scale...

5th February 2016, 21:14 #18
 Join Date
 Feb 2016
 Posts
 10
 Helped
 0 / 0
 Points
 653
 Level
 5
Re: Constant precision frequency generator?
Actually, I am thinking of sequential combo PWMDDS, e.g. PWM feeding the sampling clock of DDS. If for PWM dF/F ~ F, and for DDS dF/F ~ 1/F, then overall precision of the system will be
dF/F ~ F * (1/F) = const. Question is how to divide frequency between PWM and DDS optimal way.

5th February 2016, 22:59 #19
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 45,443
 Helped
 13826 / 13826
 Points
 260,228
 Level
 100
Re: Constant precision frequency generator?
I presume, the term "pwm" in this regard has nothing to do with pulse width modulation but simply describes a programmable frequency divider.
I agree that a frequency divider can help to reduce the DDS width while keeping a certain relative resolution. Most likely, a binary prescaler would be sufficient. But it's a bad idea related to the analog outside because it requires to switch the antialiasing output filter together with the divider steps.
And as asked before, where's the actual advantage?
+ Post New Thread
Please login