Function Generators Offer More Than Sine Waves

Your circuit prototype finally is complete, and now you need a signal source to test it. The function generator is a good choice. It can provide sine, square, and triangular waveforms from fractions of 1 Hz to many megahertz. Models with arbitrary waveform generator (Arb) capabilities are even more versatile.

Years ago, all function generators were based on voltage-controlled analog triangle-wave oscillators. A square-wave output was derived by a comparator that switched at the midpoints of the triangle. The triangle wave could be distorted by a diode-shaping network to provide a reasonably pure sine wave.

Low-cost analog generators still are available and may suit your needs. They are very easy to use and offer wide frequency and amplitude adjustments. Refinements such as a variable duty cycle allow you to generate pulses instead of square waves and change the shape of the triangle wave to a positive or negative ramp.

Digital generators develop waveforms from values stored in memory that are applied to a digital-to-analog converter (DAC). The commonly used synthesis techniques differ in detail, but generally it is necessary to filter the DAC output to improve the spectral purity of the intended wave shape. This is not necessary in analog generators, and ramps and triangle waves output from these instruments may have a much higher frequency range as a result.

The disadvantages of traditional analog designs include poor long-term stability and a limited suite of wave shapes. Some newer generators use digital techniques to lock the frequency of the voltage-controlled oscillator. Many instruments provide an external modulation input that improves flexibility. But, if you require highly repeatable test conditions and complex waveforms, a digitally synthesized function generator is the instrument of choice.

Digital Architectures

Memory Based

It’s easy to envision a system in which a DAC produces waveforms based on values stored in memory. If a complete cycle of the waveform is stored and a counter addresses the memory, the output waveform will accurately reflect the stored data. No points will be missed, and if the counter is driven by a crystal-controlled clock, the output frequency will have good stability.

This arrangement is the basis of the so-called true Arb, the ultimate in flexible function generators. In practice, high-speed operation is difficult. At low speeds, many points are needed to define a waveform with good resolution. As the speed increases, all those points must be accessed quickly. Today’s components support DAC sampling rates of at least 1 GHz. However, if 1,000 points are used to define a waveform, the highest output frequency is only 1 MHz.

Nevertheless, if a complex waveform must be used as a test stimulus, a memory-based Arb can generate it. A signal captured by a digital storage oscilloscope (DSO) can be downloaded to the Arb’s memory. Some Arbs allow you to define a waveform by entering an equation. Often, a software editing application is available that helps you to alter downloaded data or generate new waveforms.

(Click here for Function Generators Comparison Chart.)

“Users particularly value the ability to capture a signal and have an Arb replay it in a different environment, such as when testing receiver characteristics,” commented Sacha Veillette, a product manager at Gage Applied. “Difficult signals from wireless devices either can be simulated or captured in real settings and re-used in the lab to test the effectiveness of demodulating and error-correction algorithms.”

More sophisticated Arbs provide memory segmentation. These instruments allow you to separately define several waveforms and specify how they should be linked together. For example, up to 16 segments each can be looped from 1 to 32k times and the entire sequence up to 1M times.

Direct Digital Synthesis

The output frequency limitation of a memory-based Arb often is not as large a problem as it may appear. For example, if the sampling rate of the DSO used to capture a waveform is the same as an Arb’s output clock rate, there’s no need to worry about frequency response. The Arb can reproduce the original waveform at the original speed. However, generating a continuously variable, high-frequency pure sine wave is very difficult in a memory-based system.

An alternative approach, direct digital synthesis (DDS), can provide a huge range of closely spaced frequencies with the accuracy and stability of the reference clock. Key to the circuit’s operation is an N-bit phase accumulator that addresses a P-bit sine lookup table. As Figure 1 shows, an N-bit tuning word (T) is added to the phase accumulator output each clock cycle.1

A simple example helps to explain DDS operation. Assume that N = P = 10 and that one complete sine cycle is stored in the 1,024-location lookup table. If the phase accumulator output increments by one on each clock, then all the stored sine-wave values will be read out consecutively.

