Return-Path: Received: (qmail 17081 invoked from network); 21 Jan 2002 11:20:52 -0000 Received: from unknown (HELO murphys-inbound.services.quay.plus.net) (212.159.14.225) by excalibur.plus.net with SMTP; 21 Jan 2002 11:20:52 -0000 X-Priority: 3 X-MSMail-Priority: Normal Received: (qmail 14590 invoked from network); 21 Jan 2002 11:20:47 -0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Received: from unknown (HELO post.thorcom.com) (212.172.148.70) by murphys.services.quay.plus.net with SMTP; 21 Jan 2002 11:20:47 -0000 Received: from majordom by post.thorcom.com with local (Exim 3.33 #2) id 16ScHz-0002cx-00 for rsgb_lf_group-outgoing@blacksheep.org; Mon, 21 Jan 2002 11:06:59 +0000 Received: from heavymetal.isc.de ([195.64.96.45] helo=mail1.isys.net) by post.thorcom.com with esmtp (Exim 3.33 #2) id 16ScHx-0002cs-00 for rsgb_lf_group@blacksheep.org; Mon, 21 Jan 2002 11:06:57 +0000 Received: from [195.64.97.30] (helo=k) by mail1.isys.net with esmtp (Exim 3.16 #1) id 16ScH3-0006vR-00 for rsgb_lf_group@blacksheep.org; Mon, 21 Jan 2002 12:06:01 +0100 From: "Klaus von der Heide" To: rsgb_lf_group@blacksheep.org Date: Mon, 21 Jan 2002 12:06:24 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 8bit Subject: LF: Digital Sine Generators In-reply-to: <000a01c1a1f8$fd172b80$5be486d4@erica> X-Mailer: Pegasus Mail for Win32 (v3.12b) Message-ID: Precedence: bulk Reply-To: rsgb_lf_group@blacksheep.org X-Listname: rsgb_lf_group Sender: Hello all in the group, If someone is interested in the following stuff, please e-mail. 73 de Klaus, DJ5HG dj5hg@qsl.net v.d.heide@on-line.de heide@informatik.uni-hamburg.de ------------------------------------------------------------- Digital Sin/Cos-Synthesis using the Chinese remainder theorem ============================================================= A fundamental discussion upon the principles and drawbacks of Direct Digital Synthesis about one and a half year ago on this reflector inspired me to an investigation in this field. A number-theoretic approach led me to a new synthesis that in most cases is superior to classic DDS in three respects: Spurious free dynamic range (SFDR), speed, and requirement of memory. This is not the place for a full discussion. But the principle is simple: In place of one single sin-table of length equal a power of 2 take a few cos/sin-tables of different prime-number-lengths and use them for parallel cos/sin-generation with individual phase accumulators. The analytical outputs then are all multiplied. The smallest frequency step is the sampling frequency divided by all the table lengths. The Chinese Remainder Theorem guarantees that all multiples of the frequency step can be realized. The Advantages are: (1) There is no address quantization as in classic DDS. (2) The table lengths is not a power of two which leads to spurs in classic DDS at frequencies m*2^-n times the sampling frequency (small integers m,n). (3) The implementation on DSPs is extraordinary simple and fast. Example: Generation of the 17 tones of Jason at fs = 11025 Hz. My choice of three cos/sin table lengths is: 29, 83, 599. The frequency step then is 11025/29/83/599 = 0.007647 Hz. Phase Accu Step in Table resulting frequency SFDR 1 2 3 frequency error dB ------------------------------------------------------------ 25 46 393 797.982027 0.000764 154.5 28 37 396 798.234369 0.000764 154.2 2 28 399 798.486711 0.000764 153.7 5 19 402 798.739053 0.000764 154.4 8 10 405 798.991395 0.000764 154.1 11 1 408 799.243737 0.000763 153.1 14 75 411 799.496079 0.000763 154.1 17 66 414 799.748421 0.000763 154.2 20 57 417 800.000763 0.000763 153.9 23 48 420 800.253105 0.000763 154.1 26 39 423 800.505447 0.000763 154.1 0 30 426 800.757789 0.000762 158.2 3 21 429 801.010131 0.000762 153.1 6 12 432 801.262473 0.000762 153.9 9 3 435 801.514815 0.000762 154.2 12 77 438 801.767157 0.000762 154.0 15 68 441 802.019499 0.000762 153.7 On my old DSP56002 it takes 8 instructions per sample and requires 2*(29+83+599) = 1422 words of memory for the tables. The spurious free dynamic range (SFDR) for this implementation in 24-bit-arithmetic is given in the table. It increases with 6 dB per additional bit to infinity because there is no approximation. The kernel of the program to compute n4 samples by two complex multiplications of three complex table lookups each is: do n4,loop mpy x1,y1,a ab,l:(r4)+ mpy x1,y0,b y:(r0)+n0,x0 macr -x0,y0,a y:(r2),y0 macr x0,y1,b a,x1 mpy x1,y0,b b,x0 mpy -x0,y0,a x:(r2)+n2,y1 macr x1,y1,a x:(r0),x1 macr x0,y1,b l:(r1)+n1,y loop That's in short. --------------------------- END ------------------------------