EXTREMELY HIGH FREQUENCY RESOLUTION AND LOW HARMONIC DISTORTION DIGITAL LOOK-UP-TABLE SINUSOIDAL OSCILLATORS

New techniques to efficiently increase the frequency resolution of digital sinusoidal oscillators based on look-up-table (LUT) methods are proposed. The increase in frequency resolution is achieved while maintaining very low level of spurious harmonic distortion. The proposed techniques increase the LUT length to a level at which the spurious harmonic distortion is negligible. The first proposed technique is based on partitioning the address register into three sets and dividing the available LUT length into three smaller tables addressed according to the content of the address register sets. The second proposed technique utilizes one LUT and interpolates the values of the samples that are not stored in the table. The third proposed technique is similar to the first technique with the advantage of simpler implementation and lower levels of spurious harmonic distortion. The proposed techniques are simulated and their performance is compared with that of the direct LUT and trigonometric interpolation methods. The simulation results show that the proposed techniques are superior to both direct LUT and trigonometric interpolation methods.


INTRODUCTION
Digital sinusoidal oscillators are essential elements in many applications.They are used in communications, music synthesis, control, radar, and digital signal processing.These digital oscillators exhibit the advantages of digital techniques, namely, stability, flexibility, and low cost.Moreover, the parameters of a digitally generated sinusoid are easy to control.The conventional digital sinusoidal oscillator uti- lizes one look-up-table in which the samples of a complete cycle of a sine wave are stored and read at appropriate time intervals [1,2].The major disadvantage of a digital sinusoidal oscillator implemented using LUT method [1] is the spurious harmonic distortion due to fractional addressing of the memory [2,3].The fractional addressing is necessary to increase the effective LUT length and consequently the frequency resolution of the digital sinusoidal oscillator.
The spurious harmonic distortion can be reduced by the trigo- nometric interpolation method [4].Recently, two methods to reduce the spurious harmonic distortion were reported in [5].It should be emphasized that the objective of these approaches is to reduce the complexity of the digital circuits involved measured in terms of LUT length.
In this paper, we propose three new techniques to increase the frequency resolution and at the same time reduce the spurious harmonic distortion associated with fractional addressing of the LUT.The proposed techniques have the advantage of increased frequency resolution and reduced spurious harmonic distortion over both the conventional LUT digital sinusoidal oscillator and that based on the trigonometric interpolation method.The first proposed technique, P1, is based on partitioning the address register bits into three sets, namely the most significant NI bits, the next NF1 bits, and finally the least significant NF2 bits.The contents of the NI bits and NF1 bits are used to address LUTs as described in [4] while the content of the least significant NF2 bits are employed to interpolate sample values that are not stored in the LUTs.The resulting effective LUT length is 2 Nt+Nm+Ny while the actually needed LUT length is 2 u + 2 Nm+l The second proposed technique, P2, employs one LUT of length 2 u' while the fractional bits of the address register are used to adjust the sample values in a manner which is modified version of that employed in [5].
The third proposed technique, P3, is similar to the first technique with NI= 2 bits.The result is a reduced implementation complexity and spurious harmonic distortion.
In Section 2, we present some background and review the trigo- nometric and other relevant interpolation methods.In Section 3, the proposed techniques are presented and analyzed.Simulation re- suits are presented and discussed in Section 4. Finally, the paper is concluded in Section 5.

