This action might not be possible to undo. Are you sure you want to continue?
Numerical Distortion in Single-Tone DDS
Department of Telecommunications Budapest University of Technology and Economics Stoczek u. 2, H-1111 Budapest, Hungary Phone: +36 1 463-2025, Fax: +36 1 463-3266 Email: email@example.com, URL: http://www.hit.bme.hu/people/papay
Abstract – Spurious performance of direct digital synthesis (DDS) is partly caused by two quantization operations in its numerical (i.e. digital) part. These errors are deterministic and periodic in the time domain, therefore they appear as line spectra (undesired components: spurs) in the frequency domain. Hence it is quite natural to analyze the effects by DFT (discrete Fourier transform). The amplitude quantization (AQ), being present permanently, causes harmonically related spurs, while phase truncation (PT) produces spurs around the output frequency by phase modulation. However, as a consequence of DDS sampling process, spurs would be folding back into the DDS bandwidth (first Nyquist zone) and possibly overlapping. A simple procedure is presented for evaluating location and level of spurs, which are due to numerical distortion in a standard DDS system. Examples using an interactive math tool are available online. Keywords – DDS, NCO, amplitude quantization, phase truncation, spectral purity, simulation.
communication systems (e.g. digital radios and modems, software-defined radios, digital down/up converters etc.).
frequency tuning word
digital part: num controlled osc (NCO) phase ACC
r + reg m LUT n (sine table)
mixed/analog part: signal (re)construction
r D reg r load reference part: system clock fc fc
fc PT: phase truncation AQ: amplitude quantization
f/fc = D/2^r
Fig. 1. The standard DDS structure.
Direct digital frequency synthesis (DDFS or simply DDS) generates real-life waveforms of repetitive nature by using digital data and mixed/analog signal processing blocks. The open-loop DDS is used especially for precise, fast frequency and phase tunable output. Solutions can be implemented in LSI (large-scale integration) and they play an ever-increasing role in digital waveform and agile clock generation and modulation. The high-level architecture of a generic DDS system can be viewed as a simple assembly containing three parts (Fig. 1). A fixed rate clock is the time reference part. Numerically controlled oscillator (NCO), the digital part, consists of an overflowing phase accumulator (ACC, register length r-bit) and a lookup table (LUT, memory address length m-bit, data width n-bit). Here we model all techniques of waveform mapping as a simple lookup table operation. The mixed/analog part reconstructs the analog wave with a digital to analog converter (DAC) and anti-imaging filter (AIF). NCO-based DDS is a point(memory location)-skipping technique and runs at a constant update(clock)-rate. There are several applications that do not convert the numerical samples into an analog signal, as it is the case in many digital
0-7803-6646-8/01/$10.00 ©2001 IEEE
One of the most important specifications to the synthesis is that of spectral purity. Spurious performance of DDS is partly caused by two quantization operations in its numerical (i.e. digital) part. The amplitude quantization causes harmonically related spurs, while phase truncation produces spurs around the output frequency by phase modulation. These numerical distortions (algorithmic nonlinearities) due to finitewordlength effects present a major contribution to system complexity. (Note: the actual realization of DAC is another dominant source of spectral impurity, but here we concentrate to spurs origin from numerical part only.) Knowing the location and level of spurs is a good starting point for the NCO design, selection or length customizing (as in FPGA: field programmable gate array) for specific application. Analytical results (particularly for amplitude quantization) are rather complicated, not necessarily practically oriented and because of spurs vary rather irregularly with tuning, interpreting the parameter dependence of spurs is not easy. This problem can be overcome by interactive computer simulation knowing the fundamental spur structures. The paper presents a simple procedure for evaluating numerical spurs in a standard single-tone (sinewave) DDS generator. The method can be extended to multi-tone or dithered DDS, as well. Examples using an interactive math tool (Mathcad worksheets) are available online.
(1947) provided an exact analysis when a uniform quantizer is driven by a continuous-time sinusoid. a Ppoint FFT transform of Qi results in the exact output spectrum of NCO.. But knowing the fine structure of spur locations. III. So far it seems that the procedure is free from major difficulties. Since r can be as high as 32 (or 48) for fine frequency resolution. normalized amplitude sinusoid with f analog frequency and a fixed zero initial phase: x(t) = 1⋅sin(2πft). n). DDS builds up (reconstructs) the waveform from its numerical samples. and for example the SNR (signal to noise (i. some L (prime to P). spur) ratio for full DDS bandwidth) is independent of L. is equivalent with uniform(U)permutation of samples within a P-block waveform (i. The sample sequence xi is P-periodic only. These spurs vary rather irregularly with tuning word (D) and parameters (r. as well. Because of odd harmonics only. with j = D⋅i (mod P).. Moreover. i.e. a global viewpoint can be used. The finite memory requirement of the DDS imposes the periodicity xi = xi+P . Some remarks: (1) Simply change Ii → Ti mapping for smaller amplitude. and phase truncation (PT) are the two separate mechanisms which lead to the occurrence of spurs in NCO. AQ-spurs: overlapped harmonic structure An n-bit amplitude quantization (AQ) is a strong deterministic nonlinearity. as well.II. This means that only the position of the lines change but not its level. Frequency indices greather than P/2 are redundant for real signals. because of sampling. where i: time index. This is the case of so-called coherent sampling. i. (3) Other type of quantization can be use for Ii or Qi . the discretetime version of sinusoid: xi = x(i⋅∆t) = 1⋅sin(2π(f /fc)⋅i). Since the output numerical sequence Qi is P-periodic. as showed by Kak and Jayant (1977). temporal reversible rearrangement of sample position i into position j. et al. (Theoretical results were rediscovered later several times.) Rounding operation. P-1). Only high m-bit will index the LUT: Ii = trunc(Ai /2r-m). but actually the NCO output with n-bit precision: Qi = ∆⋅round(Ti /∆). A. Note: mod(a. nonzero phase or just another arbitrary (ARB) waveform or special sample-generation simulation. 2r). prime to a given P. sometimes without reference to the original paper. The rate at which the r-bit phase accumulator overflows in NCO is controlled by the D frequency tuning word. Accumulator overflow (mod 2r) corresponds to a mod 2π operation: D/2r = ∆θ /2π. Overlapped spectral lines may contribute constructively or destructively to the level of the resulting component depending on their actual phase (and amplitude) values. But in some cases the behavior of AQerror could be exactly quantified. and P is a power of 2. Lines in the odd Nyquist zones map directly into the baseband (1st Nyquist zone. for example. There is one cycle of sine waveform in LUT. Clavier. 2r ) ≤ 2r is the numerical period of sample sequence. extremely long periods can occur. In these cases practically some short-term FFT (with reasonable window against FFT artifacts). so revealing the fundamental structure of spur locations helps in interpreting the spectrum.e. Consider a continuous-time. b) = remainder of a when divided by b. the level of which oscillates violently and its dependence on the signal amplitude and resolution is very complicated. The inverse mapping is another U-permutation. U-permutations produce an uniform shuffling in the DFT spectrum. hence its rigorous analysis is quite complicated (if possible). |x(t)| ≤ 1. i = 0. . NUMERICALLY CONTROLLED OSCILLATOR First recollect some familiar results regarding DDS numerical frequency and numerical period of samples. if D is odd then P = 2r. Hence the numerical frequency of DDS f /fc = D/2r = L /P < 1/2. Therefore the practical way to deterministic analysis of the irregular shape of AQ-spur levels is directly given by an FFT transform of the NCO output. Aliasing phenomenon exposures the locations of AQ-spur (overlapped harmonics). Sampled at fc = 1/∆t rate. and P = 2r/gcd( D. Varying L. so a high precision table output is Ti = 1⋅sin((2π/N)⋅Ii) and N = 2m. single sided).e. some harmonics can fold back into the desired band and possibly overlap depending on value of numerical frequency.2 . if the numerical frequency is rational: f/fc = L /P (some L relative prime to P).1.e. the number of AQ-spurs is (P/4)−1. being present permanently. A simple algorithm describes the operation of the NCO: The input to NCO is the integer D tuning word. (2) One can use dither before phase or amplitude quantization if any. where ∆ = 2/2n. minimum distance (nearest neighbor) mapping has odd symmetry and generates odd harmonics only. The actual content of an r-bit phase accumulator is Ai = mod(D⋅i. NUMERICAL DISTORTION Amplitude quantization (AQ). a local viewpoint: zoom DFT on interested area (on only suspect frequencies) also can be applied. so the output frequency (the rate of phase change): f = (1/2π)⋅(∆θ /∆t) = ( fc /2r)⋅D. Note: gcd = greatest common divisor. However. m.
testing separately the PT-spurs is only possible with simulation using a high precision Ti table output. 2r-m ) ≤ 2r-m can be identified as the numerical period of phase error (as we see next). the integer part Ii is the actual LUT address. Since mod(d. From this form.. 2 . The source of the PT-spurs is a fractional part of d. varying whether V or L (prime to a given E) will just permute the same spectral lines (only relative location of the signal and PT-spurs varies but not the levels). (These tuning states are suitable to test the AQ-spurs only in NCO. (S − zh)). where E = 2r-m/gcd( D.1). modifies accordingly the effect of D tuning word on instantaneous phase that leads to phase truncation (PT) . measured in clock cycles. i. if E = 1). then there are no PTspurs. then a "sea" of finely spaced AQ-spurs appears (or alternatively one can detect a background "noise floor"). and the fractional part ei = mod(Ai /2r-m. and zeros in the truncated low r−m phase accumulator bits indicate these favourable cases. At this f /fc = 1/4 numerical frequency only the DAC nonlinearities cause distortion in DDS. PT-error sequence ei varies periodically and results from the sampling of a hipothetical sawtooth waveform with a period of 1/mod(d. Using small angle approximation for realistic NCO implementations (N = 2m >>1 and disregarding scaling constant) xi ≈ sin( 2π 2π 2π Ii ) + ei cos( I i ) = Ti + psi . therefore the numerical period of PT-error sequence is E (a factor of 2). S).. t. Hence the fundamental numerical frequency of phase error ei is fe /fc = mod(d.1) is the phase error sequence. Full testing of the AQ-spurs is only possible with simulation. the nominal address change of LUT) and let us write it in mixed fraction form: d = D/2r-m = V + (L /E). PT-spurs: overlapped modulation structure Truncating an r-bit phase accumulator output to high m-bit. but do not modify the average numerical frequency.1) = ε /2r < 1 . ( P/2)−1 here N = 2m. a "phase hiccap" occurs. S). The levels of PT-spur are also calculated by an FFT transform taken at the NCO output.e.error. zh. here V = trunc(d) is the integer part and (L /E) = mod(d. a highly massive overlapping occurs at P = 8 (i. the locations of PT-spur (overlapped modulation structure) zh = mod(D + h⋅ε. 1. At a given E.) (2) The worst case occurs . S = 2r and h = 0. a cosine modulated harmonics of the (2π/N)⋅ei sawtooth waveform. A simple estimate of bound on maximum AQ-spur to signal (carrier) ratio is SpSR ≈ (−6⋅n + 3) dBc. f) equals to t if cond holds and equals to f otherwise. Notice that if d is integer (i.e. Similarly. E−1 sph = if (zh < (S/2). if f /fc = 1/8 or 3/8) when energy of spurs apparently "concentrates" on one AQ-spur. because samples match exactly the quantization levels. Let d be the nominal frequency tuning word (i. The analog frequency of AQ-spurs is fah = (sah /S)⋅fc. S = 2r and h = 1.1) = L /E. Here h = 1 is the signal component. zh. (3) The other limiting case occurs if P is long. 1) ∈ (0. and it follows from the E periodicity of phase error sequence that the number of PT-spurs is E−1. Due to aliasing and taking into account the modulation theorem of Fourier transform.while components in the even zones map in a mirrored fashion with phase inversion zh = mod(h⋅D. 3. (S − zh)) .1) is the fractional part. N N 2r Consequently. 5 . Some consequences: (1) There is no numerical distortion especially if P = 4.1) ≠ 0 then nonuniform sampling occurs and for this reason distortion is presented. where ε can be considered as a (hipothetical) "tuning word" for phase error (and this integer data will be used to compute the PT-spur locations). Dropping the lower bits permits extremely fine-tuning with reasonable LUT size at the expense of spectral purity. it is obvious that the actual address change is V or V+1 (if d is not integer).e. Some of the special cases: (1) There are no PT-spurs if E = 1. the high precision NCO output Ti ≈ xi − psi will be composed of the desired clean xi sinewave corrupted by psi PT-spurs. B. (2) The worst case.. Note: the expression if(cond. Here h = 0 is the signal component. Or viewing it another way: if mod(d..e. N N N sah = if (zh < (S/2). The analog frequency of PT-spurs is fph = (sph /S)⋅fc . Spur components are symmetrically located in pairs around the desired signal component. For the calculation of spur locations consider a discrete-time sinusoid xi = sin(2π 2π D d i ) = sin(2π i ) = sin( ( I i + ei )) .
654.e. The first one illustrates an interaction between AQ and PT (Fig. n = 10 and the desired f/fc = 2/15 (i. actual D is all two in hexa).2 0. Rader.4 0. 48-57.e. if E is long. where a freely downloadable interactive viewer is also provided. 2b).com/collection. . 160 To summarize. Modifying only the data precision (n-bit: 10 → 7).1 0. As the desired f /fc is the ratio of small integers but the denominator is not a power of 2. an unforeseen interaction occurs (Fig. while the second one presents a multi-sine (Fig. pp. m = 10.html#015 Num Frequency Fig. EXAMPLES OF SIMULATION The two sources of numerical distortion (AQ and PT) appear simultaneously and they possibly exercise mutual influence on each other. where the levels of harmonically related components change with −5 dB). Patent No. as a drop in the bucket.bme. Simulations help to discover the composed spectral maps for specific applications and tuning ranges (e. although our description was mainly restricted to a single-tone case. Gold.1 0. which can be lowered significantly by choosing a higher m-bit (i. vol.5 Num Frequency 80 Fig. as well. the actual (tunable) numerical frequency has a "small offset" (because of finite frequency resolution). Simulation parameters: r = 32. A set of interactive Mathcad worksheets based on structural relations described above was developed that exemplified some topics of DDS numerical distortion.3 0. 19.7/40. Webb. Same as Fig. 3. Here only two illustrative examples are given. Spectra of a synthesized single-tone (sinusoid). 2). "Digital signal generator synthesizer. Apr. 2a.3 0. as it would be the case in many DDS-based ARB generators).hit. i. Audio Electroacoust. (3) There are many PT-spurs in the other limiting cases. 0 0. Simul ation parameters: r = 48. Rel Lev (dBV) 0 0 80 160 240 0 0.450.. 2a).g. m-bit: 10) causes unpleasant spurs. In multi-tone case.3 0. for the proper selection of the data before parameterization of an NCO core in FPGA). in these cases spur energy apparenly "concentrates" on one PT-spur. The limited memory capacity (1K.e.1 0. the simple superposition is invalid because of the strong nonlinearities and only simulation proves to be the usable tool (Fig.2 0.4 0. C.5 240 REFERENCES The milestone paper J. B. Tierney.S. m = 12. "A digital frequency synthesizer".hu/people/papay/sci/DDS/simul. 2b. A simple estimate of bound on maximum PT-spur component to signal ratio is SpSR ≈ (−6⋅m + 7) dBc.5 Num Frequency Fig. As a general rule. to demonstrate the method. IEEE Trans. 3. by simulations the investigations can further be extended to other practical cases. All spectra were computed by 8K FFT with BH7 (a 7-term Blackman-Harris) window. Mar.2 0.Rel Lev (dBV) when E = 2 (independently of V). 3). LUT m-bit address length is 2 bits higher than the n-bit data precision to make the highest PT-spur component smaller than the background AQ "noise floor". 1972. n = 12 and the desired fundamental f /fc = 0. A patent J. Spectra of synthesized multi-tone with limited (1K) memory. One can reach some of them online at the URL: www. M." U. 3.4 0. IV. hence spurs will concentrate close to the fundamental frequency and near some other lines (Fig. http://eepatents. by increasing the waveform length. but with limited data precision: n = 7. Rel Level (dBV) 0 40 80 80 120 0 0. 2a. 1971.htm.
Acoust." Proc. Clavier. 1947. Mehrgardt. 36. Cercas.Scale Analysis. 1986. V. ASSP-33. 1947. H. C. pp. Inform." Proc.. Direct Digital Frequency Synthesizers. Gray.2. vol. Muegyetemi kiadó." J. vol. 48.hu/people/papay/sci/DDS/products.mathcad. "DDS signal generator. A. 453-456.. Comm. 1993. Jenq. "Analysis and design of numerically controlled oscillators based on linear time-variant systems. Messerschmitt. Babitch. 50th Annual Frequency Control Symp. C." Electrical Eng. R. Aridgides. 989-1005. H. 1988. "An analysis of the output spectrum of direct digital frequency synthesizers in the presence of phase-accumulator truncation. 1999. "On speech encryption using waveform scrambling." IEEE Trans. Nov.6." RF EXPO EAST '90. Grieg. D. M. K. Pápay. Vol. 3. 1985. Speech. vol. D. Bellan. Int. 1994. 44th Annual Frequency Control Symp. LLH Tech. pp. "Performance in waveform quantization. 1995.." Proc. pp. W. 1985. Signal. 323-326. Gandelli. Pápay. Feb.. Dec. Nicholas." Proc. 45. pp. Sept. Systems and Computers. pp. H. pp. Fishman. "The intermodulation and distortion due to quantization of sinusoids. pp. May 1988. Mar. Zs." IEEE Trans.M.. pp. 1996. D. Chow. 1037-1039." IEEE Trans. pp. "Truncation effect in direct digital frequency synthesis. Acoust. R.. Benn.. 3. pp." Proc. 1998. Waveform Measurement and Synthesis." IEEE Trans. [Online]." Proc. vol. Conf. "Quantizing theory in electrical and electronic measurements." IEEE Trans. D.625-633. Maher. "Harmonic quantization noise in oversampled analog to digital converters. MathSoft Engineering & Education Inc. deterministic approach) A. 15." IEEE Trans.. 56. Audio Eng. vol. F. Comm.. vol. A. p.. pp. A. M. pp. "Analysis of digitally generated sinusoids with application to A/D and D/A converter testing." Trans. "Unified theory of digital modulation. T. Nov. A. Theory. J. "Comments on 'The Modulo Time Plot: A Useful Data Acquisition Diagnostic Tool' ". 495-502. "Discrete-time distortion analysis of quantized sinusoids. J. ref. 689-692. 40. Speech. N. 1999. Olsen. 40.G. IEEE Trans. pp. C.1220-1244. 1990. P. "Distortion in a pulse count modulation systems. Vannka. L.. 669-675. AQ: Amplitude Quantization of sine wave (lookup-table wordlength effect. "Quantization noise spectra. Pápay. Speech. P. Extended version: "Digital spectra of nonuniformly sampled signals . P. 145-152. pp. vol. 18-25. vol. 1993. vol. on Time-Frequency and Time.htm Mathcad. Garvey./Apr. May 1978. Kroupa (Ed. pp. M. Essential substance: "PCM distortion analysis. B. J. AIEE. Acoust. Blachman. Panter." IEEE Trans. Acoust.Tutorials Sciteq: Frequency Synthesis & RF Subsystems. No.." Rev. 109-115. K. Pub. vol. 1999. Feb. IM. 1988. Budapest. Y. Stanford Telecom: The DDS Handbook. H. PT: Phase Truncation (lookup-table address-length effect) S. "An exact spectral analysis of a number controlled oscillator based synthesizer. pp. Tomlinson. Soc. A. "DDS" (Internet links).hit. IEEE Reprint Press. M. 41st Annual Frequency Control Symp. Y. IM. Kak. Zs.." IEEE Trans. vol. pp. Nov. D. H. A. 1992.com . 1983. 2/1-2/6. 1110-1122." IEEE IMTC. 1985. vol. 1417-1426. "Quantizing noise for a sine wave and a set of sine waves. 781-808.). Extended version: "Quantizing theory . 229-242. vol. IM. No." IEE Colloquium on DDFS (Digest No: 1991/172). pp. available: www. "The optimization of direct digital frequency synthesizer performance in the presence of finite word length effect. Multanen. Aug. N. Signal Proc. Goldberg. pp. 358-362. pp. E. pp. Nicholas." IEEE Trans. D. Blythe. Nov. 1996. pp. of the IEEE-SP Int. Dec. "Digital spectra of non-uniformly sampled signals with application to digitally synthesized sinusoids.digital look-up table sinusoidal oscillators.31. Nov. pp. 767-776. J. www. 7th ed. Azegami. vol. 739." IEEE IMTC. pp.: 1991/172.bme.a deterministic approach. 33. Speech. D. pp. Jayant.. Nov..." Proc. 1996. 42nd Annual Frequency Control Symp. Blumberg. Samueli. no. Albuquerque. "Noise spectra of digital sine-generators using the tablelookup method. 151-153. 1990. Morgan." GEC J. 1991. 951-959. "Spur reduction techniques in sine output direct digital synthesis. 1967. Hawksford. L. Brandolini. 1997. 959. T. 511-521. 1996 (in hungarian). 1987." Proc. Yenq. vol.12-19. "On the nature of granulation noise in uniform quantization systems. 1992. IEE Colloquium on DDFS. Digital Frequency Synthesis Demystified. of the 20th Asilomar Conf. 186-190. "Designing with direct digital frequency synthesizers." (1995) published in Zs. Fujii. Feb. Duttweiler. J. Qualcomm: Synthesizer Products Data Book. Signal Proc. Kim. G." The BSTJ. Miscellaneous S. Jan/Feb. 1974. 1737-1745. of the Electrical Comm. Apr. 357363. May 1990. p. R. J. 4. "Time-domain properties of instantaneous uniform quantization. E. H. F. Signal Proc. "The spectrum of the quantized sinusoid. 1999. 121. 66. 26. IEE. May 1987. CS-II: Analog and Digital Signal Proc. Signal Proc. Lab. S.. B. F. pp. "Spurious frequency generation in direct digital synthesizers. May-June 1977. C. 494-499. pp. of Research . Samueli. 46. J. and (error correction) Vol. 40. No. M. vol. Symp. F. Vollmer. P. 37. Analog Devices: A Technical Tutorial on Digital Synthesis..