The frequency of the waveform is equal to the reference clock frequency divided by 1,024, the number of lookup entries in a complete sine cycle. On each clock, the output phase will advance by 360/1,024 = 0.3516 degrees.

What happens if the phase accumulator increments by five or 10 on each clock? Instead of data from contiguous addresses being read, every fifth or 10th value is output, resulting in a sine wave five or 10 times faster but with the same time resolution.

Because DDS systems are phase continuous, it isn’t necessary that T divide evenly into the number of memory locations. For example, if T = 5, every fifth point will be read out starting with point number 1 and going through point number 1,021. The next point will be number 2 because adding five to the phase accumulator causes it to overflow with a remainder of two. In this simple case where N = P, T always will be a whole number and only faster frequencies can be generated.

If N is larger than P, T also can take on decimal values less than one, making possible slower frequencies. In practice, N may be 42 or greater with perhaps the most significant 15 bits corresponding to P. This means that a single-cycle sine wave can be defined at 215 or 32,768 distinct phases 0.011 degrees apart. To increment the lookup table address on each clock cycle requires T to be equal to 2(N-P) or 227 = 134,217,738.

A large N provides extremely fine frequency resolution. If T is smaller than 2(N-P), more than one clock cycle is required to advance the sine-wave phase. In the limit, when T = 1, 242 clocks are required per cycle. The resolution of a DDS system with N = 42 and a clock rate of 40 MHz is 9.09 µHz.

On average, this statement is true. Instantaneously, it isn’t. Only if P = N = 42 can the instantaneous sine-wave output have a true 9-µHz resolution. Of course, it’s impractical to have extremely large values of P because that implies a vast amount of memory and impossible DAC performance. A large N maintains an accurate phase value. A practical, smaller P introduces errors.

For example, if T = 1.5 × 2(N-P), the lookup table addresses will alternately increment by one or two. The result is the correct average output frequency, but one that jitters cycle to cycle. For a cycle to be identical to the previous one, the 1-2-1-2-1-2-1··· addressing sequence would have to repeat in each cycle. Because three does not divide evenly into 1,024, successive cycles will be different.

T = 1.5 × 2(N-P) is just one value that causes a spurious spectral response because the N-bit phase word has been truncated to P bits. In general, the values of T that will cause maximum spurious spectral levels satisfy the relationship

GCD(T, 2(N-P)) = 2(N-P-1)
where: GCD = greatest common divisor of T, 2(N-P).

The tuning word with a 1 in bit position N-P-1 and zeros in all other less significant bit positions yields the worst-case spur level due to phase truncation.2 In other words, the worst-case spurious outputs occur for T = 1.5, 2.5, 3.5, 4.5··· × 2(N-P) because of the irregular way that the lookup table addresses are skipped.

For many applications, the effects of these DDS characteristics are small. In a function generator, an output filter smooths the DAC transitions and removes the spurious frequency components. In any case, the level of any spurs can be shown to be approximately 6.02 × P below the level of the tuning word frequency if N ≥ P + 4.

For our 15-bit example, the largest spur would be down by approximately 90 dB. Similarly, jitter can be very small in systems with a large value of N. On the other hand, the operation of a DDS system usually is unsuitable for arbitrary waveforms.

A very simple example illustrates the point. If N is larger than P and P = 3, only eight values are stored in the lookup table. Assume a pulse output is desired and the first two table positions have values of 1 and the rest are zero. For T = 1.5 × 2(N-P), the 1-2-1-2-1-2··· addressing sequence produces an output pattern of 10000 110000 10000 10000 110000···, where only every third pulse is the intended width.

A bigger problem occurs at T = 3. In this case, the output sequence is 100 100 00 100 100 00 100···, and the pulse completely disappears every third cycle.

Obviously, this example used a small value of P to exagerate the effect. Nevertheless, the effect is real and always will occur at high enough values of T relative to the number of lookup-table positions that correspond to a pulse.

