dsp tips & tricks

Lionel Cordesses

Direct Digital Synthesis: A Tool For Periodic Wave Generation (Part 2)

n Part 1 of this article (in number improves the SFDR by 3.9 the July 2004 issue of IEEE dB [14] in Part 1. The repetition “DSP Tips and Tricks” introduces prac- tical tips and tricks of design and Signal Processing Maga- period of the accumulator TACC , zine), we presented an over- often referred to as the grand repeti- implementation of signal processing view of the basics of direct tion period, is given by algorithms so that you may be able to digital frequency synthesis (DDS), incorporate them into your designs. I N We welcome readers who enjoy read- simple formulas to compute bounds = 2 ( ) TACC N 1 ing this column to submit their contri- of the signal characteristics, and a GCD(2 ,ACC) scheme to improve the DDS spuri- butions. Contact Associate Editors Rick ous free (SFDR). In where GCD(x, y ) stands for the Lyons ([email protected]) or Amy Bell this Part 2, we discuss additional greatest common divisor of x and y ([email protected]). N tricks used to optimize DDS perfor- [1]. When GCD(2 ,ACC) = 1, as mance by maximizing SFDR. it will be whenever ACC is an odd bandwidth, one can add a dither sig- N number, then TACC = 2 , which nal [2] to the ACC phase values as Improving SFDR Through spreads the spurs over the entire shown in Figure 1. Spur-Reduction Techniques spectrum (otherwise they are The dither signal can be a pseu- The easiest method to reduce the aliased to a frequency within the do-random sequence (generat- level of DDS spurs, discussed in spectrum, as described in [14] and ed, for example, with binary shift Part 1, is to increase the accuracy of [12] in Part 1). As an example, we registers and exclusive-or gates, and the phase to waveform converter. computed the output spectra with a having a repetition period much The limit of this approach has been fast , the length greater than the output signal peri- mentioned; it is mainly technologi- of which is equal to TACC, for the od) whose word width is B bits pro- cal [lookup table (LUT) size]. two cases of ACC = 13, 248 and viding noise values in the range of 0 B We now review three simple and ACC =13,249, with N = 16, and 2 . Choosing B = N − P , the effective methods to reduce the spur P = 9, and M = 8. The odd num- spurs do follow a 12-dB per-phase level of the sinewave DDS, along ber for ACC leads to an increase of bit law [3] instead of the 6-dB per- with the corresponding spectra com- 54.2 − 50.3 = 3.9dBin SFDR. phase bit of (9), thus allowing a puted from simulated DDS outputs. smaller LUT for the same SFDR. The Phase-Dithering An output spectrum is given The Odd-Number Approach Approach without any dither signal in Figure The worst-case spur level is given by In another method to spread the 2(a) with Fs = 44, 100 Hz,ACC = (9) in Part 1. Making ACC an odd spurs throughout the available 1,657, N = 16, P = 5, M = 16, and the dither signal (B = N − P = 16 − 5 = 11 b) applied in Figure 2(b). The spectra Dither Generator have been computed for ten output signals that have been averaged fol- B lowing the method described in [3]. ∆ Φ ACC Phase ACC Phase The high-resolution, 16-b, LUT has Fo N – 1 Generator N N Quantization P been chosen so as to focus only on the 5 b of phase quantization, as in ▲ 1. DDS, including phase dither. [3]. The drawback of this dithering

110 IEEE SIGNAL PROCESSING MAGAZINE SEPTEMBER 2004 1053-5888/04/$20.00©2004IEEE This is an IEEE authorized version of this documentdelivered from IEEE Xplore®. DOI 10.1109/MSP.2004.1328096. Downloaded 16 Sep 2006 by LIONEL CORDESSES. method is the increase of the noise G can be implemented as a single rejecting high-frequency compo- floor, but that’s a small price to pay delay register, and 1 − G has a 0 at nents of the noise signal n, thus jus- for such a large increase in SFDR. z = 0 (0 Hz); it acts as a discrete tifying the statement that one Other dithering methods are time differentiator. The system fil- should use this filter for low-fre- available, such as amplitude dither- ters out the low-frequency compo- quency Fo signals [7]. ing and both phase and amplitude nents of the noise signal n but An example of the output spec- dithering (see [3] and [4]). The high-frequency signals, greater than trum is given in Figure 4(a). [The phase-dithering approach has also 8 kHz, are amplified. This simple parameters are the same as in been applied to squarewave signal approach prevents the filter from Figure 2(a).] The SFDR is greater DDS [5].