BACKGROUND AND REVIEW OF INTERPOLATION METHODS
The conventional method for generating a digital sinusoidal signal is the well known LUT method [1].In this method, an integer L of sine wave samples are stored in a memory and then read at an appropriate time interval.The L samples are taken uniformly over a full period of the sine wave.Therefore, the phase increment is A0 27r/L.Let T be the sampling interval by which we step through the table and be the number of phase increments per step.Then, the frequency of the generated sinusoid is given by: where the maximum value of is necessary for the reconstruction of the signal and is specified by the Nyquist rate.Note that stepping through the table is simple and can be implemented by an accumulator that is incremented by every sampling interval T. When is restricted to integer values, the generated si'nusoidal signals are of extremely low harmonic distortion.In fact, the distortion is determined by the type of number representation and number of bits, b, used to represent the value of a sample in the memory.For two's complement number representation with rounding, the level of harmonic distortion is approximately 2-2b/6 which can be brought to any desired level by increasing b.The frequency resolution associated with an integer increment is clearly lILT which is fixed once L and T are fixed.
To increase the frequency resolution, the address register is incre- mented by a real number d with NI and NF bits for the integer and fractional parts of d, respectively.The frequency of the generated sinusoid is, thus, given by The frequency resolution is obviously given by A f= LT (3) and the effective table length is Le--2NL.Because the address lines of the LUT are connected to the integer part (L 2N') of the ad- dress register only, the generated sinusoids have spurious harmonic distortion.
It should be noted that the spurious harmonic distortion is a consequence of truncating the content of the address register and utilizing only the integer part to address the LUT, therefore, a different sample is actually being addressed when the fractional part of the address is different from zero.Let the content of the address register at a specific instant of time be nd--I+F where I and F are the integer and fractional parts of nd, respectively.The direct LUT method simply considers I and neglects F in addressing the LUT.The actually read sample is sin[AOI] instead of sin[AO(I+F)] which introduces a temporal quantization error that depends on A0,/, and F as given by e(AO, I,F) sin [AOI] sin [AO(I + F)] (4) The error sequence e(AO, LF) was analyzed in [3] and shown that it reduces the signal-to-noise ratio to a value in the range [201og(L)-5.17,201og(L)-4.92]dB.It can be shown that the error sequence e(A0, L F) is an additive noise that causes a harmonic dis- tortion approximately equal to AOZ/12 in agreement with the result in [3].To compare between the two distortion sources let the samples in the LUT be represented by 15 bits and let L 2048.It follows that the word length constraint (15 bits) causes a level of harmonic distortion approximately equal to -98 dB while the temporal quan- tization error, e(A0,/, F), results in a distortion of -55 dB.To avoid the distortion due to temporal quantization error, e(AO, I,F), L must be greater than 217= 131072 which is obviously a formidable memory size.Consequently, interpolation methods are used to reduce the amount of spurious harmonic distortion while maintaining high frequency resolution or equivalently large effective LUT length.
The trigonometric interpolation method can be summarized as follows: The implementation of Eq. ( 5) requires two LUTs in addition to the original LUT.In particular, we must have two more LUTs for stor- ing the sample values of sin[AOF] and cos[AOF].It was shown in [4] that the level of harmonic distortion associated with trigonometric interpolation method is essentially the same as that of the direct LUT method with a table length 2N'L.In other words, trigonometric interpolation method increases the effective table length without practically increasing the level of harmonic distortion.The interpolation method in [5] is given by sin [AO(I + F)]sin [AOI] 2! + cos [AOI]{AOF} (6)   This method has a performance comparable with that of the trigo- nometric interpolation method and requires less LUT length.In particular, the interpolation method in (6), denoted by M1 requires only 1/3 the LUT length required for trigonometric interpolation method and has essentially the same level of performance.However, the trigonometric interpolation method has low levels of harmonic distortion within an effective LUT length, Le 2rL, which is limited by the length of the used tables and can be increased only by increasing the length of these tables.On the other hand, M1 exhibits low levels of harmonic distortion within the same effective LUT length and its per- formance is limited by the size of L and NF, therefore, Le 2NL can be increased by increasing NF without the need for more memory size.

THE PROPOSED TECHNIQUES
In this section, we present three new techniques to extremely increase the frequency resolution while maintaining a reduced harmonic dis- tortion and hardware complexity.The first proposed technique, P1, is based on considering the fractional bits of the address register as two groups of NF1 and NF2 bits, respectively.The content of the NF2 bits is the least significant while the content of the integer Nx bits is the most significant.
[AOFg] (10) The implementation of (10) requires the generation of sin[A0(I+ F1)] and cos[AO(I+Fa)] as described in [4] and is illustrated by the block diagram of Figure  It should be noted that P1 implemented with NI-NF1 5 bits and NF2 16 bits has an effective LUT of 226 with low levels of spurious harmonic distortion.The trigonometric interpolation method when implemented with NI= NF1 5 bits has an effective LUT of 21 with low levels of spurious harmonic distortion.When the effective LUT is increased by further increase of the fractional address length without increasing the actual LUTs lengths, the result is an increase of spuri- ous harmonic distortion to a level comparable with that of the direct LUT method.
The second proposed technique, P2, is based on modifying M1 as given by sin [AO(I + F)] sin [AOI]   2!
The block diagram representation of P2 is shown in Figure 2.
The third proposed technique, P3, is based on modifying the meth- od P1 to simplify its hardware implementation.To this end, let NI-2 bits to obtain A0= 27r/4, hence, sin[AOI]=0, 4-1 and cos[AOI] =0, 4-for all values of I. Consequently, the LUT containing the values of sin[AOI] and cos[AOI] can be eliminated.Furthermore, multiplication by sin[AOI] and cos[AOI] is a simple switching operation which can be implemented by simple logic circuit.Let the content of the address register at a specific instant of time be nd= I+F1 +F2 where/, F1 and F2 are as defined earlier.It follows that sin(AOnd) is given by (13) The values of sin((Tr/2)F1) and cos((Tr/2)F1) are stored in two LUTs of length 2 Nr each while the values of sin((Tr/2)F2) and cos((Tr/2)F2) corresponding to the least significant NF2 bits are approximated as given by sin F2 =-'F2 (14) cos gF2 _l-g g.F:z (15) The approximations in ( 14) and (15) are accurate enough for 15 bits word length when N 2 bits and NF1 5 bits.In this case, the maxi- mum difference between sin((r/2)F2) and (r/2).F2 is 1.971 10-5 while the maximum difference between cos(Qr/2)F2) and 1-(1/2)((r/2).F2) 2 is 2.419 10 -7 which are both less than 2 -15 Substituting for sin((r/2)F2) and cos((r/2)F2) from ( 14) and ( 15  The block diagram representation of P3 is shown in Figure 3.It should be noted that P3 requires less number of multipliers and LUTs than that required by P1.

SIMULATION RESULTS
The direct LUT method as well as the trigonometric interpolation method and the proposed techniques are all simulated using MATLAB program.The simulation results are obtained assuming a sixteen-bit word length for all arithmetic operations.The trigonometric inter- polation method and the proposed technique P1 require three LUTs each containing 32 sample values while the direct LUT method is simulated using a look-up-table containing 128 sample values.The performance criterion used to compare the performance of various inter- polation methods is the total harmonic distortion, THD, defined by [4] ET E(f) where ET is the total energy of the sinusoidal waveform, E(fg) is the energy of the desired fundamental frequency fg, N and is the number of samples in a full period.The address increment d specifies N and fg =fctk/N, where the clock frequency, fctk, is assumed to be 50 MHz.
The address increment of the direct LUT (L 128) method is 4d in order to generate the same frequency of the oscillator using either the trigonometric interpolation method or the proposed technique with address increment d.Table I summarizes the simulation results obtained for the level of spurious harmonic distortion associated with direct LUT method, trigonometric interpolation method, and the proposed technique P1 dented by THDz), THDT and THDel, respectively.The table con- tains the value of the address increment d as varied over a wide range and the values of the generated frequency fg.It is evident from Table I that the level of spurious harmonic distortion is the same for the three methods for integer values of address increment d.For fractional values of address increment d in the range 2 -5<d< 1, the performance of trigonometric interpolation method and P1 is the same and is far better than that of the direct LUT method.How- ever, for fractional values of address increment d in the range 2-25 d < 2-5, the performance of trigonometric interpolation method although superior to that of the direct LUT method but is actually far less than that of P1.It should be noted that the performance of trigonometric interpolation method in the range 2-20< d< 2 -5 is approximately equal to that of the direct LUT method using L-1024.It is evident from the simulation results that for 2-2< d < 2-5, the level of THDel associated with P1 is slightly higher than its value in the range 2-5 < d < and levels to a limiting value which is approximately equal to 8.6 10-10.
Table II is intended to compare the performance of the interpola- tion method M1 with that of its modified version denoted by P2.It is evident from the simulation results that the performance of P1 is su- perior to that of M1 for all values of LUT length considered.The per- formance of P2 for L 32 is comparable with that of P1 while using only 1/3 of the required memory size.When P2 is simulated assuming L 64 and compared with P1 which utilizes three tables of length 32 each (i.e., 2/3 of the memory size memory size is required to imple- ment P1), the performance of P2 is found to be superior to that of P1.
Table III compares the performance of the interpolation method P2 with that of P3 for some typical values of L. It is evident from the TABLE II Simulation results of the oscillator based on P2 and that based on the interpolation method M1 for L 32 and L 64 d THDnI L 32 THD,2 L 32 THDM1 L 64 THD,:z L 64  simulation results that the performance of P3 is superior to that of P2 for all values of LUT length considered.The advantages of the proposed techniques over the direct LUT and trigonometric interpolation methods are clear.In particular, the proposed techniques outperform all other interpolation methods with essentially the same level of hardware complexity.Moreover, their performance is essentially the same over an extremely wide frequency range with extremely high frequency resolution.In fact the frequency ranges of P1, P2 and P3 are limited by the number of bits used to implement the fractional part of the address register rather than being limited by the look-up-table length.Therefore, by increasing the width of the fractional part of the address register, we can practically achieve any desired level of frequency resolution at the specified level of spurious harmonic distortion.