Some DDS systems avoid this problem by restricting T to values of  2(N-P), 2(N-P-1), 2(N-P-2) ··· so that arbitrary waveforms only can be played back at their original rate or at 0.5× or 0.25× that rate. Generally, memory-based Arbs are required for these types of signals.

Rather than use a fixed-rate clock, these instruments change the output waveform frequency by altering the clock speed. Frequency accuracy may not be as good as that of a DDS generator with a fixed reference clock, but all lookup table locations are addressed at all speeds. Some Arbs use DDS to provide a variable but accurate clock to read out the stored waveform.

In the wide range of applications for which DDS-based generators are appropriate, they have the advantages of very fast switching and phase-continuous operation. For example, these capabilities suit them to communications testing, which is characterized by rapidly changing modulation.

Integrated circuits such as the Analog Devices AD9852 contain all the building blocks necessary to implement a complete DDS system. Registers for adding a phase offset or providing a phase increment can be updated on the fly, supporting FM or PM operation. A 12-bit multiplier ahead of the DAC allows amplitude modulation. To perform frequency shift keying (FSK), you can elect to switch between two phase increment registers.

This IC is used in cellular base stations and medical equipment as well as in other applications and provides much of the functionality of the NI PXI-5404 Function Generator. Brian Anderson, National Instruments’ (NI’s) product manager for high-speed digitizers and signal sources, said, “This commercial technology makes it possible for NI to create products that combine the advantages of PXI and virtual instrumentation with instrument-class performance. Analog Devices continues to invest in its line of DDS products with sample rates reaching 1 GS/s, greater device integration, and lower power consumption.”

Function-Generator Trends

As shown in the accompanying comparison chart, function generators are available with widely varying prices and performance. Categorizing them can be done in many ways, but separating those with Arb capabilities from those without is a good way to start.

If your application requires an Arb, carefully examine the specifications of those generators you think may be appropriate. In some cases, the table shows a model as being both DDS and memory-based. This is an attempt to indicate that the instrument uses a DDS system, but its Arb output does not skip points as the speed increases. These hybrid systems appear to provide both good frequency resolution and accuracy as well as flexible Arb performance.

Figure 2 ranks function-generator attributes. We asked several companies to indicate the relative importance of a variety of generator characteristics. The results indicate that a function generator must provide both standard and arbitrary waveforms at a reasonable price. As confirmed by the chart, there are few multichannel generators, although several models support multi-unit synchronization. I/Q modulation is a common use for those products with at least two channels.

While it is true that a function generator is a general-purpose signal source, certain applications are driving the development of recent enhancements. For example, digital audio and electric motor drives use pulse-width modulation. It now is available on some instruments. Similarly, binary phase shift keying (BPSK) is a form of modulation often used in communications and available on selected models.

Where are function generators headed? Like most things electronic, they are faster with more features at lower cost. Moti Glazer, Tabor’s general manager, commented that both CMOS devices and DACs are getting faster. Lower-voltage field-programmable gate arrays (FPGAs) and field-programmable logic devices (FPLDs) are offering greater levels of integration. These devices enable improvements in function-generator capabilities to be made economically.

Fluke’s Marketing Manager Dave Postetter agreed. In addition, he cited the role of ASICs in providing new features and improved performance at low cost.

References

  1. “Q2240 High-Speed General-Purpose DDS,” Synthesizer Products Data Book, 80-24127-1 A, 8/97, QUALCOMM, p. 6-1, sss-mag.com/pdf/synthbk.pdf
  2. A Technical Tutorial on Digital Signal Synthesis, Analog Devices, 1999.

Return to EE Home Page

Published by EE-Evaluation Engineering
All contents © 2003 Nelson Publishing Inc.
No reprint, distribution, or reuse in any medium is permitted
without the express written consent of the publisher.

August 2003

Sponsored Recommendations

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!