The Noise-Shaping 0 0 Approach Amplitude (dBc) Amplitude (dBc) The key idea of the noise-shaping –10 –10 approach, to improve our DDS –20 –20 SFDR, is to filter out the quantiza- –30 –30 tion noise introduced by the phase –40 –40 quantization step in Figure 3. This quantization can be viewed as a spe- –50 –50 cial case of noise addition [6], as –60 –60 depicted in Figure 3(a). The quanti- zation noise signal n can be recov- 0Frequency Fs/2 0 Frequency Fs/2 ered from the following equations: (a) (b) ▲ 2. DDS output spectra: (a) without dither and (b) with dithering. = n + ACC = − . ( ) eQ ACC 2 Phase Quantization Φ n ACC Phase Quantization Thus, eQ =−n. In the noise-shap- ACC Φ NP ing approach, this quantization N P − noise signal n is fed back, through + – a filter G, to the ACC signal as + – G shown in Figure 3(b). The transfer –n function of interest is the one from eQ = –n n to , as the noise added to the (a) (b) phase signal will eventually lead to ▲ phase noise. The phase signal is then 3. Quantization and : (a) quantization model and (b) noise-shaping implementation. = n(1 − G ) + ACC.(3) 0 0 Amplitude (dBc) Amplitude (dBc) From (3), one can infer that the –10 –10 phase signal is affected by the fil- tered noise signal n, (1−G) being –20 –20 the transfer function of the filter. –30 –30 The choice of G will lead to differ- –40 –40 ent results, as we shall see. –50 –50 A first-order noise-shaping approach is to use the simple trans- –60 –60 fer function G proposed in [10] in Part 1 as the finite impulse response 0Frequency Fs/2 0 Frequency Fs/2 (a) (b) (FIR) filter G = z −1. Here z is the −1 symbol of the z-transform used for ▲ 4. DDS spectra with first-order noise shaping and G = z : (a) ACC = 1, 657 and (b)

discrete-time systems. The function ACC = 13, 249.

SEPTEMBER 2004 IEEE SIGNAL PROCESSING MAGAZINE 111

This is an IEEE authorized version of this documentdelivered from IEEE Xplore®. DOI 10.1109/MSP.2004.1328096. Downloaded 16 Sep 2006 by LIONEL CORDESSES. dsp tips & tricks continued

than 60 dB near the carrier, but it interest, for example, when one lator [an integrator: ACC(k) = decreases with the frequency and wants to reject a known frequency ACC(k − 1) + ACC (k− 1)], given by eventually reaches 46.8 dBc. The such as 2 × Fo [7]. A tunable notch −1 = z ( ) overall behavior is compliant with filter is added at the expense of a F − 6 − 1 − z 1 the above G = z 1 analysis. At a more complex feedback structure. higher frequency (ACC = 13249), The transfer function becomes the noise close to the carrier is less fil- with the output phase  given by −1 −1 −2 tered, as one can see in Figure 4(b). 1 − G = (1 − z )(1 + bz + z )  = (1 − FG)n + FACC . One can To implement higher-order noise − − chose G so as to ensure (1 − FG) = = 1 − (1 − b )z 1(1 − b )z 2 shaping, a more complex filter can (1 − z −1)(1 + bz−1 + z −2) as in (5). − − −3 ( ) be used instead of G = z 1. A sec- z 5 ond-order FIR filter has been pro- posed in [8]: with b =−2cos [2π(2Fo/Fs)]. At Summary low frequencies, as shown in Figure DDS is a useful tool for generating −1 −2 1 − G = 1 + b 1z + b 2z .(4) 5(a), the spectrum looks like the periodic waveforms. In this two-part one with the first-order noise shap- article, we presented the basic idea of Careful choice of b 1 and b 2 can lead ing. But at a higher frequency [the this synthesis technique and then to a double zero at 0: 1 − G = same as in Figure 4(b)], the focused on the quality of the sinewave 1 − 2z −1 + z −2 = (1 − z −1)2, which improvement close to the carrier is a DDS can create, introducing the improves the rejection at 0 Hz. clear, as shown in Figure 4(b). SFDR quality parameter. Next we When the noise shaping is applied to Note that the same filter (with presented effective methods to the amplitude signal instead of the zero at a specific frequency) can be increase the SFDR through sinewave phase signal, other values (often inte- implemented by feeding the error approximations, hardware schemes ger values, so as to ease implementa- signal back to the accumulator. This such as dithering and noise shaping, tion, see [8]) are preferred, and this structure, proposed and patented in and an extensive list of references. filter can even be tuned online. [7], is presented in Figure 6. F is When the desired output is a digital Multiple-zeros filters are also of the transfer function of the accumu- signal, the signal’s characteristics can be accurately predicted using the for- mulas given in this article. When the 0 0 Amplitude (dBc) Amplitude (dBc) desired output is an analog signal, the –10 –10 reader should keep in mind that the –20 –20 performance of the DDS is eventually –30 –30 limited by the performance of the digital-to-analog converter and the –40 –40 follow-on analog filter [9]. –50 –50 We hope that this article will –60 –60 incite engineers to use DDS; either integrated-circuits DDS or soft-

