Accuracy of log sweeps

Almost every modern function generator uses DDS and offers a log sweep function. I want to know how accurate the log part is: eg. if I sweep from F1 to F2 in time TS seconds then the frequency at any given instant, t, should be: F1 *(k^t) where k = (F2/F1)^(1/TS)

I can't find any reference, in the specs of at least a dozen function generators, to the error in the frequency.

Anyone seen a spec, or have any idea of likely error or even how much it might matter in everyday use.

I'm interested because I'm working on an embedded function generator capability in a test system and I have to generate such sweeps digitally in an FPGA based DDS. Accuracy of the logness is roughly inversely proportional to the area of FPGA used.

Michael Kellett

Reply to
MK
Loading thread data ...

[...]

[...]

For the properly designed generator, the accuracy of instantaneous phase along the sweep should be determined by the accuracy of the generator clock.

That depends on the Time x Bandwidth product of the sweep. You may have to do 64-bit or even more accurate math.

Vladimir Vassilevsky DSP and Mixed Signal Designs

formatting link

Reply to
Vladimir Vassilevsky

If it means anything, My rigol requires you to set the center frequency and I believe that menu is only there if you select LOG for the sweep, there is also a start and stop, of course. There is also a form of freq steps you can set.. So I think the log sweep should follow with the start, center and end freq settings.

That's my two cents worth!

Jamie

Reply to
Maynard A. Philbrook Jr.

That would be the case when generating a fixed frequency, i.e. there is a constant value that is added to the phase accumulator at each clock cycle.

Unless you can update the _addend_ register (by calculating new values in the fly or from a precalculed RAM buffer), you are going to get a staircase waveform approximating the wanted sweep.

Some RF DDS chips have only a serial input for the addend register and the serial clock might be much lower than the master clock, so it may take hundreds of master clock cycles, before a new value can be loaded into the added register, thus the DDS frequency is stable for that period of time and the frequency error depends of the steepness of ideal waveform at a particular frequency.

With a FPGA construction of your own, you might put also the addend register into a NCO loop, i.e. add a very small (frequency change) value at each master clock cycle into the addend register (which of course is added to the DDS main phase accumulator). This way the small frequency change rate register needs to be updated at a slower rate.

Reply to
upsidedown

If the sweep rate is relatively slow, frequency points could be interpolated so the log generator wouldn't have to be as pipelined.

That's a linear interpolation- could be calculated from two frequency points divided (shifted) by a factor of, say, 8. There might be better ways.

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward" 
speff@interlog.com             Info for manufacturers: http://www.trexon.com 
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

Of course, if you want to tailor it to a specific set of profiles, you can input the difference (read: finite differential) equation as logic and let it do its thing.

An exponential frequency sweep would be easy (addend(N) = addend(N-1) * rate constant), as would linear (constant difference) and quadratic (linear difference). And many other profiles. You could use chaotic equations for spread spectrum or encryption. Hmm, patent pending, you heard it here first. ;-)

One could select between these as a simple ALU, including one-shot initializations for standard programming methods. Then SPI or something and you're set.

Tim

--
Seven Transistor Labs 
Electrical Engineering Consultation 
Website: http://seventransistorlabs.com
Reply to
Tim Williams

Ideally, instantaneous phase should be correct at every sample along the whole sweep. No matter what waveform is. No matter how do you generate it.

Then approximate the phase in equiripple manner; so the phase error won't build up along the sweep.

thus the DDS frequency is stable for that

The goal is get the phase as accurate as it could be done within limitations of hardware.

VLV

Reply to
Vladimir Vassilevsky

This is very inaccurate. Precision is lost at every iteration.

The right way is calculating phase at every point as closed form equation.

Poor accuracy guaranteed.

VLV

Reply to
Vladimir Vassilevsky

Thanks for comments everyone. @upsidedown.... Since the DDS is in the FPGA I can update the phase increment every sample.

While I agree with Vlad that the *best* way would be to recalculate a closed form equation for each sample step the cost in FPGA area is excessive.

Spehro's linear interpolation looks OK at first but for a 1000 step look up table and a 3 decade sweep the peak error is about 6ppm and that seems a bit too rough. I cant see any ripply errors on my cheapo Rigol function generator.

Tim's repeated multiply is my current favorite. The multiplier is always of the form 1 + x where x is usually very small and can (by some restrictions on sweep width be guaranteed to never be >= 1. For a x2 sweep with 2.5e8 samples (my current worst case) you need to use at least 64 bit fixed point arithmetic but some cheating is possible because of the 1+x form of the multiplier. It's not too onerous in my case to go up to 96 bit maths which I'll do if I have to because I don't want the maths to limit the performance.

Michael Kellett

Reply to
MK

Integer math is exact. If you were thinking floating point, well... I don't know why you would?

Easy to specify start and end points (real number) and solve for nearby actual (integer) values the procedure will generate. If that's what you meant by precision or accuracy, then add more bits. You'll be using far more gates trying to compute a function from nothing each cycle, that would be ridiculous.

Is that not what the recurrence relation is? Often...by definition?

Are there any existing DDSs that do that? By definition...no.

Poor accuracy... replies?

Well, this is Usenet, so I'll give you that (note: reciprocity applies ;) ).

Tim

--
Seven Transistor Labs 
Electrical Engineering Consultation 
Website: http://seventransistorlabs.com
Reply to
Tim Williams

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.