CONCLUSION
Three new techniques are proposed to significantly increase the frequency resolution and reduce the amount of spurious harmonic distortion in digital sinusoidal oscillators using Look-up-Table method.The proposed methods are simulated by a MATLAB program on a general purpose computer.The simulation results show that the harmonic distortion of the proposed methods is significantly less than that of both direct LUT and trigonometric interpolation methods for all cases in which the content of the least significant NF2 bits is different from zero.Moreover, the performance of the first proposed method, P1, is identical to that of the trigonometric interpolation method for all cases in which the content of the least significant NF2 bits is zero.The performance of the third proposed method, P3, is superior to that of P1, P2, and the trigonometric interpolation method.The proposed techniques are suitable for implementation on already available digital signal processors like TMS32010 DSP.In addition, digital sinusoidal oscillators based on the proposed methods can be fabricated on a single chip using mono- lithic large-scale integration.
FIGURE Block diagram of the first proposed technique/'1.

FIGURE 3
FIGURE 3 Block diagram of the third proposed technique P3.
1.One more multiplier and an adder are needed to (10) specifies P1 which does not require any extra table length over that required by the trigonometric interpolation method.It should be noted that the implementation of Eqs.(5) and (10) require the same LUT length and that each equation require three LUTs.The first LUT is for the storage of sin[AOI] and cos[AOI] and is of length 2N'.The second and third LUTs are of length 2 NF' each and are used for the storage of sin[AOF] and cos[AOF], respectively.The frequency resolution of the proposed technique is given by generate sin[AO(I+F1 +F2)] from sin[AO(I+F1)] and cos[AO(I+F)].Equation

TABLE
Parameters of the oscillator based on the proposed technique P1 and those using direct LUT and trigonometric interpolation methods