0Frequency Fs/2 0 Frequency Fs/2 ware-implemented DDS. From the (a) (b) author’s experience, this technique ▲ 5. DDS spectra with higher-order noise shaping: (a) same parameters as Figure 2(a) has proved valuable when frequen- and (b) same parameters as Figure 4(b). cy resolution is the challenge, par- ticularly when using low-cost microcontrollers.

∆ ACC ACC Phase Φ F N – 1 N Quantization P Acknowledgments I would like to thank Rick Lyons, who helped improve this article through + – –n many comments and a thorough read- G ing of the original manuscript.

▲ 6. Noise shaping: Analog Devices’ approach. (continued on page 117)

112 IEEE SIGNAL PROCESSING MAGAZINE SEPTEMBER 2004

This is an IEEE authorized version of this documentdelivered from IEEE Xplore®. DOI 10.1109/MSP.2004.1328096. Downloaded 16 Sep 2006 by LIONEL CORDESSES. Single Instrument Solution dards with options. Accurate high- for WLAN Devices speed transmitter power, frequency, The MT8860A is Anritsu Compa- carrier suppression, and harmonic ny’s first fully integrated single- measurements can be made with the instrument test solution for WLAN test set. Each of the measurements devices that can conduct both can be conducted on all frequency transmitter and receiver measure- channels and all specified power lev- ments based on the IEEE 802.11 els. A PCI bus design makes it simple standard. With the ability to per- to add measurement capability. form these measurements ten times Anritsu Company, Corporate faster than existing test alternatives, “golden” radios from various Offices, 490 Jarvis Dr., Morgan Hill, the MT8860A is a marked WLAN chip manufacturers. CA 95037-2809 USA. improvement over existing rack- The MT8860A covers both the Tel: +1 800 267 4878 and-stack test solutions that are 2.4 GHz and 4–6 GHz WLAN bands Fax: +1 408 776 1744 based on multiple instruments plus and supports all 802.11 WLAN stan- URL: http://www.us.anritsu.com

dsp tips & tricks continued from page 112

Lionel Cordesses is a control engineer at the Techno- centre Renault (Guyancourt, France), the research center of the Renault company. His technical interests include analog electronics, digital signal processing, and embedded controllers. He is a member of the IEEE and the ACM.

References [1] J.F. Garvey and D. Babitch. “An exact spectral analysis of a number con- trolled oscillator based synthesizer,” in Proc. 44th Annu. Symp. Frequency Control, 1990, pp. 511–521. [2] L. Schuchman, “Dither signals and their effect on quantization noise,” IEEE Trans. Commun., vol. 12, no. 4, pp. 162–165, 1964.

[3] M.J. Flanagan and G.A. Zimmerman, “Spur-reduced digital sinusoid synthe- sis,” IEEE Trans. Commun., vol. 43, no. 7, pp. 2254–2262, 1995.

[4] J. Vankka, “Spur reduction techniques in sine output direct digital synthe- sis,” in Proc. 1996 IEEE Frequency Control Symp., 1996, pp. 951–959.

[5] C.E. Wheatley, III and D.E. Phillips, “Spurious suppression in direct digi- tal synthesizers,” in Proc. 35th Annu. Frequency Control Symp., 1981, pp. 428–435.

[6] H. Spang, III and P. Schultheiss, “Reduction of quantizing noise by use of feedback,” IEEE Trans. Commun., vol. 10, no. 4, pp. 373–380, 1962.

[7] D.B. Ribner and S. Kidambi, “Direct-digital synthesizers,” European Patent EP1037379, 2000.

[8] J. Vankka, “A direct digital synthesizer with a tunable error feedback structure,” IEEE Trans. Commun., vol. 45, no. 4, pp. 416–420, 1997.

[9] T.M. Higgins, “Analog output system design for a multifunction synthesiz- er,” Hewlett-Packard J., vol. 40, no. 1, pp. 66–69, 1989.

SEPTEMBER 2004 IEEE SIGNAL PROCESSING MAGAZINE 117

This is an IEEE authorized version of this documentdelivered from IEEE Xplore®. DOI 10.1109/MSP.2004.1328096. Downloaded 16 Sep 2006 by LIONEL CORDESSES.