TWI390848B - Digital wave generator and method of generating a digital wave - Google Patents

Digital wave generator and method of generating a digital wave Download PDF

Info

Publication number
TWI390848B
TWI390848B TW98107364A TW98107364A TWI390848B TW I390848 B TWI390848 B TW I390848B TW 98107364 A TW98107364 A TW 98107364A TW 98107364 A TW98107364 A TW 98107364A TW I390848 B TWI390848 B TW I390848B
Authority
TW
Taiwan
Prior art keywords
data
value
phase
digital
function
Prior art date
Application number
TW98107364A
Other languages
Chinese (zh)
Other versions
TW201034387A (en
Inventor
Dick Tang
Tong Yaw Chen
Original Assignee
Tatung Co
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tatung Co filed Critical Tatung Co
Priority to TW98107364A priority Critical patent/TWI390848B/en
Publication of TW201034387A publication Critical patent/TW201034387A/en
Application granted granted Critical
Publication of TWI390848B publication Critical patent/TWI390848B/en

Links

Landscapes

  • Digital Transmission Methods That Use Modulated Carrier Waves (AREA)
  • Stabilization Of Oscillater, Synchronisation, Frequency Synthesizers (AREA)

Description

數位波形產生器及產生數位波形的方法Digital waveform generator and method for generating digital waveform

本發明是有關於一種波形產生器及產生波形的方法,且特別是有關於一種使用相區轉換法產生數位波形的數位波形產生器及產生數位波形的方法。The present invention relates to a waveform generator and a method of generating a waveform, and more particularly to a digital waveform generator for generating a digital waveform using a phase-to-phase conversion method and a method of generating a digital waveform.

在電子工程、通信工程、自動控制、遙測控制、測量儀器、儀表和計算機等技術領域,經常需要用到各式各樣的波形產生器。波形產生器一般是指能產生例如是正弦波(Sine Wave)、餘弦波(Cosine Wave)、方波(Square Wave)和三角波(Triangle Wave)等特定週期性時間函數波形的電路或儀器。In the fields of electronic engineering, communication engineering, automatic control, telemetry control, measuring instruments, meters and computers, it is often necessary to use a wide variety of waveform generators. A waveform generator generally refers to a circuit or instrument that produces a specific periodic time function waveform such as a sine wave, a cosine wave, a square wave, and a triangle wave.

正/餘弦波形的數位波形產生器一般用於通信系统,其所產生的正、餘弦波形經常用以提供信號的調變(Modulate)及解調變(Demodulate)。一般的數位波形產生器大多是使用函數表對照法(Mapping Method),來實現正/餘弦函數運算並輸出其波形。其中,函數表對照法是將整個正/餘弦函數對照表植入記憶體(Read Only Memory,ROM),並利用位址解碼的方法將存在記憶體的正/餘弦函數值輸出,以產生正/餘弦波形。Digital waveform generators for positive/cosine waveforms are commonly used in communication systems, and the resulting positive and cosine waveforms are often used to provide modulation and demodulation of the signal. Most of the general digital waveform generators use the Mapping Method to implement the sine/cosine function and output its waveform. The function table comparison method is to insert the entire positive/cosine function comparison table into a memory (Read Only Memory, ROM), and output the positive/cosine function value of the stored memory by using the address decoding method to generate positive/ Cosine waveform.

然而,位址解碼方法不但會消耗數位波形產生器中大量的記憶體及位址解碼電路,且增加了晶片的實現面積及製造成本。此外,龐大的電路面積更導致了電路運算速度降低、反應時間拉長等缺點,以至於造成數位波形產生器整體運算效能的低落。However, the address decoding method not only consumes a large amount of memory and address decoding circuits in the digital waveform generator, but also increases the implementation area and manufacturing cost of the wafer. In addition, the large circuit area leads to disadvantages such as reduced circuit operation speed and long reaction time, which causes the overall performance of the digital waveform generator to be low.

本發明提供一種數位波形產生器,其可在不使用波形函數對照表情況下完成波形函數運算,並據以輸出週期性數位波。The present invention provides a digital waveform generator that can perform a waveform function operation without using a waveform function look-up table and output a periodic digital wave accordingly.

本發明又提供一種產生數位波形的方法,其可在不使用波形函數對照表情況下完成波形函數運算,並據以產生週期性數位波。The present invention further provides a method of generating a digital waveform that can perform a waveform function operation without using a waveform function look-up table and thereby generate a periodic digital wave.

本發明提出一種數位波形產生器,包括頻率處理單元、相區鑑別單元、相區轉換單元、函數值計算單元以及極性轉換單元。頻率處理單元在以原型數位波為基準的情況下,依據頻率選擇信號而將角度資料的數值限縮或是放大2^P倍,並據以產生基準角度資料。其中,P為整數且P≧0。The invention provides a digital waveform generator, comprising a frequency processing unit, a phase region discriminating unit, a phase region converting unit, a function value calculating unit and a polarity converting unit. When the frequency processing unit is based on the prototype digital wave, the value of the angle data is limited or amplified by 2^P times according to the frequency selection signal, and the reference angle data is generated accordingly. Where P is an integer and P≧0.

相區鑑別單元依據基準角度資料中的R個最高有效位元與S個波形指示信號來產生相區鑑別信號,以指向原型數位波所延伸出之(2^R)*S個相區中的特定相區。其中,R與S為正整數。相區轉換單元依據相區鑑別信號從(2^R)*S個挪移關係式中選出對應特定相區的挪移關係式,以將基準角度資料的數值挪移至原型數位波的第1個相區內,並據以產生相區角度資料。The phase region discriminating unit generates a phase region discrimination signal according to the R most significant bits and the S waveform indication signals in the reference angle data, to point to the (2^R)*S phase regions extended by the prototype digital wave. Specific phase area. Where R and S are positive integers. The phase region converting unit selects a shift relationship corresponding to the specific phase region from the (2^R)*S shift relationship according to the phase region discrimination signal, and shifts the value of the reference angle data to the first phase region of the prototype digital wave. Inside, and according to the phase area data.

函數值計算單元提供用以合成位在第1個相區內之原型數位波的多個函數運算式,並將相區角度資料帶入至函數運算式之其一,以計算出相區角度資料所對應的相位函數值。極性轉換單元依據相區鑑別信號而決定輸出相位函數值的相反數或是直接輸出相位函數值作為波形輸出值,並利用波形輸出值產生頻率為原型數位波之1/(2^P)倍或是2^P倍的週期性數位波。The function value calculation unit provides a plurality of function expressions for synthesizing the prototype digit wave in the first phase region, and brings the phase region angle data to one of the function expressions to calculate the phase angle data. The corresponding phase function value. The polarity conversion unit determines the opposite of the output phase function value according to the phase region discrimination signal or directly outputs the phase function value as the waveform output value, and uses the waveform output value to generate the frequency as 1/(2^P) times of the prototype digit wave or It is a 2 × P times periodic digital wave.

在本發明之一實施例中,上述之頻率處理單元利用將角度資料右移或是左移P位元的方式,致使角度資料的數值限縮或是放大2^P倍。In an embodiment of the present invention, the frequency processing unit causes the angle data to be limited or enlarged by 2^P times by shifting the angle data to the right or by shifting the P bit to the left.

在本發明之一實施例中,上述之頻率處理單元更依據頻率選擇信號輸出直流輸出驅動信號,以驅動數位波形產生器所外接的電路。In an embodiment of the invention, the frequency processing unit further outputs a DC output driving signal according to the frequency selection signal to drive a circuit external to the digital waveform generator.

在本發明之一實施例中,上述之原型數位波的週期為2^N個取樣點,n用以表示基準角度資料之數值,且N為正整數,K為正數時,則原型數位波的函數式為:In an embodiment of the present invention, the period of the prototype digital wave is 2^N sampling points, n is used to represent the value of the reference angle data, and N is a positive integer, and when K is a positive number, the prototype digital wave is The function is:

在本發明之一實施例中,上述之R與S分別等於2時,相區鑑別信號用以識別原型數位波所延伸出之8個相區,且原型數位波的第1至第4個相區用以合成正弦數位波,而原型數位波的第5至第8個相區用以合成餘弦數位波。In an embodiment of the invention, when R and S are respectively equal to 2, the phase region discrimination signal is used to identify 8 phase regions extended by the prototype digital wave, and the first to fourth phases of the prototype digital wave are The region is used to synthesize a sinusoidal digital wave, and the fifth to eighth phase regions of the prototype digital wave are used to synthesize a cosine digital wave.

在本發明之一實施例中,上述之N等於8,K等於128,且z用以表示相區角度資料之數值時,儲存在相區轉換單元內的8個挪移關係式與8個相區相互對應,且8個挪移關係式分別如下所示:Z=n,其中n=0~63;Z=128-n,其中n=64~127;Z=n-128,其中n=128~191;Z=256-n,其中n=192~255;Z=64-n,其中n=0~63;Z=n-64,其中n=64~127;Z=192-n,其中n=128~191;以及Z=n-192,其中n=192~255。In an embodiment of the present invention, N is equal to 8, K is equal to 128, and z is used to represent the value of the phase angle data, and 8 shifting relations and 8 phase regions are stored in the phase converting unit. Corresponding to each other, and the eight shifting relations are as follows: Z=n, where n=0~63; Z=128-n, where n=64~127; Z=n-128, where n=128~191 ;Z=256-n, where n=192~255; Z=64-n, where n=0~63; Z=n-64, where n=64~127; Z=192-n, where n=128 ~191; and Z=n-192, where n=192~255.

在本發明之一實施例中,上述之函數值計算單元所提供的函數運算式分別如下所示:FMP (z)=2*z+z,其中z=0~3、20~23;FMP (z)=(2*z+1)+z,其中z=4~19;FMP (z)=2*z+24,其中z=24~27;FMP (z)=2*z+26,其中z=28~31、40~43;FMP (z)=2*z+27,其中z=32~39;FMP (z)=z+70,其中z=44~55;FMP (z)=126,其中z=56~59;以及FMP (z)=127,其中z=60~64。In an embodiment of the present invention, the function expressions provided by the function value calculation unit are as follows: F MP (z)=2*z+z, where z=0~3, 20~23; F MP (z)=(2*z+1)+z, where z=4~19; F MP (z)=2*z+24, where z=24~27; F MP (z)=2*z +26, where z=28~31, 40~43; F MP (z)=2*z+27, where z=32~39; F MP (z)=z+70, where z=44~55; F MP (z)=126, where z=56~59; and F MP (z)=127, where z=60~64.

在本發明之一實施例中,數位波形產生器更包括資料輸入單元、連續角度產生單元以及資料選擇單元。資料輸入單元對輸入位址進行解碼,以依據解碼後的輸入位址將數位資料視為單一角度資料或是運作指令。連續角度產生單元接收資料選擇信號,以決定是否產生連續角度資料。資料選擇單元依據資料選擇信號讀取單一角度資料或連續角度資料,以產生角度資料。In an embodiment of the invention, the digital waveform generator further includes a data input unit, a continuous angle generating unit, and a data selecting unit. The data input unit decodes the input address to treat the digital data as a single angle data or an operation instruction according to the decoded input address. The continuous angle generating unit receives the data selection signal to determine whether to generate continuous angle data. The data selection unit reads the single angle data or the continuous angle data according to the data selection signal to generate the angle data.

本發明提出一種產生數位波形的方法,包括以下步驟:首先,以一原型數位波為基準,依據一頻率選擇信號而將一角度資料的數值限縮或是放大2^P倍,並據以產生一基準角度資料,P為整數且P≧0。接著,依據基準角度資料中的R個最高有效位元與S個波形指示信號來產生一相區鑑別信號,以指向原型數位波所延伸出之(2^R)*S個相區中的一特定相區,R與S為正整數。The invention provides a method for generating a digital waveform, comprising the following steps: firstly, based on a prototype digital wave, the value of an angle data is limited or amplified by 2^P times according to a frequency selection signal, and accordingly A reference angle data, P is an integer and P ≧ 0. Then, a phase discrimination signal is generated according to the R most significant bits and the S waveform indication signals in the reference angle data, to point to one of (2^R)*S phase regions extended by the prototype digital wave. For a specific phase region, R and S are positive integers.

再來,依據相區鑑別信號從(2^R)*S個挪移關係式中選出對應特定相區的挪移關係式,以將基準角度資料的數值挪移至原型數位波的第1個相區內,並據以產生一相區角度資料。繼之,提供用以合成位在第1個相區內之原型數位波的多個函數運算式,並將相區角度資料帶入至這些函數運算式之其一,以計算出相區角度資料所對應的一相位函數值。Then, according to the phase region discrimination signal, the shift relationship corresponding to the specific phase region is selected from the (2^R)*S shift relationship to shift the value of the reference angle data to the first phase region of the prototype digital wave. And according to the data of the phase of the phase. Then, a plurality of functional expressions for synthesizing the prototype digital wave located in the first phase region are provided, and the phase angle data is brought into one of the functional expressions to calculate the phase angle data. The corresponding phase function value.

最後,依據相區鑑別信號而決定提供相位函數值的相反數或是直接提供相位函數值作為一波形輸出值,並利用波形輸出值產生頻率為原型數位波之1/(2^M)倍或是2^M倍的一週期性數位波。Finally, depending on the phase region discrimination signal, the inverse of the phase function value is determined or the phase function value is directly provided as a waveform output value, and the waveform output value is used to generate a frequency of 1/(2^M) times the prototype digital wave or It is a periodic digital wave of 2^M times.

基於上述,本發明主要是利用原型數位波本身的對稱性,將原型數位波分割成多個相區,並將基準角度資料挪移至其中之一的特定相區,再搭配多條函數運算式算出每一基準角度資料所對應的相位函數值,進而產生不同頻率的週期性數位波。因此,此數位波形產生器不需大量的解碼電路及記憶體便可產生週期性數位波,故節省了電路的面積及增加電路整體的運算速度。Based on the above, the present invention mainly utilizes the symmetry of the prototype digital wave itself, divides the prototype digital wave into a plurality of phase regions, and shifts the reference angle data to a specific phase region of one of them, and then calculates with a plurality of function expressions. The phase function value corresponding to each reference angle data, thereby generating periodic digital waves of different frequencies. Therefore, the digital waveform generator can generate periodic digital waves without a large number of decoding circuits and memories, thereby saving the area of the circuit and increasing the overall operation speed of the circuit.

為讓本發明之上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。The above described features and advantages of the present invention will be more apparent from the following description.

以下將列舉說明本發明之數位波形產生器,且為方便說明起見,將特別針對正/餘弦波的產生做詳細介紹。值得注意的是,下述實施例雖是以數位正/餘弦波的產生為例,但其並非用以限定本發明,熟習此技藝者可依照本發明之精神對下述實施例稍作修飾,惟其仍屬於本發明之範圍。The digital waveform generator of the present invention will be enumerated below, and the generation of the positive/cosine wave will be specifically described for convenience of explanation. It is to be noted that the following embodiments are exemplified by the generation of digital sine/cosine waves, but are not intended to limit the present invention. Those skilled in the art can modify the following embodiments in accordance with the spirit of the present invention. However, it still falls within the scope of the invention.

圖1A繪示為單一週期之正弦函數的波形圖,圖1B繪示為單一週期之餘弦函數的波形圖。請參照圖1A及圖1B,兩波形圖之橫軸與縱軸分別代表輸入角度θ及正弦函數sinθ與餘弦函數cosθ,其中輸入角度θ為時間t的函數,即θ=ωt,且ω為角速度。如圖1A及圖1B所示,正/餘弦函數之波形依據其對稱的特性可各自劃分為四個相區,其分別為相區Ph1~Ph4及相區Ph5~Ph8。FIG. 1A is a waveform diagram of a sinusoidal function of a single period, and FIG. 1B is a waveform diagram of a cosine function of a single period. Referring to FIG. 1A and FIG. 1B, the horizontal axis and the vertical axis of the two waveform diagrams respectively represent an input angle θ and a sine function sin θ and a cosine function cos θ, wherein the input angle θ is a function of time t, that is, θ=ωt, and ω is an angular velocity. . As shown in FIG. 1A and FIG. 1B, the waveforms of the positive/cosine function can be divided into four phase regions according to their symmetrical characteristics, which are phase regions Ph1 to Ph4 and phase regions Ph5 to Ph8, respectively.

其中,相區Ph1與Ph5對應輸入角度θ=0~90度之角度範圍;相區Ph2與Ph6對應輸入角度θ=90~180度之角度範圍;相區Ph3與Ph7對應輸入角度θ=90~270度之角度範圍,而相區Ph4與Ph8對應輸入角度θ=270~360度之角度範圍。換而言之,將正/餘弦函數各輸入角度所分別對應的相區可以整理如表1所示:The phase regions Ph1 and Ph5 correspond to the angular range of the input angle θ=0~90 degrees; the phase regions Ph2 and Ph6 correspond to the angular range of the input angle θ=90-180 degrees; the phase regions Ph3 and Ph7 correspond to the input angle θ=90~ The angle range of 270 degrees, and the phase areas Ph4 and Ph8 correspond to the angle range of the input angle θ=270~360 degrees. In other words, the phase regions corresponding to the input angles of the positive/cosine functions can be arranged as shown in Table 1:

值得注意的是,各相區之各輸入角度θ所對應的正弦函數sinθ或餘弦函數cosθ在波形上皆具有對稱性質。舉例而言,如圖1A所示,當輸入角度θ=0~180度時,其所對應的正弦函數sinθ是以輸入角度θ=90度為對稱軸,即相區Ph1與相區Ph2之波形對稱於輸入角度θ=90度之縱軸。當輸入角度θ=180~360度時,其所對應的正弦函數sinθ是以輸入角度θ=270度為對稱軸,即相區Ph3與相區Ph4之波形對稱於輸入角度θ=270度之縱軸。It is worth noting that the sinusoidal function sin θ or the cosine function cos θ corresponding to each input angle θ of each phase region has a symmetrical property on the waveform. For example, as shown in FIG. 1A, when the input angle θ=0~180 degrees, the corresponding sinusoidal function sin θ is the symmetry axis of the input angle θ=90 degrees, that is, the waveform of the phase region Ph1 and the phase region Ph2. Symmetrical to the vertical axis of the input angle θ = 90 degrees. When the input angle θ=180~360°, the corresponding sine function sinθ is the symmetry axis with the input angle θ=270 degrees, that is, the waveform of the phase region Ph3 and the phase region Ph4 is symmetrical with respect to the input angle θ=270 degrees. axis.

此外,當輸入角度θ=90~270度時,其所對應的正弦函數sinθ是以輸入角度θ=180度為反對稱軸,即相區Ph2與相區Ph3之波形反對稱於θ=180度之縱軸。因此,就正弦函數sinθ來看,只要得知相區Ph1~Ph4之任一相區內之各輸入角度θ與正弦函數sinθ的函數運算式,便可利用函數運算式並配合波形本身所具有的對稱性質,推演出其他相區之各輸入角度θ所對應的正弦函數sinθ的數值,進而完成完整週期(即相區Ph1~Ph4)的正弦函數之波形圖。In addition, when the input angle θ=90~270 degrees, the corresponding sine function sinθ is the antisymmetric axis with the input angle θ=180 degrees, that is, the waveform of the phase region Ph2 and the phase region Ph3 is opposed to θ=180 degrees. The vertical axis. Therefore, as far as the sinusoidal function sin θ is concerned, as long as the function expressions of the input angle θ and the sine function sin θ in any one of the phase regions Ph1 to Ph4 are known, the function expression can be used and the waveform itself has Symmetrical properties, the values of the sinusoidal functions sin θ corresponding to the input angles θ of other phase regions are derived, and the waveforms of the sinusoidal functions of the complete periods (ie, phase regions Ph1 to Ph4) are completed.

請繼續參照圖1A與圖1B,來看正弦函數與餘弦函數的相關性。在此,圖1B中相區Ph5之輸入角度θ=0~90度所對應的餘弦函數cosθ的數值,等同於圖1A中相區Ph2之輸入角度θ=90~180所對應的正弦函數sinθ的數值。相區Ph6之輸入角度θ=90~180所對應的餘弦函數cosθ的數值,等同於圖1A中相區Ph3之輸入角度θ=180~270度所對應的正弦函數sinθ的數值。Please continue to refer to FIG. 1A and FIG. 1B to see the correlation between the sine function and the cosine function. Here, the value of the cosine function cos θ corresponding to the input angle θ=0 to 90 degrees of the phase region Ph5 in FIG. 1B is equivalent to the sine function sin θ corresponding to the input angle θ=90-180 of the phase region Ph2 in FIG. 1A. Value. The value of the cosine function cos θ corresponding to the input angle θ=90-180 of the phase region Ph6 is equivalent to the value of the sine function sin θ corresponding to the input angle θ=180 to 270 degrees of the phase region Ph3 in FIG. 1A.

相區Ph7之輸入角度θ=180~270度所對應的餘弦函數cosθ的數值,等同於圖1A中相區Ph4之輸入角度θ=270~360度所對應的正弦函數sinθ的數值。而相區Ph8之輸入角度θ=270~360度所對應的餘弦函數cosθ的數值,等同於圖1A中相區Ph1之輸入角度θ=0~90度所對應的正弦函數sinθ的數值。也就是說,餘弦函數之各相區Ph5~Ph8所對應的餘弦函數cosθ的數值,皆可由正弦函數sinθ的數值推演而得知。The value of the cosine function cos θ corresponding to the input angle θ of the phase region Ph=180 to 270 degrees is equivalent to the value of the sine function sin θ corresponding to the input angle θ=270 to 360 degrees of the phase region Ph4 in FIG. 1A. The value of the cosine function cos θ corresponding to the input angle θ=270 to 360 degrees of the phase region Ph8 is equivalent to the value of the sine function sin θ corresponding to the input angle θ=0 to 90 degrees of the phase region Ph1 in FIG. 1A. That is to say, the value of the cosine function cos θ corresponding to each phase region Ph5~Ph8 of the cosine function can be derived from the numerical value of the sine function sin θ.

換而言之,只要得知相區Ph1~Ph4之任一相區之各輸入角度θ與正弦函數sinθ的函數運算式,接著利用這些函數運算式及正/餘弦函數之波形本身的對稱性質,不但可推演出正弦函數其他相區之各輸入角度θ所對應的正弦函數sinθ的數值,更可推衍出餘弦函數於相區Ph5~Ph8之各輸入角度θ所對應之餘弦函數cosθ的數值,進而完成完整週期(即相區Ph5~Ph8)的餘弦函數之波形圖。如此一來,便可在無函數對照表的情況下,得到完整週期的正/餘弦函數之波形圖,而大大地節省電路面積及記憶體的耗用。In other words, as long as the function expressions of the input angle θ and the sine function sin θ of any one of the phase regions Ph1 to Ph4 are known, then the symmetry properties of the waveforms of the function and the sinusoidal cosine function are used. Not only can the value of the sine function sin θ corresponding to each input angle θ of the other phase regions of the sinusoid function be derived, but also the value of the cosine function cos θ corresponding to the input angle θ of the cosine function in the phase regions Ph5 to Ph8 can be derived. Then complete the waveform diagram of the cosine function of the complete cycle (ie, phase regions Ph5~Ph8). In this way, the waveform of the sine/cosine function of the complete cycle can be obtained without the function comparison table, and the circuit area and the memory consumption are greatly saved.

為更了解如何藉由相區Ph1~Ph4之任一相區內之正弦函數sinθ的函數運算式,來獲得其餘七個相區之正弦函數sinθ與餘弦函數cosθ的數值,以下將針對這部份做更詳細說明,且為方便說明起見,以下將此方法簡稱為相區轉換法。To better understand how to obtain the sine function sin θ and the cosine function cos θ of the remaining seven phase regions by the functional expression of the sine function sin θ in any phase region of the phase region Ph1~Ph4, the following will be for this part. For a more detailed explanation, and for convenience of explanation, the following method is simply referred to as a phase region conversion method.

值得注意的是,由於相區Ph1內的正弦函數sinθ的數值皆為正數且輸入角度之角度範圍最小(θ=0~90度),故本實施例採用相區Ph1中輸入角度θ對應正弦函數sinθ的函數運算式作為完整波形之基本依據。在使用相區轉換法之前,必須先對正弦函數進行取樣(sampling)動作以產生數位正弦波函數。It is worth noting that since the values of the sinusoidal function sin θ in the phase region Ph1 are both positive and the angular range of the input angle is the smallest (θ = 0 to 90 degrees), the input angle θ corresponding to the sine function in the phase region Ph1 is used in this embodiment. The function of sin θ is used as the basis for the complete waveform. Before using the phase region conversion method, the sine function must be sampled to generate a digital sine wave function.

圖2A為圖1A單一週期之正弦波函數F(t)對時間t的時序圖,其中F(t)=sinωt=sinθ,週期T與頻率f互為倒數,且角速度ω=2πf,故輸入角度θ=ωt=2πt/T。在此,當t=0時,θ=2πt/T=0;當t=T/2時,θ=2πt/T=π;當t=T時,θ=2πt/T=2π,且由於π弳=180度,故t=0、T/2、T分別對應輸入角度θ=0度、180度及360度。2A is a timing diagram of the sine wave function F(t) of a single period of FIG. 1A versus time t, where F(t)=sinωt=sinθ, the period T and the frequency f are reciprocal with each other, and the angular velocity ω=2πf, so the input angle θ = ωt = 2πt / T. Here, when t=0, θ=2πt/T=0; when t=T/2, θ=2πt/T=π; when t=T, θ=2πt/T=2π, and due to π弪 = 180 degrees, so t = 0, T / 2, T correspond to the input angle θ = 0 degrees, 180 degrees and 360 degrees, respectively.

如圖2A所示,單一週期的正弦波函數F(t)上有多個取樣點S,且各取樣點S之時間間隔TS 取決於取樣點S的個數。在此,假設單一週期的正弦波函數具有2^N個取樣點S,其中N為正整數,並用以代表資料輸入所需的位元數。當取樣點S的個數越多時,也就是2^N=1024、2048…時,各取樣點S之時間間隔TS 越小,且所形成的波形亦會接近原本正弦波函數的波形。As shown in FIG. 2A, a single-cycle sine wave function F(t) has a plurality of sampling points S, and the time interval T S of each sampling point S depends on the number of sampling points S. Here, it is assumed that a single-cycle sine wave function has 2^N sample points S, where N is a positive integer and is used to represent the number of bits required for data input. When the number of sampling points S is larger, that is, 2^N=1024, 2048..., the smaller the time interval T S of each sampling point S is, and the waveform formed is also close to the waveform of the original sine wave function.

但是,隨著取樣點S之個數的增加,所需處理的資料量也會越龐大,且所需使用的位元數N也越多,需要更大的電路面積及更多記憶體以進行運算。因此,本實施例是將取樣點的個數設定為2^N=256,即資料輸入所需的位元數N=8,以降低整體電路面積及增加記憶體的運算速度。如此一來,本實例的正弦波函數F(t)在週期T內就會有256個取樣點S來將時間T作平均分配,其中各取樣點S分別對應不同的時間及各時間下所對應的輸入角度。However, as the number of sampling points S increases, the amount of data to be processed will be larger, and the number of bits N to be used will be larger, requiring a larger circuit area and more memory for the purpose. Operation. Therefore, in this embodiment, the number of sampling points is set to 2^N=256, that is, the number of bits required for data input is N=8, so as to reduce the overall circuit area and increase the operation speed of the memory. In this way, the sine wave function F(t) of the present example has 256 sampling points S in the period T to evenly distribute the time T, wherein each sampling point S corresponds to a different time and corresponding time. The input angle.

因此,在取樣數2^N=256的情況下,數位正弦波函數可表示為:sin(X)=sin(2nπ/256)=F1(n),其中,X=2nπ/256,且n=0~255,π=3.14159。Therefore, in the case of the number of samples 2^N=256, the digital sine wave function can be expressed as: sin(X)=sin(2nπ/256)=F1(n), where X=2nπ/256, and n= 0~255, π=3.14159.

在此,X用以代表以弳(radius)表示的輸入角度θ。n為數位角度輸入變數。由於π弳=180度,1弳=180度/3.14159=57.296度,因此當n=1時,X=2π/256=0.024544弳=1.40625度,亦即當數位角度輸入變數n每增加1,則表示輸入角度θ增加1.40625度。以此類推,當數位角度輸入變數n=64時,X=2π*64/256=π/2弳=1.40625度*64=90度。故經此轉換後,就能將正弦波函數F(t)以數位角度輸入變數n來表示,以完成數位正弦波函數,即F1(n)。因此,圖2A對時間作圖的正弦波函數F(t)便可表示為如圖2B對數位角度輸入變數作圖的數位正弦波函數F1(n)。Here, X is used to represent the input angle θ expressed in radiance. n is a digital angle input variable. Since π弪=180 degrees, 1弪=180 degrees/3.14159=57.296 degrees, when n=1, X=2π/256=0.024544弪=1.40625 degrees, that is, when the digital angle input variable n increases by 1, then Indicates that the input angle θ is increased by 1.40625 degrees. By analogy, when the digital angle input variable n=64, X=2π*64/256=π/2弪=1.40625 degrees*64=90 degrees. Therefore, after this conversion, the sine wave function F(t) can be represented by a digital angle input variable n to complete the digital sine wave function, that is, F1(n). Thus, the sine wave function F(t) plotted against time in FIG. 2A can be represented as a digital sine wave function F1(n) plotted as a digital angle input variable in FIG. 2B.

圖2B為單一週期之數位正弦波函數F1(n)對數位角度輸入變數的作圖,其中數位正弦波函數F1(n)=sin(2nπ/256)。請同時對照圖2A參照圖2B,圖2A與圖2B相似,且主要差異之處在於:圖2B的橫軸為數位角度輸入變數n,其對應於圖2A的時間t。如圖2B所示,在時間週期T1內可分為256個取樣點,即可示意寫成週期T1=256,且其中每一個取樣點對應不同時間下的輸入角度θ。舉例來說,當數位角度輸入變數n=0、64、128、192、256時,其分別各對應輸入角度θ=0、90、180、270及360度,且數位正弦波函數的數值分別為F1(0)=0、F1(64)=1、F1(128)=0、F1(192)=-1、F(256)=0。2B is a plot of a single-cycle digital sine wave function F1(n) versus a digital angle input variable, where the digital sine wave function F1(n)=sin(2nπ/256). Referring to FIG. 2B at the same time, FIG. 2A is similar to FIG. 2B, and the main difference is that the horizontal axis of FIG. 2B is a digital angle input variable n, which corresponds to the time t of FIG. 2A. As shown in FIG. 2B, it can be divided into 256 sampling points in the time period T1, that is, the writing period T1=256 can be schematically written, and each of the sampling points corresponds to the input angle θ at different times. For example, when the digital angle input variables n=0, 64, 128, 192, 256, respectively, the corresponding input angles θ=0, 90, 180, 270, and 360 degrees, and the numerical values of the digital sine wave function are respectively F1 (0) = 0, F1 (64) = 1, F1 (128) = 0, F1 (192) = -1, and F (256) = 0.

圖2C為另一單一週期之數位正弦波函數F2(m)對數位角度輸入變數m的作圖。請比較圖2B與圖2C,由圖形可發現,週期T2=1/2*T1=128,即數位正弦波函數F1(n)的頻率f1為數位正弦波函數F2(m)的頻率f2的兩倍。此外,由圖2B與圖2C可清楚看到數位正弦波函數的數值分別是F2(32)=F1(64)、F2(64)=F1(128)、…,亦即F2(m)=F1(n=2*m)。2C is a plot of another single cycle digital sine wave function F2(m) versus a digital angle input variable m. Please compare FIG. 2B with FIG. 2C. It can be found from the graph that the period T2=1/2*T1=128, that is, the frequency f1 of the digital sine wave function F1(n) is two of the frequency f2 of the digital sine wave function F2(m). Times. In addition, it can be clearly seen from FIG. 2B and FIG. 2C that the values of the digital sine wave function are F2(32)=F1(64), F2(64)=F1(128), . . . , that is, F2(m)=F1. (n=2*m).

也就是說,當數位正弦波函數F2(m)之頻率f2為數位正弦波函數F1(n)頻率f1之2倍時,若想求得數位正弦波函數F2(m)在數位角度輸入變數m=64時的數值,也就是F2(64),可藉由將64乘2,並將結果128視為數位角度輸入變數n,帶到數位正弦波函數F1(n)去計算,以求得數值F2(64)。由此可知,數位正弦波函數F2(m)的數值皆可從數位正弦波函數F1(n)來求得,故在此將數位正弦波函數F1(n)之頻率f1定義為基頻(Base Frequency)。That is to say, when the frequency f2 of the digital sine wave function F2(m) is twice the frequency f1 of the digital sine wave function F1(n), if the digital sine wave function F2(m) is to be obtained, the variable m is input at the digital angle. The value at =64, that is, F2(64), can be calculated by taking 64 times 2 and taking the result 128 as a digital angle input variable n, and taking it to the digital sine wave function F1(n) to calculate the value. F2 (64). It can be seen that the value of the digital sine wave function F2(m) can be obtained from the digital sine wave function F1(n), so the frequency f1 of the digital sine wave function F1(n) is defined as the fundamental frequency (Base). Frequency).

由此也可類推,當數位正弦波函數F2(m)之頻率f2為數位正弦波函數F1(n)頻率f1之1/2倍時,可將數位正弦波函數F2(m)的數位角度輸入變數m乘1/2,並將結果1/2*m視為數位角度輸入變數n=1/2*m,帶到數位正弦波函數F1(n)去計算,即可求出數位正弦波函數F2(m)。相似地,頻率f2為基頻f1的4倍、8倍、…的數位正弦波函數F2(m)亦可同理類推而產生。Therefore, when the frequency f2 of the digital sine wave function F2(m) is 1/2 times the frequency f1 of the digital sine wave function F1(n), the digital angle of the digital sine wave function F2(m) can be input. The variable m is multiplied by 1/2, and the result 1/2*m is regarded as the digital angle input variable n=1/2*m, and is brought to the digital sine wave function F1(n) to calculate, and the digital sine wave function can be obtained. F2(m). Similarly, the digital sine wave function F2(m) whose frequency f2 is 4 times, 8 times, ... of the fundamental frequency f1 can be similarly generated.

此外,為使數位正弦波函數F1(n)更方便以數位化的方式進行分析,本實施例更將數位正弦波函數F1(n)的數值進行整數化。在此,本實施例先利用常數放大原理,將數位正弦波函數F1(n)的數值放大K倍後,再對放大後的數值進行整數化的步驟,以產生原型數位正弦波函數式FST (n),其中K為正數。在本實施例中,假設K=128的情況下,將原型數位正弦波函數式FST (n)表示為:Further, in order to make the digital sine wave function F1(n) more convenient to perform analysis in a digitized manner, the present embodiment further integerizes the numerical value of the digital sine wave function F1(n). Here, in the present embodiment, the numerical amplification principle is used to amplify the numerical value of the digital sine wave function F1(n) by K times, and then the enlarged numerical value is integerized to generate a prototype digital sine wave function F ST . (n), where K is a positive number. In the present embodiment, assuming that K = 128, the prototype digital sine wave function F ST (n) is expressed as:

FST (n)=Int(128*sin(X))=Int(128*F1(n))=Int(128*sin(2nπ/256))=Int(Y)F ST (n)=Int(128*sin(X))=Int(128*F1(n))=Int(128*sin(2nπ/256))=Int(Y)

其中,Y=128*sin(2nπ/256),且n=0~255。此外,n=0~64對應輸入角度θ=0~90度,即相區Ph1之角度輸入範圍。n=64~128對應輸入角度θ=90~180度,即相區Ph2之角度輸入範圍。n=128~192對應輸入角度θ=180~270度,即相區Ph3之角度輸入範圍。n=192~255對應輸入角度θ=270~360度,即相區Ph4之角度輸入範圍。Where Y=128*sin(2nπ/256) and n=0~255. In addition, n=0~64 corresponds to the input angle θ=0~90 degrees, that is, the angle input range of the phase region Ph1. n=64~128 corresponds to the input angle θ=90~180 degrees, which is the angle input range of the phase zone Ph2. n=128~192 corresponds to the input angle θ=180~270 degrees, which is the angle input range of the phase zone Ph3. n=192~255 corresponds to the input angle θ=270~360 degrees, which is the angle input range of the phase zone Ph4.

同理,數位餘弦波函數亦可利用上述方法得到如下所示之原型數位餘弦波的函數式:Similarly, the digital cosine wave function can also obtain the function of the prototype digital cosine wave as shown below by using the above method:

FCT (n)=Int(128*cos(X))=Int(128*cos(2nπ/256))=Int(Y’)F CT (n)=Int(128*cos(X))=Int(128*cos(2nπ/256))=Int(Y')

其中,Y’=128*cos(2nπ/256),且n=0~255。此外,n=0~64對應輸入角度θ=0~90度,即相區Ph5之角度輸入範圍。n=64~128對應輸入角度θ=90~180度,即相區Ph6之角度輸入範圍。n=128~192對應輸入角度θ=180~270度,即相區Ph7之角度輸入範圍。n=192~255對應輸入角度θ=270~360度,即相區Ph8之角度輸入範圍。Where Y' = 128 * cos (2nπ / 256) and n = 0 to 255. In addition, n=0~64 corresponds to the input angle θ=0~90 degrees, that is, the angle input range of the phase region Ph5. n=64~128 corresponds to the input angle θ=90~180 degrees, which is the angle input range of the phase zone Ph6. n=128~192 corresponds to the input angle θ=180~270 degrees, which is the angle input range of phase phase Ph7. n=192~255 corresponds to the input angle θ=270~360 degrees, that is, the angle input range of the phase area Ph8.

值得注意的是,由於正/餘弦波函數本身的對稱性,因此相區Ph2~Ph8中的各輸入角度X所對應之原型數位正/餘弦波函數式FST (n)或FCT (n)的數值皆可從位在相區Ph1的原型數位正弦波的函數式FST (n)而推得。因此,本實施例將原型數位正弦波的函數式FST (n)設定為一原型數位波的函數式,以藉此同時合成正弦波與餘弦波。It is worth noting that due to the symmetry of the positive/cosine wave function itself, the prototype digital positive/cosine wave function F ST (n) or F CT (n) corresponding to each input angle X in the phase regions Ph2 to Ph8 The values can be derived from the functional formula F ST (n) of the prototype digital sine wave located in the phase region Ph1. Therefore, in this embodiment, the functional formula F ST (n) of the prototype digital sine wave is set as a function of a prototype digital wave, thereby synthesizing the sine wave and the cosine wave at the same time.

舉數位正弦波函數的例子來說,當n=32時,X=π/4=45度,其位於相區Ph1,此時原型數位正弦波的函數值就等同於FST (32)=+91;當n=96時,X=3π/4=135度,其位於相區Ph2,此時原型數位正弦波的函數值就等同於FST (96)=+91=FST (32);當n=160時,X=5π-4=225度,其位於相區Ph3,此時原型正弦數位波的函數值就等同於FST (160)=-91=-FST (32);當n=224時,X=7π/4=315度,其位於相區Ph4,此時原型數位正弦波的函數值就等同於FST (224)=-91=-FST (32)。For the example of a digital sine wave function, when n=32, X=π/4=45 degrees, which is located in the phase region Ph1, at which time the function value of the prototype digital sine wave is equivalent to F ST (32)=+ 91; when n=96, X=3π/4=135 degrees, which is located in the phase region Ph2, at which time the function value of the prototype digital sine wave is equivalent to F ST (96)=+91=F ST (32); When n=160, X=5π-4=225 degrees, which is located in the phase region Ph3. At this time, the function value of the prototype sinusoidal bit wave is equivalent to F ST (160)=-91=-F ST (32); When n=224, X=7π/4=315 degrees, which is located in the phase region Ph4, at which time the function value of the prototype digital sine wave is equivalent to F ST (224)=-91=-F ST (32).

因此,只要將位於相區Ph2~Ph4內之數位角度輸入變數n(即n=64~255)挪移為相區Ph1的相區角度資料之數值z(即範圍介於0~64的數位角度輸入變數n),再利用原型數位波的函數式FST (n)便可求得相區Ph2~Ph4之各數位角度輸入變數n所對應之原型數位正弦波的函數值。Therefore, the digital angle input variable n (ie, n=64~255) located in the phase regions Ph2~Ph4 is shifted to the value z of the phase angle data of the phase region Ph1 (ie, the digital angle input ranging from 0 to 64) The variable n), and then the function value F ST (n) of the prototype digital wave can be used to obtain the function value of the prototype digital sine wave corresponding to each digital input variable n of the phase region Ph2~Ph4.

再舉數位餘弦波函數的例子來說,當n=32時,X=π/4=45度,其位於相區Ph5,此時原型數位餘弦波的函數值就等同於FCT (32)=+91=+FST (32);當n=96時,X=3π/4=135度,其位於相區Ph6,此時原型數位餘弦波的函數值就等同於FCT (96)=-91=-FST (32);當n=160時,X=5π/4=225度,其位於相區Ph7,此時原型數位餘弦波的函數值就等同於FCT (160)=-91=-FST (32);當n=224時,X=7π/4=315度,其位於相區Ph8,此時原型數位餘弦波的函數值就等同於FCT (224)=-91=-FST (32)。Taking the example of the digital cosine wave function, when n=32, X=π/4=45 degrees, which is located in the phase region Ph5, at which time the function value of the prototype digital cosine wave is equivalent to F CT (32)= +91=+F ST (32); when n=96, X=3π/4=135 degrees, which is located in the phase region Ph6, at which time the function value of the prototype digital cosine wave is equivalent to F CT (96)=- 91=-F ST (32); when n=160, X=5π/4=225 degrees, which is located in the phase region Ph7, at which time the function value of the prototype digital cosine wave is equivalent to F CT (160)=-91 =-F ST (32); When n=224, X=7π/4=315 degrees, which is located in the phase region Ph8. At this time, the function value of the prototype digital cosine wave is equivalent to F CT (224)=-91= -F ST (32).

因此,只要將位於相區Ph5~Ph8內之數位角度輸入變數n(即n=0~256)挪移為相區Ph1的數位角度輸入變數z(即範圍介於0~64的數位角度輸入變數n),再利用原型數位波的函數式FST (n)便可求得相區Ph5~Ph8之各數位角度輸入變數n所對應之原型數位餘弦波的函數值。其中,數位角度輸入變數n與數位角度輸入變數z之轉換原理是由三角函數關係式而來。Therefore, the digital angle input variable n (ie, n=0~256) located in the phase regions Ph5~Ph8 is shifted to the digital angle input variable z of the phase region Ph1 (ie, the digital angle input variable n ranging from 0 to 64) Then, using the function F ST (n) of the prototype digital wave, the function value of the prototype digital cosine wave corresponding to each digital input variable n of the phase region Ph5~Ph8 can be obtained. Among them, the conversion principle of the digital angle input variable n and the digital angle input variable z is derived from the trigonometric function relationship.

圖3繪示為依據本發明一實施例之數位波形產生器的電路方塊圖。如圖3所示,數位波形產生器100包括一頻率處理單元110、一相區鑑別單元120、一相區轉換單元130、一函數值計算單元140及一極性轉換單元150。3 is a circuit block diagram of a digital waveform generator in accordance with an embodiment of the present invention. As shown in FIG. 3, the digital waveform generator 100 includes a frequency processing unit 110, a phase region identifying unit 120, a phase region converting unit 130, a function value calculating unit 140, and a polarity converting unit 150.

在本實施例中,頻率處理單元110是以原型數位波為基準,依據頻率選擇信號Freq_sel而將接收到的角度資料IndexM的數值限縮或是放大2^P倍,並據以產生基準角度資料IndexN。其中,原型數位波的函數式對應上述之FST (n),n為基準角度資料IndexN的數值,也就是上述之數位角度輸入變數n。角度資料IndexM的數值對應上述之數位角度輸入變數m。此外,由於本實施例之單一週期的正弦波函數具有2^N個取樣點,且N=8。因此,角度資料IndexM及基準角度資料IndexN皆以8位元表示,且其數值皆在0~255之範圍。In this embodiment, the frequency processing unit 110 limits or enlarges the value of the received angle data IndexM according to the frequency selection signal Freq_sel based on the prototype digital wave, and generates a reference angle data according to the reference signal. IndexN. Wherein, the functional formula of the prototype digital wave corresponds to the above F ST (n), and n is the value of the reference angle data IndexN, that is, the above-mentioned digital angle input variable n. The value of the angle data IndexM corresponds to the above-mentioned digital angle input variable m. Further, since the single-cycle sine wave function of the present embodiment has 2^N sampling points, and N=8. Therefore, the angle data IndexM and the reference angle data IndexN are all represented by 8 bits, and the values thereof are all in the range of 0 to 255.

在本實施例中,頻率處理單元110限縮或放大角度資料的方式是對角度資料IndexM的每一位元進行右移或左移的動作,即是對應先前圖2B~圖2C所描述:由數位角度輸入變數m產生新的數位角度輸入變數n的動作。詳言之,當角度資料IndexM之位元數左移1位元,以產生基準角度資料IndexN時,即代表角度資料IndexM的數值m被放大2^1=2倍(對應上述之P=1),且新產生的數值2m是被當作基準角度資料IndexN的數值n,即n=2m,並以8位元的形式輸出至相區轉換單元130,進而最後產生頻率為原型數位波2倍頻的週期性數位波。In this embodiment, the frequency processing unit 110 limits or enlarges the angle data by performing a right shift or a left shift on each bit of the angle data IndexM, that is, corresponding to the previous FIG. 2B to FIG. 2C: The digital angle input variable m produces a new digital angle input variable n. In detail, when the number of bits of the angle data IndexM is shifted to the left by 1 bit to generate the reference angle data IndexN, the value m representing the angle data IndexM is enlarged by 2^1=2 times (corresponding to P=1 above) And the newly generated value 2m is the value n which is regarded as the reference angle data IndexN, that is, n=2m, and is output to the phase area converting unit 130 in the form of 8 bits, and finally the frequency is 2 times the frequency of the prototype digital wave. Periodic digital waves.

同理,當角度資料IndexM之位元數左移2位元時,角度資料IndexM之數值m放大2^2=4倍(對應上述之P=2),且新產生的數值4m是被當作基準角度資料IndexN的數值n,即n=4m,並以8位元的形式輸出至相區轉換單元130,進而最後產生頻率為原型數位波4倍頻的週期性數位波。此外,在本實施例中,頻率處理單元110更用以接收時脈信號CLK與重置信號Reset,並具有輸出直流信號DCout的功能。其中,直流信號DCout用以驅動數位波形產生器所外接的電路。當重置信號Reset為邏輯高準位時,則直流信號DCout呈現邏輯低準位,基準角度資料IndexN=00000000,且頻率選擇信號Freq_sel=00000000。Similarly, when the number of bits of the angle data IndexM is shifted to the left by 2 bits, the value m of the angle data IndexM is enlarged by 2^2=4 times (corresponding to P=2 above), and the newly generated value 4m is regarded as The value n of the reference angle data IndexN, that is, n = 4 m, is output to the phase area converting unit 130 in the form of 8 bits, and finally a periodic digital wave having a frequency of 4 times the frequency of the prototype digital wave is finally generated. In addition, in this embodiment, the frequency processing unit 110 is further configured to receive the clock signal CLK and the reset signal Reset, and have a function of outputting the DC signal DCout. The DC signal DCout is used to drive a circuit external to the digital waveform generator. When the reset signal Reset is at a logic high level, the DC signal DCout exhibits a logic low level, the reference angle data IndexN=00000000, and the frequency selection signal Freq_sel=00000000.

在此,頻率選擇信號Freq_sel用以決定角度資料IndexM的數值m被限縮或是放大的倍數。表2為頻率選擇處理單元110的真值表,以下將針對不同的頻率選擇信號Freq_sel做更詳細的描述。Here, the frequency selection signal Freq_sel is used to determine whether the value m of the angle data IndexM is limited or multiplied. Table 2 is a truth table of the frequency selection processing unit 110, which will be described in more detail below for different frequency selection signals Freq_sel.

如表2所示,每一頻率選擇信號Freq_sel對應不同的左移位元數。當重置信號Reset為邏輯低準位,且頻率選擇信號Freq_sel=00000001時,則輸出基準角度資料IndexN=00000000,及邏輯高準位的直流信號DCout,以驅動外接電路所欲控制的裝置。當重置信號Reset為邏輯低準位,且頻率選擇信號Freq_sel=00000010時,則角度資料IndexM不進行位元的左移,故輸出的基準角度資料IndexN等同於輸入的角度資料IndexM。即基準角度資料IndexN之數值n與輸入角度資料IndexM之數值m相同,即n=m,故最後產生的週期性數位波之頻率f2會等同於原型數位波的頻率f1。As shown in Table 2, each frequency selection signal Freq_sel corresponds to a different number of left shifting elements. When the reset signal Reset is at a logic low level and the frequency selection signal Freq_sel=00000001, the reference angle data IndexN=00000000 and the logic high level DC signal DCout are output to drive the device to be controlled by the external circuit. When the reset signal Reset is at a logic low level and the frequency selection signal Freq_sel=00000010, the angle data IndexM does not shift to the left of the bit, so the output reference angle data IndexN is equivalent to the input angle data IndexM. That is, the value n of the reference angle data IndexN is the same as the value m of the input angle data IndexM, that is, n=m, so the frequency f2 of the last generated periodic digital wave is equivalent to the frequency f1 of the prototype digital wave.

當頻率選擇信號Freq_sel為00000100時,且重置信號Reset為邏輯低準位時,則輸出之直流信號DCout呈現邏輯低準位,且角度資料IndexM的每一位元會被左移1位元,使得輸出的基準角度資料IndexN之數值n為輸入之角度資料IndexM之數值m的2倍,即n=2m,故最後產生的週期性數位波之頻率f2會是原型數位波的頻率f1的2倍。When the frequency selection signal Freq_sel is 00000100, and the reset signal Reset is at a logic low level, the output DC signal DCout exhibits a logic low level, and each bit of the angle data IndexM is shifted to the left by 1 bit. The value n of the output reference angle data IndexN is twice the value m of the input angle data IndexM, that is, n=2m, so the frequency f2 of the last generated periodic digital wave is twice the frequency f1 of the prototype digital wave. .

當頻率選擇信號Freq_sel為00001000時,且重置信號Reset為邏輯低準位時,則輸出之直流信號DCout呈現邏輯低準位,且角度資料IndexM的每一位元會被左移2位元,使得輸出的基準角度資料IndexN之數值n為輸入之角度資料IndexM之數值m的2^2倍,即n=4m,故最後產生的週期性數位波之頻率f2會是原型數位波的頻率f1的4倍。When the frequency selection signal Freq_sel is 00001000, and the reset signal Reset is at a logic low level, the output DC signal DCout exhibits a logic low level, and each bit of the angle data IndexM is shifted to the left by 2 bits. The value n of the output reference angle data IndexN is 2^2 times the value m of the input angle data IndexM, that is, n=4m, so the frequency f2 of the last generated periodic digital wave will be the frequency f1 of the prototype digital wave. 4 times.

當頻率選擇信號Freq_sel為00010000時,且重置信號Reset為邏輯低準位時,則輸出之直流信號DCout呈現邏輯低準位,且角度資料IndexM的每一位元會被左移3位元,使得輸出的基準角度資料IndexN之數值n為輸入之角度資料IndexM之數值m的2^3倍,即n=8m,故最後產生的週期性數位波之頻率f2會是原型數位波的頻率f1的8倍。When the frequency selection signal Freq_sel is 00010000, and the reset signal Reset is at a logic low level, the output DC signal DCout exhibits a logic low level, and each bit of the angle data IndexM is shifted to the left by 3 bits. The value n of the output reference angle data IndexN is 2^3 times the value m of the input angle data IndexM, that is, n=8m, so the frequency f2 of the last generated periodic digital wave will be the frequency f1 of the prototype digital wave. 8 times.

當頻率選擇信號Freq_sel為00100000時,且重置信號Reset為邏輯低準位時,則輸出之直流信號DCout呈現邏輯低準位,且角度資料IndexM的每一位元會被左移4位元,使得輸出的基準角度資料IndexN之數值n為輸入之角度資料IndexM之數值m的2^4倍,即n=16m,故最後產生的週期性數位波之頻率f2會是原型數位波的頻率f1的16倍。When the frequency selection signal Freq_sel is 00100000, and the reset signal Reset is at a logic low level, the output DC signal DCout exhibits a logic low level, and each bit of the angle data IndexM is shifted to the left by 4 bits. The value n of the output reference angle data IndexN is 2^4 times the value m of the input angle data IndexM, that is, n=16m, so the frequency f2 of the last generated periodic digital wave will be the frequency f1 of the prototype digital wave. 16 times.

當頻率選擇信號Freq_sel為01000000時,且重置信號Reset為邏輯低準位時,則輸出之直流信號DCout呈現邏輯低準位,且角度資料IndexM的每一位元會被左移5位元,使得輸出的基準角度資料IndexN之數值n為輸入之角度資料IndexM之數值m的2^5倍,即n=32m,故最後產生的週期性數位波之頻率f2會是原型數位波的頻率f1的32倍。When the frequency selection signal Freq_sel is 01000000, and the reset signal Reset is at a logic low level, the output DC signal DCout exhibits a logic low level, and each bit of the angle data IndexM is shifted to the left by 5 bits. The value n of the output reference angle data IndexN is 2^5 times the value m of the input angle data IndexM, that is, n=32m, so the frequency f2 of the last generated periodic digital wave will be the frequency f1 of the prototype digital wave. 32 times.

當頻率選擇信號Freq_sel為10000000時,且重置信號Reset為邏輯低準位時,則輸出之直流信號DCout呈現邏輯低準位,且角度資料IndexM的每一位元會被左移6位元,使得輸出的基準角度資料IndexN之數值n為輸入之角度資料IndexM之數值m的2^6倍,即n=64m,故最後產生的週期性數位波之頻率f2會是原型數位波的頻率f1的64倍。When the frequency selection signal Freq_sel is 10000000, and the reset signal Reset is at a logic low level, the output DC signal DCout exhibits a logic low level, and each bit of the angle data IndexM is shifted to the left by 6 bits. The value n of the output reference angle data IndexN is 2^6 times the value m of the input angle data IndexM, that is, n=64m, so the frequency f2 of the last generated periodic digital wave will be the frequency f1 of the prototype digital wave. 64 times.

請繼續參照圖3,如圖3所示,頻率處理單元110還會擷取基準角度資料IndexN中的2個最高有效位元,以產生相區鑑別單元120的相區信號xdela。其中,在本實施例中的2個最高有效位元分別是基準角度資料IndexN中的第8位元與第7位元。為方便說明,以下以IndexN[7]與IndexN[6]來代表基準角度資料IndexN中的第8位元與第7位元。其中,IndexN[7]、IndexN[6]可用以表示原型數位波依據其對稱的特性可分為2^2的相區。Referring to FIG. 3, as shown in FIG. 3, the frequency processing unit 110 also captures the 2 most significant bits in the reference angle data IndexN to generate the phase region signal xdela of the phase region identifying unit 120. The two most significant bits in this embodiment are the 8th bit and the 7th bit in the reference angle data IndexN, respectively. For convenience of explanation, the following describes the 8th and 7th bits in the reference angle data IndexN by IndexN[7] and IndexN[6]. Among them, IndexN[7] and IndexN[6] can be used to indicate that the prototype digital wave can be divided into 2^2 phase regions according to its symmetrical characteristics.

此外,由於正弦波和餘弦波依據其對稱特性皆可分為4個相區,故還需搭配額外的訊號才能判斷所欲產生之週期性數位波為正弦數位波或是餘弦數位波。因此,除了IndexN[7]、IndexN[6],相區鑑別單元120還需2個波形指示信號xSin與xCos才能產生相區鑑別信號Ph_discri,以指向原型數位波所延伸出之(2^2)*2個相區中的一特定相區。In addition, since the sine wave and the cosine wave can be divided into four phase regions according to their symmetrical characteristics, an additional signal is needed to determine whether the desired periodic digital wave is a sinusoidal bit wave or a cosine digital bit wave. Therefore, in addition to IndexN[7], IndexN[6], the phase region discriminating unit 120 needs two waveform indicating signals xSin and xCos to generate the phase region discriminating signal Ph_discri to point to the extension of the prototype digit wave (2^2). * A specific phase zone of 2 phase zones.

詳言之,當相區信號xdela=00、01、10、11時,其可分別代表基準角度資料IndexN的數值n位於相區Ph1或相區Ph5、相區Ph2或相區Ph6、相區Ph3或相區Ph7、相區Ph4或相區Ph8。也就是說,為了要判斷基準角度資料IndexN的數值n是位於相區Ph1或相區Ph5,光有相區信號xdela是不夠的,還必須根據波形指示信號xSin與xCos才能確定。In detail, when the phase region signals xdela=00, 01, 10, 11, respectively, they can represent the value n of the reference angle data IndexN, respectively, in the phase region Ph1 or the phase region Ph5, the phase region Ph2 or the phase region Ph6, and the phase region Ph3. Or phase zone Ph7, phase zone Ph4 or phase zone Ph8. That is to say, in order to judge that the value n of the reference angle data IndexN is located in the phase region Ph1 or the phase region Ph5, the phase signal xdela of the light is insufficient, and must be determined according to the waveform indication signals xSin and xCos.

更進一步來說,當相區信號xdela=00且波形指示信號xSin=1時,才可確定基準角度資料IndexN的數值n是位於相區Ph1。反之,若波形指示信號xCos=1時,則可確定基準角度資料IndexN的數值n是位於相區Ph5。表3為相區鑑別單元120之輸入輸出信號與特徵描述的對照表。Further, when the phase region signal xdela=00 and the waveform indication signal xSin=1, it can be determined that the value n of the reference angle data IndexN is located in the phase region Ph1. On the other hand, if the waveform indication signal xCos=1, it can be determined that the value n of the reference angle data IndexN is located in the phase region Ph5. Table 3 is a comparison table of input and output signals and feature descriptions of the phase region discriminating unit 120.

如表3所示,不同的輸入信號會對應不同的相區鑑別信號Ph_discri,其分別代表基準角度資料IndexN之數值n所位於的相區。综上所述,相區鑑別信號Ph_discri用以識別原型數位波所延伸出之8個相區。其中,原型數位波的相區Ph1~Ph4用以合成正弦數位波,原型數位波的相區Ph5~Ph8用以合成餘弦數位波。As shown in Table 3, the different input signals correspond to different phase region discrimination signals Ph_discri, which respectively represent the phase regions in which the value n of the reference angle data IndexN is located. In summary, the phase identification signal Ph_discri is used to identify the eight phase regions extended by the prototype digital wave. The phase regions Ph1~Ph4 of the prototype digital wave are used to synthesize the sinusoidal digital wave, and the phase regions Ph5~Ph8 of the prototype digital wave are used to synthesize the cosine digital wave.

請繼續參照圖3,如圖3所示,相區轉換單元130接收來自頻率處理單元110的基準角度資料IndexN,以及來自相區鑑別單元120的相區鑑別信號Ph_discri。相區轉換單元130在接收這些信號後會從8個挪移關係式中選出對應特定相區的挪移關係,並將基準角度資料IndexN的數值n挪移至原型數位波的第1個相區內,以產生相區角度資料PhaseZ。其中,所述的8個挪移關係式分別對應相區Ph1~Ph8。值得注意的是,相區轉換單元130所執行的功能即是先前所提到的相區轉換法。以下將針對這部份作更為詳盡的描述。Referring to FIG. 3, as shown in FIG. 3, the phase area converting unit 130 receives the reference angle data IndexN from the frequency processing unit 110, and the phase area discrimination signal Ph_discri from the phase area identifying unit 120. After receiving the signals, the phase region converting unit 130 selects a shifting relationship corresponding to the specific phase region from the eight shifting relationships, and shifts the value n of the reference angle data IndexN to the first phase region of the prototype digit wave to Phase phase angle data PhaseZ is generated. The eight shifting relationships respectively correspond to the phase regions Ph1~Ph8. It is to be noted that the function performed by the phase area converting unit 130 is the previously mentioned phase area converting method. This section will be described in more detail below.

圖4繪示為單位圓上的三角函數。如圖4所示,P(x,y)是在單位圓上,以O(0,0)為圓心、座標(1,0)為起點,並以角速率ω逆時鐘方向運動的動點,其中線段與x軸的夾角θ是時間t的函數(θ=ωt),其代表三角函數之輸入角度。座標(x,y)分別定義為餘弦函數cosθ和正弦函數sinθ,即x=cosθ和y=sinθ是單位圓=1)的自然的動態,且座標(x,y)亦分別對應於本實施例之原型數位餘弦波函數式FCT (n)的數值與原型數位正弦波函數式FST (n)的數值。Figure 4 shows a trigonometric function on a unit circle. As shown in Fig. 4, P(x, y) is a moving point on the unit circle, with O(0, 0) as the center and coordinates (1, 0) as the starting point, and moving at an angular rate ω counterclockwise. Line segment The angle θ with the x-axis is a function of time t (θ = ωt), which represents the input angle of the trigonometric function. The coordinates (x, y) are defined as cosine function cos θ and sine function sin θ, respectively, ie x=cos θ and y=sin θ are unit circles =1) the natural dynamics, and the coordinates (x, y) also correspond to the numerical values of the prototype digital cosine wave function F CT (n) and the numerical value of the prototype digital sine wave function F ST (n), respectively. .

值得注意的是,正弦/餘弦函數的基本性質可用圓的幾何性質(主要是對稱性)來表述,其包括:(1)畢氏定理:cos2 θ+sin2 θ==1;(2)週期性:圓周周長=2π,cos(2π+θ)=cosθ及sin(2π+θ)=sinθ;(3)對稱性:cos(-θ)=cos(θ)、sin(-θ)=-sinθ;cos(π-θ)=-cosθ、sin(π-θ)=sinθ;sin(π/2-θ)=cosθ、cos(π/2-θ)=sinθ。It is worth noting that the basic properties of the sine/cosine function can be expressed by the geometric properties of the circle (mainly symmetry), including: (1) Pythagorean theorem: cos 2 θ + sin 2 θ = =1; (2) periodicity: circumference circumference = 2π, cos(2π + θ) = cos θ and sin(2π + θ) = sin θ; (3) symmetry: cos(-θ) = cos(θ), Sin(-θ)=-sinθ; cos(π-θ)=-cosθ, sin(π-θ)=sinθ; sin(π/2-θ)=cosθ, cos(π/2-θ)=sinθ.

其中,座標(1,0)、(0,1)、(-1,0)、(0,-1)分別對應三角函數之輸入角度θ=0度、90度、180度及270度,即本實施例基準角度資料IndexN之數值n=0,64,128,192之情況,且基準角度資料IndexN之數值n=0~63、64~127、128~191及192~255分別對應相區Ph1~Ph4。此外,為方便說明,以下將位於相區Ph1的基準角度資料IndexN,也就是數值n=0~63,定義為相區角度資料PhaseZ,即數值Z=0~63,並將位於相區Ph1的原型數位波的函數式FST (n)定義為函數運算式FMP (z)。Wherein, the coordinates (1, 0), (0, 1), (-1, 0), (0, -1) respectively correspond to the input angles of the trigonometric functions θ = 0 degrees, 90 degrees, 180 degrees, and 270 degrees, that is, In the embodiment, the value of the reference angle data IndexN is n=0, 64, 128, 192, and the values of the reference angle data IndexN are n=0~63, 64~127, 128~191 and 192~255 respectively corresponding to the phase regions Ph1~Ph4. In addition, for convenience of explanation, the following reference angle data IndexN located in the phase region Ph1, that is, the value n=0~63, is defined as the phase angle data PhaseZ, that is, the value Z=0~63, and will be located in the phase region Ph1. The function F ST (n) of the prototype digital wave is defined as the function expression F MP (z).

因此,對照圖4及利用上述之三角函數的對稱性,便可分別找出相區Ph1~Ph8之基準角度資料IndexN與相區角度資料PhaseZ的對應關係,並歸納出8個挪移關係式,以下將針對這部份做更為詳盡的描述。Therefore, referring to FIG. 4 and using the symmetry of the above-described trigonometric function, the correspondence relationship between the reference angle data IndexN of the phase regions Ph1 to Ph8 and the phase angle data PhaseZ can be respectively found, and the eight shift relations are summarized. A more detailed description of this part will be made.

當n=0~63且對應相區Ph1時,由於基準角度資料IndexN位於相區Ph1,即相區角度資料PhaseZ所在之相區。因此,基準角度資料IndexN之數值n等同於相區角度資料PhaseZ之數值Z。表4A為當基準角度資料IndexN之數值n位於相區Ph1,n與z的挪移關係表。When n=0~63 and corresponding to the phase region Ph1, since the reference angle data IndexN is located in the phase region Ph1, that is, the phase region in which the phase angle data PhaseZ is located. Therefore, the value n of the reference angle data IndexN is equivalent to the value Z of the phase angle data PhaseZ. Table 4A is a table of the shift relationship of the value n of the reference angle data IndexN in the phase regions Ph1, n and z.

當n=64~127且對應相區Ph2時,由於基準角度資料IndexN位於相區Ph2,因此利用三角函數的對稱性sin(π-θ)=sinθ(其中π對應於基準角度資料IndexN之數值n=128,θ對應基準角度資料IndexN之數值n=64~127),可得到以下原型數位波的函數式FST (n)的數值與函數運算式FMP (z)的數值的比較結果:When n=64~127 and corresponds to the phase region Ph2, since the reference angle data IndexN is located in the phase region Ph2, the symmetry sin(π-θ)=sinθ using the trigonometric function (where π corresponds to the value n of the reference angle data IndexN) =128, θ corresponds to the value of the reference angle data IndexN n=64~127), and the comparison between the value of the function F ST (n) of the following prototype digital wave and the value of the function expression F MP (z) can be obtained:

FST (64)=FMP (64)、FST (65)=FMP (63)、FST (66)=FMP (62)、FST (67)=FMP (61)、…、FST (124)=FMP (4)、FST (125)=FMP (3)、FST (126)=FMP (2)、FST (127)=FMP (1)。F ST (64)=F MP (64), F ST (65)=F MP (63), F ST (66)=F MP (62), F ST (67)=F MP (61),... F ST (124) = F MP (4), F ST (125) = F MP (3), F ST (126) = F MP (2), F ST (127) = F MP (1).

也就是說若要利用函數運算式FMP (z)的數值來求得位於相區Ph2的原型數位波的函數式FST (n)的數值時,相區角度資料PhaseZ的數值z等同於128減去基準角度資料IndexN之數值n,即z=128-n。表4B為整理當基準角度資料IndexN之數值n位於相區Ph2,n與z的挪移關係表。That is to say, if the value of the functional formula F MP (z) is used to obtain the value of the functional formula F ST (n) of the prototype digital wave located in the phase region Ph2, the value z of the phase angle data PhaseZ is equivalent to 128. Subtract the value n of the reference angle data IndexN, ie z=128-n. Table 4B is a table for shifting the value n of the reference angle data IndexN in the phase region Ph2, n and z.

當n=128~191且對應相區Ph3時,由於基準角度資料IndexN位於相區Ph3,因此利用三角函數的對稱性sin(θ-π)=-sinθ(其中π對應於基準角度資料IndexN之數值n=128,θ對應基準角度資料IndexN之數值n=128~191),可得到以下原型數位波的函數式FST (n)的數值與函數運算式FMP (z)的數值的比較結果:When n=128~191 and corresponding to the phase region Ph3, since the reference angle data IndexN is located in the phase region Ph3, the symmetry sin(θ-π)=-sinθ of the trigonometric function is used (where π corresponds to the value of the reference angle data IndexN) n=128, θ corresponds to the value of the reference angle data IndexN n=128~191), and the comparison between the value of the function F ST (n) of the following prototype digit wave and the value of the function expression F MP (z) can be obtained:

FST (128)=-FMP (0)、FST (129)=-FMP (1)、FST (130)=-FMP (2)、FST (131)=-FMP (3)、FST (132)=-FMP (4)、…、FST (188)=-FMP (60)、FST (189)=-FMP (61)、FST (190)=-FMP (62)、FST (191)=-FMP (63)。F ST (128)=-F MP (0), F ST (129)=-F MP (1), F ST (130)=-F MP (2), F ST (131)=-F MP (3 ), F ST (132)=-F MP (4),..., F ST (188)=-F MP (60), F ST (189)=-F MP (61), F ST (190)=- F MP (62), F ST (191) = -F MP (63).

也就是說若要利用函數運算式FMP (z)的數值來求得位於相區Ph3的原型數位波的函數式FST (n)的數值時,相區角度資料PhaseZ的數值z等同於基準角度資料IndexN之數值n減去128,即z=n-128,且FS T(n)=-FMP (z)。表4C為整理當基準角度資料IndexN之數值n位於相區Ph3,n與z的挪移關係表。That is to say, if the value of the functional formula F MP (z) is used to obtain the value of the functional formula F ST (n) of the prototype digital wave located in the phase region Ph3, the value z of the phase angle data PhaseZ is equivalent to the reference. The value n of the angle data IndexN is subtracted by 128, i.e., z = n - 128, and F S T(n) = -F MP (z). Table 4C is a table for shifting the value n of the reference angle data IndexN in the phase region Ph3, n and z.

當n=192~256且對應相區Ph4時,由於基準角度資料IndexN位於相區Ph4,因此利用三角函數的對稱性Sin(2π-θ)=-sinθ(其中2π對應於基準角度資料IndexN之數值n=256,θ對應基準角度資料IndexN之數值n=192~255),可得到以下原型數位波的函數式FST (n)的數值與函數運算式FMP (z)的數值的比較結果:When n=192~256 and corresponding to the phase region Ph4, since the reference angle data IndexN is located in the phase region Ph4, the symmetry Sin(2π-θ)=-sinθ using the trigonometric function (where 2π corresponds to the value of the reference angle data IndexN) n=256, θ corresponds to the value of the reference angle data IndexN=192~255), and the comparison between the value of the function F ST (n) of the following prototype digital wave and the value of the function expression F MP (z) can be obtained:

FST (192)=-FMP (64)、FST (193)=-FMP (63)、FST (194)=-FMP (62)、FST (195)=-FMP (61)、…、FST (252)=-FMP (4)、FST (253)=-FMP (3)、FST (254)=-FMP (2)、FST (255)=-FMP (1)、FST (256)=-FMP (0)。F ST (192)=-F MP (64), F ST (193)=-F MP (63), F ST (194)=-F MP (62), F ST (195)=-F MP (61 ),..., F ST (252)=-F MP (4), F ST (253)=-F MP (3), F ST (254)=-F MP (2), F ST (255)=- F MP (1), F ST (256) = -F MP (0).

也就是說若要利用函數運算式FMP (z)的數值來求得位於相區Ph4的原型數位波的函數式FST (n)的數值時,相區角度資料PhaseZ的數值z等同於256減去基準角度資料IndexN之數值n,即z=256-n,且FST (n)=-FMP (z)。表4D為整理當基準角度資料IndexN之數值n位於相區Ph4,n與z的挪移關係表。That is to say, if the value of the functional formula F MP (z) is used to obtain the value of the function F ST (n) of the prototype digital wave located in the phase region Ph4, the value z of the phase angle data PhaseZ is equivalent to 256. Subtract the value n of the reference angle data IndexN, ie z=256-n, and F ST (n)=-F MP (z). Table 4D is a table for shifting the value n of the reference angle data IndexN in the phase region Ph4, n and z.

當n=0~63且對應相區Ph5(原型數位餘弦波所屬之相區)時,利用三角函數的對稱性cosθ=sin(π/2-θ)(其中π/2對應於基準角度資料IndexN之數值n=64,θ對應基準角度資料IndexN之數值n=0~63),可得到以下原型數位餘弦波函數式FCT (n)的數值與函數運算式FMP (z)的數值的比較結果:When n=0~63 and corresponds to the phase region Ph5 (the phase region to which the prototype digital cosine wave belongs), the symmetry cos θ=sin(π/2-θ) using the trigonometric function (where π/2 corresponds to the reference angle data IndexN) The value n=64, θ corresponds to the value of the reference angle data IndexN n=0~63), and the comparison between the value of the following prototype digital cosine wave function F CT (n) and the value of the function expression F MP (z) can be obtained. result:

FCT (0)=FMP (64)、FCT (1)=FMP (63)、FCT (2)=FMP (62)、FCT (3)=FMP (61)、…、FCT (60)=FMP (4)、FCT (61)=FMP (3)、FCT (62)=FMP (2)、FCT (63)=FMP (1)。F CT (0)=F MP (64), F CT (1)=F MP (63), F CT (2)=F MP (62), F CT (3)=F MP (61),... F CT (60) = F MP (4), F CT (61) = F MP (3), F CT (62) = F MP (2), F CT (63) = F MP (1).

也就是說若要利用函數運算式FMP (z)的數值來求得位於相區Ph5的原型數位餘弦波函數式FCT (n)的數值時,相區角度資料PhaseZ的數值z等同於64減去基準角度資料IndexN之數值n,即z=64-n,且FCT (n)=FMP (z)。表4E為整理當基準角度資料IndexN之數值n對應相區Ph5時,n與z的挪移關係表。That is to say, if the value of the function number F MP (z) is used to obtain the value of the prototype digital cosine wave function F CT (n) located in the phase region Ph5, the value z of the phase angle data PhaseZ is equivalent to 64. Subtract the value n of the reference angle data IndexN, ie z=64-n, and F CT (n)=F MP (z). Table 4E is a table for shifting the relationship between n and z when the value n of the reference angle data IndexN corresponds to the phase region Ph5.

當n=64~127且對應相區Ph6(即原型數位餘弦波所屬之相區)時,利用三角函數的對稱性cosθ=-sin(θ-π/2)(其中π/2對應於基準角度資料IndexN之數值n=64,θ對應基準角度資料IndexN之數值n=64~127),可得到以下原型數位餘弦波函數式FCT (n)的數值與函數運算式FMP (z)的數值的比較結果:When n=64~127 and corresponding to the phase region Ph6 (ie, the phase region to which the prototype digital cosine wave belongs), the symmetry cos θ=-sin(θ-π/2) of the trigonometric function is used (where π/2 corresponds to the reference angle) The value of the index IndexN is n=64, and θ corresponds to the value of the reference angle data IndexN (n=64~127), and the value of the following prototype digital cosine wave function F CT (n) and the value of the function expression F MP (z) can be obtained. Comparison results:

FCT (64)=-FMP (0)、FCT (65)=-FMP (1)、FCT (66)=-FMP (2)、FCT (67)=-FMP (3)、…、FCT (124)=-FMP (60)、FCT (125)=-FMP (61)、FCT (126)=-FMP (62)、FCT (127)=-FMP (63)。F CT (64)=-F MP (0), F CT (65)=-F MP (1), F CT (66)=-F MP (2), F CT (67)=-F MP (3 ),..., F CT (124)=-F MP (60), F CT (125)=-F MP (61), F CT (126)=-F MP (62), F CT (127)=- F MP (63).

也就是說若要利用函數運算式FMP (z)的數值來求得位於相區Ph6的原型數位餘弦波函數式FCT (n)的數值時,相區角度資料PhaseZ的數值z等同於基準角度資料IndexN之數值n減去64,即z=n-64,且FCT (n)=-FMP (z)。表4F為整理當基準角度資料IndexN之數值n對應相區Ph6時,n與z的挪移關係表。That is to say, if the value of the function number F MP (z) is used to obtain the value of the prototype digital cosine wave function F CT (n) located in the phase region Ph6, the value z of the phase angle data PhaseZ is equivalent to the reference. The value n of the angle data IndexN is subtracted by 64, i.e., z = n - 64, and F CT (n) = -F MP (z). Table 4F is a table for shifting the relationship between n and z when the value n of the reference angle data IndexN corresponds to the phase region Ph6.

當n=128~191且對應於相區Ph7(即原型數位餘弦波所屬之相區)時,利用三角函數的對稱性cosθ=-sin(3π/2-θ)(其中3π/2對應於基準角度資料IndexN之數值n=192,θ對應基準角度資料IndexN之數值n=128~191),可得到以下原型數位餘弦波函數式FCT (n)的數值與函數運算式FMP (Z)的數值的比較結果:When n=128~191 and corresponds to the phase region Ph7 (ie, the phase region to which the prototype digital cosine wave belongs), the symmetry cos θ=-sin(3π/2-θ) using the trigonometric function (where 3π/2 corresponds to the reference) The value of the angle data IndexN is n=192, θ corresponds to the value of the reference angle data IndexN n=128~191), and the value of the following prototype digital cosine wave function F CT (n) and the function expression F MP (Z) can be obtained. Comparison of values:

FCT (128)=-FMP (64)、FCT (129)=-FMP (63)、FCT (130)=-FMP (62)、FCT (131)=-FMP (61)、…、FCT (188)=-FMP (4)、FCT (189)=-FMP (3)、FCT (190)=-FMP (2)、FCT (191)=-FMP (1)。F CT (128)=-F MP (64), F CT (129)=-F MP (63), F CT (130)=-F MP (62), F CT (131)=-F MP (61 ),..., F CT (188)=-F MP (4), F CT (189)=-F MP (3), F CT (190)=-F MP (2), F CT (191)=- F MP (1).

也就是說若要利用函數運算式FMP (z)的數值來求得位於相區Ph7的原型數位餘弦波函數式FCT (n)的數值時,相區角度資料PhaseZ的數值z等同於192減去基準角度資料IndexN之數值n,即z=192-n,且FCT (n)=-FMP (z)。表4G為整理當基準角度資料IndexN之數值n對應相區Ph7時,n與z的挪移關係表。That is to say, if the value of the function number F MP (z) is used to obtain the value of the prototype digital cosine wave function F CT (n) located in the phase region Ph7, the value z of the phase angle data PhaseZ is equivalent to 192. Subtract the value n of the reference angle data IndexN, ie z=192-n, and F CT (n)=-F MP (z). Table 4G is a table for shifting the relationship between n and z when the value n of the reference angle data IndexN corresponds to the phase region Ph7.

表4GTable 4G

當n=192~256且對應於相區Ph8(即原型數位餘弦波所屬之相區)時,利用三角函數的對稱性cosθ=sin(θ-3π/2)(其中3π/2對應於基準角度資料IndexN之數值n=192,θ對應基準角度資料之數值n=192~256),可得到以下原型數位餘弦波函數式FCT (n)的數值與函數運算式FMP (z)的數值的比較結果:When n=192~256 and corresponds to the phase region Ph8 (ie, the phase region to which the prototype digital cosine wave belongs), the symmetry cos θ=sin(θ-3π/2) using the trigonometric function (where 3π/2 corresponds to the reference angle) The value of the index IndexN is n=192, and θ corresponds to the value of the reference angle data n=192~256), and the value of the following prototype digital cosine wave function F CT (n) and the value of the function expression F MP (z) can be obtained. Comparing results:

FCT (192)=FMP (0)、FCT (193)=FMP (1)、FCT (194)=FMP (2)、FCT (195)=FMP (3)、…、FCT (252)=FMP (60)、FCT (253)=FMP (61)、FCT (254)=FMP (62)、FCT (255)=FMP (63)。F CT (192)=F MP (0), F CT (193)=F MP (1), F CT (194)=F MP (2), F CT (195)=F MP (3),... F CT (252) = F MP (60), F CT (253) = F MP (61), F CT (254) = F MP (62), F CT (255) = F MP (63).

也就是說若要利用函數運算式FMP (z)的數值來求得位於相區Ph8的原型數位餘弦波函數式FCT (n)的數值時,相區角度資料PhaseZ的數值z等同於基準角度資料IndexN之數值n減去192,即z=n-192,且FCT (n)=FMP (z)。表4H為整理當基準角度資料IndexN之數值n對應相區Ph8時,n與z的挪移關係表。That is to say, if the value of the function number F MP (z) is used to obtain the value of the prototype digital cosine wave function F CT (n) located in the phase region Ph8, the value z of the phase angle data PhaseZ is equivalent to the reference. The value n of the angle data IndexN is subtracted by 192, i.e., z = n - 192, and F CT (n) = F MP (z). Table 4H is a table for shifting the relationship between n and z when the value n of the reference angle data IndexN corresponds to the phase region Ph8.

综上所述,便可將各相區Ph1~Ph4之原型數位正弦波函數式FST (n)的數值及各相區Ph5~Ph8之原型數位餘弦波函數式FCT (n)的數值以函數運算式FMP (z)的數值來求得。其中,對應各相區的基準角度資料IndexN之數值n與相區角度資料PhaseZ的數值z的8個挪移關係式整理如表4I所示:In summary, the value of the prototype digital sine wave function F ST (n) of each phase region Ph1~Ph4 and the value of the prototype digital cosine wave function F CT (n) of each phase region Ph5~Ph8 can be The value of the function expression F MP (z) is obtained. Among them, the eight shifting relations of the value n of the reference angle data IndexN corresponding to each phase region and the value z of the phase angle data PhaseZ are as shown in Table 4I:

此外,表4J為位在相區Ph2~Ph4之原型數位正弦波函數式FST (n)與函數運算式FMP (Z)之關係比較表,表4K為位在相區Ph5~Ph8之原型數位餘弦波函數式FCT (n)與函數運算式FMP (Z)之關係比較表:In addition, Table 4J is a comparison table between the prototype digital sine wave function F ST (n) and the function expression F MP (Z) in the phase region Ph2~Ph4, and Table 4K is the prototype in the phase region Ph5~Ph8. Comparison of the relationship between the digital cosine wave function F CT (n) and the function expression F MP (Z):

表4JTable 4J

請參照表4J,如表4J所示,FST (96)=FMP (32)、FST (160)=-FMP (32)、FST (224)=-FMP (32)。故再次說明只要得知函數運算式FMP (Z)在z=32時的數值,便可得到原型數位正弦波函數式FST (n)在n=96、160及224時的數值。Referring to Table 4J, as shown in Table 4J, F ST (96) = F MP (32), F ST (160) = -F MP (32), F ST (224) = -F MP (32). Therefore, once again, as long as the value of the function expression F MP (Z) at z=32 is known, the value of the prototype digital sine wave function F ST (n) at n=96, 160, and 224 can be obtained.

接著,請參照表4K:Next, please refer to Table 4K:

如表4K所示,FCT (32)=FMP (32)、FCT (96)=-FMP (32)、FCT (160)=-FMP (32)、FST (224)=FMP (32)。同理,藉由表2表2J亦再次說明只要得知函數運算式FMP (Z)在Z=32時的數值,便可得到原型數位餘弦波函數式FCT (n)在n=32、96、160及224時的數值。As shown in Table 4K, F CT (32) = F MP (32), F CT (96) = -F MP (32), F CT (160) = -F MP (32), F ST (224) = F MP (32). Similarly, Table 2J of Table 2 again shows that as long as the value of the function expression F MP (Z) at Z=32 is known, the prototype digital cosine wave function F CT (n) can be obtained at n=32. Values at 96, 160 and 224 hours.

請繼續參照圖3,因此,當相區轉換單元130接收到相區鑑別信號Ph_discri後,只要依據相區鑑別信號Ph_discri選擇8個挪移關係式之其一,便可對基準角度資料IndexN進行挪移之動作,以產生相區角度資料PhaseZ。舉例來說,當基準角度資料IndexN=01000001、相區鑑別信號Ph_discri=00000010時,代表基準角度資料IndexN對應相區Ph2,此時相區轉換單元130會使用挪移關係式中的z=128-n對基準角度資料IndexN作計算,以得到相區角度資料PhaseZ。Please continue to refer to FIG. 3. Therefore, after the phase region converting unit 130 receives the phase region discriminating signal Ph_discri, the reference angle data IndexN can be moved by selecting one of the eight shifting relations according to the phase region discriminating signal Ph_discri. Action to generate PhaseZ angle data PhaseZ. For example, when the reference angle data IndexN=01000001 and the phase region discrimination signal Ph_discri=00000010, the reference angle data IndexN corresponds to the phase region Ph2, and the phase region conversion unit 130 uses the z=128-n in the shift relationship. The reference angle data IndexN is calculated to obtain the phase angle data PhaseZ.

其中,計算方式是按照二進位的計算系統,也就是-n可表示為not(IndexN)+0000001。舉例來說,當n=64,則-64可表示為not(01000000)+00000001=10111111+00000001=11000000;當n=128,則-128可表示為not(10000000)+00000001=01111111+00000001=10000000;當n=192,則-192可表示為not(11000000)+00000001=00111111+00000001=01000000。如此,便可將8個挪移關係式以二進位的方式來實現,其整理如表5所示:Among them, the calculation method is a binary calculation system, that is, -n can be expressed as not(IndexN)+0000001. For example, when n=64, -64 can be expressed as not(01000000)+00000001=10111111+00000001=11000000; when n=128, -128 can be expressed as not(10000000)+00000001=01111111+00000001=10000000; when n=192 , then -192 can be expressed as not (11000000) + 00000001 = 00111111 + 00000001 = 01000000. In this way, the eight shifting relationships can be implemented in a binary manner, as shown in Table 5:

接下來的動作就是藉由相區角度資料PhaseZ之數值z求得函數運算式FMP (z)的數值。其中,本實施例之函數值計算單元140便是用以執行這項功能。函數值計算單元140將提供用以合成位在第1個相區內之原型數位波的多個函數運算式FMP (z),並將相區角度資料PhaseZ帶入至這些函數運算式FMP (z)之其一,以計算出相區角度資料PhaseZ所對應的相位函數值Mag_PhZ。The next action is to find the value of the function expression F MP (z) by the value z of the phase angle data PhaseZ. The function value calculation unit 140 of this embodiment is used to perform this function. The function value calculation unit 140 will provide a plurality of function expressions F MP (z) for synthesizing the prototype digit waves in the first phase region, and bring the phase angle data PhaseZ to these function expressions F MP One of (z) to calculate the phase function value Mag_PhZ corresponding to the phase angle data PhaseZ.

表6A~6J為相區角度資料PhaseZ之數值z與函數運算式FMP (z)的數值整理表。其中,FMP (z)=Int(128*sin(2zπ/256))=Int(128*sin(X))=Int(Y),z=0~64。Tables 6A to 6J are numerical table of the value z of the phase angle data PhaseZ and the function expression F MP (z). Where F MP (z)=Int(128*sin(2zπ/256))=Int(128*sin(X))=Int(Y), z=0~64.

請參照表6A,如表6A所示,當相區角度資料PhaseZ之數值z=0~3時,可以由表6A中的z與Int(Y)的關係歸納函數運算式FMP (z)=2*z+z,其中z=0~3。Please refer to Table 6A. As shown in Table 6A, when the value of the phase angle data PhaseZ is z=0~3, the relationship between z and Int(Y) in Table 6A can be summarized. The function expression F MP (z)= 2*z+z, where z=0~3.

請參照表6B,如表6B所示,當相區角度資料PhaseZ之數值z=4~19時,可以由表6B中的z與Int(Y)的關係歸納出的函數運算式FMP (z)=(2*z+1)+z,其中z=4~19。Please refer to Table 6B. As shown in Table 6B, when the value of the phase angle data PhaseZ is z=4~19, the function expression F MP (z) which can be summarized by the relationship between z and Int(Y) in Table 6B. ) = (2 * z + 1) + z, where z = 4 ~ 19.

請參照表6C,如表6C所示,當相區角度資料PhaseZ之數值z=20~23時,可以由表6C中的z與Int(Y)的關係歸納出函數運算式FMP (z)=2*z+z,其中z=20~23。Please refer to Table 6C. As shown in Table 6C, when the value of the phase angle data PhaseZ is z=20~23, the function expression F MP (z) can be summarized from the relationship between z and Int(Y) in Table 6C. =2*z+z, where z=20~23.

請參照表6D,如表6D所示,當相區角度資料PhaseZ之數值z=24~27時,可以由表6D中的z與Int(Y)歸納出函數運算式FMP (z)=2*z+24,其中z=24~27。Please refer to Table 6D. As shown in Table 6D, when the value of the phase angle data PhaseZ is z=24~27, the function expression F MP (z)=2 can be summarized from z and Int(Y) in Table 6D. *z+24, where z=24~27.

請參照表6E,如表6E所示,當相區角度資料PhaseZ之數值z=28~31時,可以由表6E中的z與Int(Y)歸納出函數運算式FMP (z)=2*z+26,其中z=28~31。Refer to Table 6E, as shown in Table 6E, when the value of the phase angle data PhaseZ zone of z = 28 ~ 31, the function can be summarized as calculation formula F MP (z) = 2 z in Table 6E and Int (Y) *z+26, where z=28~31.

請參照表6F,如表6F所示,當相區角度資料PhaseZ之數值z=32~39時,可以由表6F中的z與Int(Y)歸納出歸納出函數運算式FMP (z)=2*z+27,其中z=32~39。Please refer to Table 6F. As shown in Table 6F, when the value of the phase angle data PhaseZ is z=32~39, the function expression F MP (z) can be summarized by z and Int(Y) in Table 6F. =2*z+27, where z=32~39.

請參照表6G,如表6G所示,當相區角度資料PhaseZ之數值z=40~43時,可以由表6G中的z與Int(Y)歸納出函數運算式FMP (z)=2*z+26,其中z=40~43。Please refer to Table 6G. As shown in Table 6G, when the value of the phase angle data PhaseZ is z=40~43, the function expression F MP (z)=2 can be summarized from z and Int(Y) in Table 6G. *z+26, where z=40~43.

請參照表6H,如表6H所示,當相區角度資料PhaseZ之數值z=44~55時,可由表6H中的z與Int(Y)歸納出函數運算式FMP (z)=z+70,其中z=44~55。Please refer to Table 6H. As shown in Table 6H, when the value of the phase angle data PhaseZ is z=44~55, the function expression F MP (z)=z+ can be summarized by z and Int(Y) in Table 6H. 70, where z=44~55.

請參照表6I,如表6I所示,當相區角度資料Phasez之數值z=56~59,可由表6H中的z與Int(Y)歸納出函數運算式FMP (z)=126,而當相區角度資料PhaseZ之數值z=60~64時,可歸納出函數運算式FMP (z)=127。Please refer to Table 6I. As shown in Table 6I, when the value of the phase angle data Phasez is z=56~59, the function expression F MP (z)=126 can be summarized by z and Int(Y) in Table 6H. When the value of the phase angle data PhaseZ is z=60~64, the function expression F MP (z)=127 can be summarized.

综上所述,相區角度資料PhaseZ之數值z與函數運算式FMP (z)的關係可整理如表6J所示:In summary, the relationship between the value z of the phase angle data PhaseZ and the function expression F MP (z) can be summarized as shown in Table 6J:

圖5為圖3之函數值運算單元140的內部電路方塊圖。如圖5所示,函數值運算單元140包括一運算控制單元142、一第一數值調整單元144a、一第二數值調整單元144b、一第三數值調整單元144c、一第一多工單元146a、一第二多工單元146b及一加法單元148。FIG. 5 is an internal circuit block diagram of the function value operation unit 140 of FIG. As shown in FIG. 5, the function value operation unit 140 includes an operation control unit 142, a first value adjustment unit 144a, a second value adjustment unit 144b, a third value adjustment unit 144c, a first multiplex unit 146a, A second multiplexing unit 146b and an adding unit 148.

運算控制單元142參照函數運算式FMP (z)對相區角度資料PhaseZ的第3~7位元(b[2]~b[6])進行編碼,以產生對應的運算控制信號Angle_discri(n),其中,n = 1~17,且在此定義將信號Ph62Z定義為由PhaseZ的第3~7位元所組成的信號。運算控制信號Angle_discri(n)用以控制多條函數運算式FMP (Z),其整理如表6K。The arithmetic control unit 142 encodes the third to seventh bits (b[2] to b[6]) of the phase angle data PhaseZ with reference to the function expression F MP (z) to generate a corresponding arithmetic control signal Angle_discri(n). ), where n = 1~17, and here the definition of the signal Ph62Z is defined as the signal consisting of the 3rd to 7th bits of PhaseZ. The operation control signal Angle_discri(n) is used to control a plurality of function expressions F MP (Z), which are organized as shown in Table 6K.

如表6K所示,當相區角度資料PhaseZ=00000011時,其第3位元到第7位元=00000,故對應產生運算控制信號Angle_discri(1),且函數運算式FMP (Z)=2z+z將被選取。值得注意的是,此時相區角度資料PhaseZ之數值z=3,其屬於函數運算式FMP (z)=2z+z中相區角度資料PhaseZ之數值z的範圍。當相區角度資料PhaseZ=00000100時,其第3位元到第7位元=00001,故對應產生運算控制信號Angle_discri(2),且函數運算式FMP (z)=(2z+1)+z將被選取。值得注意的是,此時相區角度資料PhaseZ之數值z=4,其屬於函數運算式FMP (z)=(2z+1)+z中相區角度資料PhaseZ之數值z的範圍。因此,藉由相區角度資料PhaseZ中的第3位元到第7位元便足以確定相區角度資料PhaseZ所對應的函數運算式FMP (z)。As shown in Table 6K, when the phase angle data PhaseZ=00000011, its third bit to the seventh bit = 00000, so the operation control signal Angle_discri(1) is generated correspondingly, and the function expression F MP (Z)= 2z+z will be selected. It is worth noting that the value of the phase angle data PhaseZ at this time is z=3, which belongs to the range of the value z of the phase angle data PhaseZ in the function expression F MP (z)=2z+z. When the phase angle data PhaseZ=00000100, its third bit to the seventh bit=00001, the corresponding operation control signal Angle_discri(2) is generated, and the function expression F MP (z)=(2z+1)+ z will be selected. It is worth noting that the value of phase phase angle data PhaseZ is z=4, which belongs to the range of the value z of the phase angle data PhaseZ in the function expression F MP (z)=(2z+1)+z. Therefore, it is sufficient to determine the function expression F MP (z) corresponding to the phase angle data PhaseZ by the third bit to the seventh bit in the phase angle data PhaseZ.

請繼續參照圖5,第一數值調整單元144a用以倍增相區角度資料PhaseZ之數值z,以產生第一調整資料{2Z}。具體的作法是將相區角度資料PhaseZ向左位移1位元。此外,第二數值調整單元144b用以倍增相區角度資料PhaseZ之數值Z並加1,以產生一第二調整資料{2Z+1}。具體的做法將相區角度資料PhaseZ向左位移1位元並加上00000001。第三數值調整單元144c接收相區角度資料PhaseZ,並據以輸出作為第三調整資料{Z}。Referring to FIG. 5, the first value adjusting unit 144a is configured to multiply the value z of the phase angle data PhaseZ to generate the first adjustment data {2Z}. The specific method is to shift the phase angle data PhaseZ to the left by 1 bit. In addition, the second value adjusting unit 144b is configured to multiply the value Z of the phase angle data PhaseZ and add 1 to generate a second adjustment data {2Z+1}. The specific method is to shift the phase angle data PhaseZ to the left by 1 bit and add 00000001. The third value adjustment unit 144c receives the phase angle data PhaseZ and outputs it as the third adjustment data {Z}.

請繼續參照圖5,第一多工單元146a依據運算控制信號Angle_discri(n)從第一調整資料{2Z}、第二調整資料{2Z+1}、第一常數資料N70以及一第二常數資料N100中選擇其一,以產生第一函數調整資料。其中,第一常數資料N70的數值為70,第二常數資料N100的數值為100。此外,第二多工單元146b依據運算控制信號Angle_discri(n)自第三調整資料{Z}、第三常數資料N24、第四常數資料N26以及第五常數資料N27中選擇其一,以產生第二函數調整資料。其中,第三常數資料N24之數值為24、第四常數資料N26之數值為26,而第五常數資料N27之數值為27。加法單元148用以對第一函數調整資料與第二函數調整資料進行加法運算,以產生相位函數值Mag_PhZ。Referring to FIG. 5, the first multiplex unit 146a selects the first adjustment data {2Z}, the second adjustment data {2Z+1}, the first constant data N70, and a second constant data according to the operation control signal Angle_discri(n). Select one of the N100 to generate the first function adjustment data. The value of the first constant data N70 is 70, and the value of the second constant data N100 is 100. In addition, the second multiplex unit 146b selects one of the third adjustment data {Z}, the third constant data N24, the fourth constant data N26, and the fifth constant data N27 according to the operation control signal Angle_discri(n) to generate the first Two function adjustment data. The value of the third constant data N24 is 24, the value of the fourth constant data N26 is 26, and the value of the fifth constant data N27 is 27. The adding unit 148 is configured to add the first function adjustment data and the second function adjustment data to generate the phase function value Mag_PhZ.

表6L為運算控制信號Angle_discri(n)與第一函數調整數值及第二函數調整數值的對照表。Table 6L is a comparison table of the operation control signal Angle_discri(n) and the first function adjustment value and the second function adjustment value.

請對照圖5並參照表6L,整體而言,當運算控制單元142接收到相區角度資料PhaseZ時,其會根據相區角度資料PhaseZ之第3~7位元進行編碼,以產生對應的運算控制信號Angle_discri(n)。在此,運算控制信號Angle_discri(n)會被輸出至第一多工單元146a及第二多工單元146b。同時,第一數值調整單元144a、第二數值調整單元144b及第三數值調整單元144c也會對相區角度資料PhaseZ進行不同的運算,以分別產生第一調整資料{2Z}、第二調整資料{2Z+1}、以及第三調整資料{Z}。Referring to FIG. 5 and referring to Table 6L, when the operation control unit 142 receives the phase angle data PhaseZ, it will encode according to the third to seventh bits of the phase angle data PhaseZ to generate a corresponding operation. Control signal Angle_discri(n). Here, the arithmetic control signal Angle_discri(n) is output to the first multiplex unit 146a and the second multiplex unit 146b. At the same time, the first value adjustment unit 144a, the second value adjustment unit 144b, and the third value adjustment unit 144c also perform different operations on the phase angle data PhaseZ to generate the first adjustment data {2Z} and the second adjustment data, respectively. {2Z+1}, and the third adjustment data {Z}.

其中,第一調整資料{2Z}與第二調整資料{2Z+1}會輸出至第一多工單元146a。此外,第一多工單元146a更接收第一常數資料N70與第二常數資料N100。接著,第一多工單元146a會依據運算控制信號Angle_discri(n),選擇上述其中之一的輸入資料來以作為第一函數調整資料。同樣地,第二多工單元146b也是如此,其接收第三調整資料{Z}、第三常數資料N24、第四常數資料N26及第五常數資料N27,並依據運算控制信號Angle_discri(n),選擇上述其中之一以作為第二函數調整資料。最後,加法單元148會將所接收到的第一函數調整資料與第二函數調整資料進行加法運算。至此,便完成了相位函數值Mag_PhZ的運算。The first adjustment data {2Z} and the second adjustment data {2Z+1} are output to the first multiplex unit 146a. In addition, the first multiplex unit 146a further receives the first constant data N70 and the second constant data N100. Next, the first multiplex unit 146a selects the input data of one of the above according to the operation control signal Angle_discri(n) to adjust the data as the first function. Similarly, the second multiplex unit 146b also receives the third adjustment data {Z}, the third constant data N24, the fourth constant data N26, and the fifth constant data N27, and according to the operation control signal Angle_discri(n), Select one of the above to adjust the data as a second function. Finally, the adding unit 148 adds the received first function adjustment data and the second function adjustment data. At this point, the operation of the phase function value Mag_PhZ is completed.

舉例來說,當相區角度資料PhaseZ=00010100時(即z=20),運算控制單元142會產生運算控制信號Angle_discri(1),並輸出至第一多工單元146a及第二多工單元146b。接著,第一多工單元146a會選擇由第一數值調整單元144a所產生的第一調整資料{2Z}作為第一函數調整資料,其中,第二調整資料之數值為2z=2*20=40。而第二多工單元146b會選擇由第三調整數值單元146c所產生的第三調整資料{Z}作為第二函數調整資料,其中,第三調整資料之數值為z=20。最後,加法單元148會將第一函數調整資料與第二函數調整資料相加,以產生相位函數值Mag_PhZ,其中相位函數值=(2z)+z=40+20=60。For example, when the phase angle data PhaseZ=00010100 (ie, z=20), the operation control unit 142 generates an operation control signal Angle_discri(1) and outputs it to the first multiplex unit 146a and the second multiplex unit 146b. . Next, the first multiplex unit 146a selects the first adjustment data {2Z} generated by the first value adjustment unit 144a as the first function adjustment data, wherein the value of the second adjustment data is 2z=2*20=40 . The second multiplex unit 146b selects the third adjustment data {Z} generated by the third adjustment value unit 146c as the second function adjustment data, wherein the value of the third adjustment data is z=20. Finally, the adding unit 148 adds the first function adjustment data and the second function adjustment data to generate a phase function value Mag_PhZ, where the phase function value = (2z) + z = 40 + 20 = 60.

請繼續參照圖3,如圖3所示,極性轉換單元150依據相區鑑別信號xPh_discri(n),而決定輸出相位函數值Mag_PhZ的相反數或是直接輸出相位函數值Mag-PhZ,以作為一波形輸出值Mag_SC。極性轉換單元150更利用波形輸出值Mag_SC產生頻率為原型數位波之1/(2^P)倍或是2^P倍的一週期性數位波。在本實施例中,極性轉換的方法是採用採用2的補數加1的方法。其說明如下所述:假設一個八位元的常數A=01101100,則其負數B=not A+1。因A=01101100,所以not A=10010011,故其負數B=not A+1=10010011+00000001=10010100。當A=01101100,B=10010100時,則A+B=01101100+10010100=00000000,故稱A和B互為相反數,亦即B為A的負數。Referring to FIG. 3, as shown in FIG. 3, the polarity switching unit 150 determines the opposite of the output phase function value Mag_PhZ or directly outputs the phase function value Mag-PhZ according to the phase region discrimination signal xPh_discri(n). Waveform output value Mag_SC. The polarity conversion unit 150 further generates a periodic digital wave whose frequency is 1/(2^P) times or 2^P times the prototype digital wave by using the waveform output value Mag_SC. In the present embodiment, the method of polarity switching employs a method of adding 2 to the complement. The description is as follows: Assuming an octet constant A = 01101100, its negative number B = not A + 1. Since A=01101100, not A=10010011, so its negative number B=not A+1=10010011+00000001=10010100. When A=01101100 and B=10010100, then A+B=01101100+10010100=00000000, so A and B are said to be opposite to each other, that is, B is a negative number of A.

表6M為極性轉換單元150之輸入輸出信號與特徵描述的對照表。Table 6M is a comparison table of input and output signals and characterization of the polarity conversion unit 150.

如表6M所示,當相區鑑別信號Ph_discri=00000001時,表示相區角度資料PhaseZ在相區Ph1,也就是在數位正弦波函數式FST (n)的0~90度的區域,且此時所對應的數位角度輸入值n=0~63。由於在此範圍內的數位正弦波函數式FST (n)的數值均為正值,故極性轉換單元150會直接將相位函數值Mag_PhZ輸出以作為波形輸出值Mag_SC。As shown in Table 6M, when the phase region discrimination signal Ph_discri=00000001, it indicates that the phase angle data PhaseZ is in the phase region Ph1, that is, in the region of 0 to 90 degrees of the digital sine wave function F ST (n), and this The corresponding digital angle input value is n=0~63. Since the values of the digital sine wave function F ST (n) in this range are all positive values, the polarity conversion unit 150 directly outputs the phase function value Mag_PhZ as the waveform output value Mag_SC.

當相區鑑別信號Ph_discri=00000010時,表示相區角度資料PhaseZ在相區Ph2,也就是在數位正弦波函數式FST (n)的90~180度的區域,且此時所對應的數位角度輸入值n=64~127。由於在此範圍內的數位正弦波函數式FST (n)的數值均為正值,故極性轉換單元150會直接將相位函數值Mag_PhZ輸出以作為波形輸出值Mag_SC。When the phase region discrimination signal Ph_discri=00000010, it indicates that the phase angle data PhaseZ is in the phase region Ph2, that is, in the region of 90 to 180 degrees of the digital sine wave function F ST (n), and the corresponding digital angle at this time Enter the value n=64~127. Since the values of the digital sine wave function F ST (n) in this range are all positive values, the polarity conversion unit 150 directly outputs the phase function value Mag_PhZ as the waveform output value Mag_SC.

當相區鑑別信號Ph_discri=00000100時,表示相區角度資料PhaseZ在相區Ph3,也就是在數位正弦波函數式FST (n)的90~180度的區域,且此時所對應的數位角度輸入值n=128~191。由於在此範圍內的數位正弦波函數式FST (n)的數值均為負值,且其和函數運算式FMP (z)的數值互為相反數,故需要進行相反數轉換運算。因此極性轉換單元150會將相位函數值Mag_PhZ取2的補數加1後以產生波形輸出值Mag_SC。When the phase region discrimination signal Ph_discri=00000100, it indicates that the phase angle data PhaseZ is in the phase region Ph3, that is, in the region of 90 to 180 degrees of the digital sine wave function F ST (n), and the corresponding digital angle at this time Enter the value n=128~191. Since the values of the digital sine wave function F ST (n) in this range are all negative values, and the values of the function expression F MP (z) are opposite to each other, an inverse conversion operation is required. Therefore, the polarity conversion unit 150 adds 1 to the complement of the phase function value Mag_PhZ to generate the waveform output value Mag_SC.

當相區鑑別信號Ph_discri=00001000時,表示相區角度資料PhaseZ在相區Ph4,也就是在數位正弦波函數式FST (n)的180~270度的區域,且此時所對應的數位角度輸入值n=192~255。由於在此範圍內的數位正弦波函數式FST (n)的數值均為負值,且其和函數運算式FMP (z)的數值互為相反數,故需要進行相反數轉換運算。因此極性轉換單元150會將相位函數值Mag_PhZ取2的補數加1後以產生波形輸出值Mag_SC。When the phase region discrimination signal Ph_discri=00001000, it indicates that the phase angle data PhaseZ is in the phase region Ph4, that is, in the region of 180 to 270 degrees of the digital sine wave function F ST (n), and the corresponding digital angle at this time Enter the value n=192~255. Since the values of the digital sine wave function F ST (n) in this range are all negative values, and the values of the function expression F MP (z) are opposite to each other, an inverse conversion operation is required. Therefore, the polarity conversion unit 150 adds 1 to the complement of the phase function value Mag_PhZ to generate the waveform output value Mag_SC.

當相區鑑別信號Ph_discri=00010000時,表示相區角度資料PhaseZ在相區Ph5,也就是在數位餘弦波函數式FCT (n)的0~90度的區域,且此時所對應的數位角度輸入值n=0~63。由於在此範圍內的數位餘弦波函數式FCT (n)的數值均為正值,故極性轉換單元150會直接將相位函數值Mag_PhZ輸出以作為波形輸出值Mag_SC。When the phase region discrimination signal Ph_discri=00010000, it indicates that the phase angle data PhaseZ is in the phase region Ph5, that is, in the region of 0 to 90 degrees of the digital cosine wave function F CT (n), and the corresponding digital angle at this time Enter the value n=0~63. Since the values of the digital cosine wave function F CT (n) in this range are all positive values, the polarity converting unit 150 directly outputs the phase function value Mag_PhZ as the waveform output value Mag_SC.

當相區鑑別信號Ph_discri=00100000時,表示相區角度資料PhaseZ在相區Ph6,也就是在數位餘弦波函數式FCT (n)的90~180度的區域,且此時所對應的數位角度輸入值n=64~127。由於在此範圍內的數位餘弦波函數式FCT (n)的數值均為負值,其和函數運算式FMP (Z)的數值互為相反數,故需要進行相反數轉換運算。因此極性轉換單元150會將相位函數值Mag_PhZ取2的補數加1後以產生波形輸出值Mag_SC。When the phase region discrimination signal Ph_discri=00100000, it indicates that the phase angle data PhaseZ is in the phase region Ph6, that is, in the region of 90 to 180 degrees of the digital cosine wave function F CT (n), and the corresponding digital angle at this time Enter the value n=64~127. Since the values of the digital cosine wave function F CT (n) in this range are all negative values, and the values of the function expression F MP (Z) are opposite to each other, an inverse conversion operation is required. Therefore, the polarity conversion unit 150 adds 1 to the complement of the phase function value Mag_PhZ to generate the waveform output value Mag_SC.

當相區鑑別信號Ph_discri=01000000時,表示相區角度資料PhaseZ在相區Ph7,也就是在數位餘弦波函數式FCT (n)的180~270度的區域,且此時所對應的數位角度輸入值n=128~191。由於在此範圍內的數位餘弦波函數式FCT (n)的數值均為負值,其和函數運算式FMP (z)的數值互為相反數,故需要進行相反數轉換運算。因此極性轉換單元150會將相位函數值Mag_PhZ取2的補數加1後以產生波形輸出值Mag_SC。When the phase region discrimination signal Ph_discri=01000000, it indicates that the phase angle data PhaseZ is in the phase region Ph7, that is, in the region of 180 to 270 degrees of the digital cosine wave function F CT (n), and the corresponding digital angle at this time Enter the value n=128~191. Since the values of the digital cosine wave function F CT (n) in this range are all negative values, and the values of the function expression F MP (z) are opposite to each other, an inverse conversion operation is required. Therefore, the polarity conversion unit 150 adds 1 to the complement of the phase function value Mag_PhZ to generate the waveform output value Mag_SC.

當相區鑑別信號Ph_discri=10000000時,表示相區角度資料PhaseZ在相區Ph8,也就是在數位餘弦波函數式FCT (n)的270~360度的區域,且此時所對應的數位角度輸入值n=191~255。由於在此範圍內的數位餘弦波函數式FCT (n)的數值均為正值,故極性轉換單元150會直接將相位函數值Mag_PhZ輸出以作為波形輸出值Mag_SC。When the phase region discrimination signal Ph_discri=10000000, it indicates that the phase angle data PhaseZ is in the phase region Ph8, that is, in the region of 270 to 360 degrees of the digital cosine wave function F CT (n), and the corresponding digital angle at this time Enter the value n=191~255. Since the values of the digital cosine wave function F CT (n) in this range are all positive values, the polarity converting unit 150 directly outputs the phase function value Mag_PhZ as the waveform output value Mag_SC.

综上所述,數位波形產生器100可利用這些波形輸出值Mag_SC來產生頻率為原型數位波之1/(2^P)倍或2^P倍的週期性數位波。In summary, the digital waveform generator 100 can use these waveform output values Mag_SC to generate periodic digital waves having a frequency of 1/(2^P) times or 2^P times the prototype digital wave.

圖6為本實施例之數位波形產生器之週邊電路方塊圖。如圖6所示,波形產生器100更包括一資料輸入單元160、一連續角度產生單元170及一資料選擇單元180。FIG. 6 is a block diagram of a peripheral circuit of the digital waveform generator of the embodiment. As shown in FIG. 6, the waveform generator 100 further includes a data input unit 160, a continuous angle generating unit 170, and a data selecting unit 180.

資料輸入單元160對8位元的輸入位址ADDRin進行解碼,以依據解碼後的輸入位址ADDRin將8位元的數位資料DATAin視為單一角度資料xDatain或是8位元的運作指令Command。詳言之,當重置信號Reset為邏輯高準位時,則用以傳送單一角度資料xDatain及運作指令Command等的輸出埠將被重置為零。The data input unit 160 decodes the 8-bit input address ADDRin to treat the 8-bit digital data DATAin as a single-angle data xDatain or an 8-bit operation instruction Command according to the decoded input address ADDRin. In detail, when the reset signal Reset is at a logic high level, the output port for transmitting the single angle data xDatain and the operation command Command, etc., will be reset to zero.

當重置信號Reset為邏輯低準位、資料寫入信號WR在邏輯高準位,且時脈信號CLK自邏輯低準位往邏輯高準位正向邊緣觸發(Positive Edge)時:如果在輸入位址ADDRin上出現E5的位址號碼,經資料輸入單元160的解碼後,資料輸入單元160會將數位資料DATAin視為單一角度資料xDatain並輸出至資料選擇單元180;反之,如果在輸入位址ADDRin出現E7的位址號碼,經資料輸入單元160的解碼後,資料輸入單元160會將數位資料DATAin視為運作指令Command。When the reset signal Reset is at a logic low level, the data write signal WR is at a logic high level, and the clock signal CLK is triggered from a logic low level to a logic high level positive edge (Positive Edge): if at the input The address number of E5 appears on the address ADDRin. After being decoded by the data input unit 160, the data input unit 160 regards the digital data DATAin as a single angle data xDatain and outputs it to the data selection unit 180; otherwise, if the input address is ADDRin appears with the address number of E7. After decoding by the data input unit 160, the data input unit 160 regards the digital data DATAin as the operation command Command.

由於只要在輸入位址ADDRin上輸入E5或E7的位址資料,就可以清楚知道數位資料DATAin是單一角度資料xDatain或運作指令Command。因此,利用位址資料解碼方法,就可輕易且正確的將來自處理器(Processor)的資料傳送到目的地,亦即資料被處理的地方。Since the address data of E5 or E7 is input on the input address ADDRin, it can be clearly known that the digital data DATAin is a single angle data xDatain or an operation instruction Command. Therefore, by using the address data decoding method, the data from the processor can be easily and correctly transmitted to the destination, that is, where the data is processed.

請繼續參照圖6,如圖6所示,連續角度產生單元170接收一資料選擇信號xVW,以決定是否產生連續角度資料xAngle。當重置信號Reset為邏輯高準位時,則連續角度資料xAngle=00000000。當重置信號Reset為邏輯低準位資料選擇信號xVW為邏輯高準位,且時脈信號CLK自邏輯低準位往邏輯高準位正向邊緣觸發時,連續角度產生單元170內部的角度信號產生器會自動產生連續角度資料xAngle=00000000~11111111,亦即數值為0~255的連續角度資料xAngle,並同時作為資料選擇單元180的輸入信號。Referring to FIG. 6, as shown in FIG. 6, the continuous angle generating unit 170 receives a data selection signal xVW to determine whether to generate the continuous angle data xAngle. When the reset signal Reset is at a logic high level, the continuous angle data xAngle=00000000. When the reset signal Reset is a logic low level data selection signal xVW is a logic high level, and the clock signal CLK is triggered from a logic low level to a logic high level positive edge, the angle signal inside the continuous angle generating unit 170 The generator automatically generates a continuous angle data xAngle=00000000~11111111, that is, a continuous angle data xAngle with a value of 0~255, and also serves as an input signal of the data selection unit 180.

當重置信號Reset與資料選擇信號xVW皆為邏輯低準位時,則連續角度產生單元170內部的角度信號產生器會停止角度資料xAngle的產生。因此,資料選擇單元180便可依據資料選擇信號xVW讀取單一角度資料xDatain或連續角度資料xAngle,以產生角度資料IndexM,並輸出角度資料IndexM至頻率處理單元110。When both the reset signal Reset and the data selection signal xVW are at a logic low level, the angle signal generator inside the continuous angle generating unit 170 stops the generation of the angle data xAngle. Therefore, the data selection unit 180 can read the single angle data xDatain or the continuous angle data xAngle according to the material selection signal xVW to generate the angle data IndexM, and output the angle data IndexM to the frequency processing unit 110.

圖7為本實施例之數位波形產生器之另一週邊電路方塊圖。如圖7所示,數位波形產生器100更包括一狀態控制單元190、一暫存單元200、一資料輸出單元210及一識別單元220。FIG. 7 is a block diagram of another peripheral circuit of the digital waveform generator of the embodiment. As shown in FIG. 7, the digital waveform generator 100 further includes a state control unit 190, a temporary storage unit 200, a data output unit 210, and an identification unit 220.

狀態控制單元190依序對運作指令Command的部份位元進行編碼,以產生資料選擇信號xVW、頻率選擇信號Freq_sel、波形指示信號xCos、波形指示信號xSin及一暫存值選擇信號Internal_sel。狀態控制單元190是由單一連續狀態控制電路、內部暫存器狀態控制電路及頻率選擇狀態控制電路等三個控制電路共同組織而成的。其中,單一連續狀態控制電路是對運作指令Command的第1與第2位元進行編碼,在此將Command[1:0]定義為運作指令Command的第1~2位元,且Command[0]與Command[1]分別代表運作指令Command之第1位元與第2位元。此外,當重置信號Reset為邏輯高準位時,則資料選擇信號xVW、波形指示信號xCos及波形指示信號xSin均被重置為零。以下將針對單一連續狀態控制電路作更詳細的說明。表7A為單一連續狀態控制電路的真值表。The state control unit 190 sequentially encodes a part of the bit of the operation command Command to generate a data selection signal xVW, a frequency selection signal Freq_sel, a waveform indication signal xCos, a waveform indication signal xSin, and a temporary value selection signal Internal_sel. The state control unit 190 is organized by three control circuits such as a single continuous state control circuit, an internal register state control circuit, and a frequency selective state control circuit. Wherein, the single continuous state control circuit encodes the first and second bits of the operation command Command, where Command[1:0] is defined as the first to second bits of the operation command Command, and Command[0] The command [1] represents the first bit and the second bit of the operation command Command, respectively. In addition, when the reset signal Reset is at a logic high level, the data selection signal xVW, the waveform indication signal xCos, and the waveform indication signal xSin are all reset to zero. A more detailed description of the single continuous state control circuit will follow. Table 7A is a truth table for a single continuous state control circuit.

請配合圖7並參照表7A,如表7A所示,在重置信號Reset為邏輯低準位,且配合時脈信號CLK自邏輯低準位往邏輯高準位正向邊緣觸發時,則會有下列三種輸出及輸入間的關係:運作指令Command[1]用以代表資料選擇信號xVW。運作指令Command[0]用以代表波形指示信號xCos。將運作指令Command[0]經反相運算後可用以代表波形指示信號xSin。Please refer to FIG. 7 and refer to Table 7A. As shown in Table 7A, when the reset signal Reset is at a logic low level and the clock signal CLK is triggered from the logic low level to the logic high level positive edge, There are three types of output and the relationship between the inputs: the operation command Command[1] is used to represent the data selection signal xVW. The operation command Command[0] is used to represent the waveform indication signal xCos. The operation command Command[0] can be used to represent the waveform indication signal xSin after the inverse operation.

此外,如圖7A所示,當Command[1]=0,Command[0]=0時,表示為單一正弦值狀態,此時數位波形產生器100進行數位正弦波函數FST (n)之單一值運算。當Command[1]=0,Command[0]=1時,表示為單一餘弦值狀態,此時數位波形產生器100進行數位餘弦波函數FCT (n)之單一值運算。當Command[1]=1,Command[0]=0時,表示為連續正弦值狀態,此時數位波形產生器100進行數位正弦波函數FST (n)之連續值運算。當Command[1]=1,Command[0]=1時,表示為連續餘弦值狀態,此時數位波形產生器100進行數位餘弦波函數FCT (n)之連續值運算。Further, as shown in FIG. 7A, when Command[1]=0, Command[0]=0, it is represented as a single sine value state, and at this time, the digital waveform generator 100 performs a single digital sine wave function F ST (n). Value operation. When Command[1]=0, Command[0]=1, it is represented as a single cosine value state, and the digital waveform generator 100 performs a single value operation of the digital cosine wave function F CT (n). When Command[1]=1, Command[0]=0, it is expressed as a continuous sine value state, and the digital waveform generator 100 performs a continuous value operation of the digital sine wave function F ST (n). When Command[1]=1, Command[0]=1, it is expressed as a continuous cosine value state, and at this time, the digital waveform generator 100 performs a continuous value operation of the digital cosine wave function F CT (n).

此外,當資料選擇信號xVW為邏輯高準位時,將啟動連續角度產生單元170及資料選擇單元180。其中連續角度產生單元170會自動產生連續的角度資料xAngle,而此時資料選擇單元180會讀取此連續的角度資料xAngle,以產生角度資料IndexM並輸出角度資料IndexM至頻率處理單元110。如此,便可使數位波形產生器100運作起來,完成連續的原型數位正弦波的函數式FST (n)的數值運算或原型數位餘弦波的函數式FCT (n)的數值運算。In addition, when the material selection signal xVW is at a logic high level, the continuous angle generating unit 170 and the material selecting unit 180 are activated. The continuous angle generating unit 170 automatically generates a continuous angle data xAngle, and at this time, the data selecting unit 180 reads the continuous angle data xAngle to generate the angle data IndexM and outputs the angle data IndexM to the frequency processing unit 110. In this way, the digital waveform generator 100 can be operated to perform a numerical operation of a continuous prototype digital sine wave function F ST (n) or a numerical operation of a prototype digital cosine wave function F CT (n).

當資料選擇信號xVW為邏輯低準位時,狀態控制單元190將關閉連續角度產生單元170並資料選擇單元180。此時資料選擇單元180會讀取來自資料輸入單元160的單一角度資料xDatain,以產生角度資料IndexM並輸出角度資料IndexM至頻率處理單元110。如此,便可使數位波形產生器100運作起來,完成單一個原型數位正弦波的函數式FST (n)的數值運算或原型數位餘弦波的函數式FCT (n)的數值運算。When the material selection signal xVW is at a logic low level, the state control unit 190 will turn off the continuous angle generating unit 170 and the material selecting unit 180. At this time, the material selection unit 180 reads the single angle data xDatain from the data input unit 160 to generate the angle data IndexM and outputs the angle data IndexM to the frequency processing unit 110. In this way, the digital waveform generator 100 can be operated to perform a numerical operation of a single prototype digital sine wave function F ST (n) or a numerical operation of a prototype digital cosine wave function F CT (n).

此外,當波形指示信號xCos為邏輯高準位,且同時波形指示信號xSin為邏輯低準位時,數位波形產生器100僅會處理原型數位餘弦波的函數式FCT (n)的數值運算。當波形指示信號xCos為邏輯低準位,且同時波形指示信號xSin為邏輯高準位時,數位波形產生器100僅會處理原型數位餘弦波的函數式FST (n)的數值運算。值得注意的是,波形指示信號xSin及波形指示信號xCos為互斥(exclusive or)的兩個信號,亦即這兩個信號不能同時為邏輯高準位或同時為邏輯低準位,且兩信號經互斥運算後會產生指示信號xSC。In addition, when the waveform indication signal xCos is at a logic high level and the waveform indication signal xSin is at a logic low level, the digital waveform generator 100 only processes the numerical operation of the functional formula F CT (n) of the prototype digital cosine wave. When the waveform indicating signal xCos is at a logic low level and the waveform indicating signal xSin is at a logic high level, the digital waveform generator 100 only processes the numerical operation of the functional formula F ST (n) of the prototype digital cosine wave. It should be noted that the waveform indication signal xSin and the waveform indication signal xCos are two signals of exclusive or exclusive, that is, the two signals cannot be logic high level or both logic low level, and the two signals are The indication signal xSC is generated after the mutual exclusion operation.

再來是關於狀態控制單元190中之內部暫存器狀態控制電路的運作說明。內部暫存器狀態控制電路是對運作指令Command的第3~4位元進行編碼,用以產生4位元的暫存值選擇信號Internal_sel並輸出至暫存單元200。在此將運作指令Command的第3與第4位元分別定義為Command[2]與Command[3],且在此將Command[3:2]定義為運作指令Command的第3至第4位元。此外,當重置信號Reset為邏輯高準位時,則暫存值選擇信號Internal_sel被重置為零。以下將針對內部暫存器狀態控制電路的作更詳細的說明。表7B為暫存器狀態控制電路電路的真值表。其中,b[0]~b[3]分別代表暫存值選擇信號Intemal_sel的第1至第4位元。A further description of the operation of the internal register state control circuit in state control unit 190. The internal register state control circuit encodes the 3rd to 4th bits of the operation command Command to generate a 4-bit temporary value selection signal Internal_sel and outputs it to the temporary storage unit 200. Here, the 3rd and 4th bits of the operation command Command are defined as Command[2] and Command[3], respectively, and Command[3:2] is defined herein as the 3rd to 4th bits of the operation command Command. . Further, when the reset signal Reset is at a logic high level, the temporary value selection signal Internal_sel is reset to zero. The internal register state control circuit will be described in more detail below. Table 7B is a truth table of the register state control circuit. Where b[0]~b[3] represent the first to fourth bits of the temporary value selection signal Intemal_sel, respectively.

請配合圖7參照表7B,如表7B所示,在重置信號Reset為邏輯低準位,且時脈信號CLK自邏輯低準位往邏輯高準位正向邊緣觸發時,則會有下列四種輸出及輸入間的關係:Please refer to Table 7B in conjunction with FIG. 7. As shown in Table 7B, when the reset signal Reset is at a logic low level, and the clock signal CLK is triggered from a logic low level to a logic high level positive edge, there are the following The relationship between the four outputs and the inputs:

b[0]=(Command[3])nor(Command[2])。b[0]=(Command[3])nor(Command[2]).

b[1]=not(Command[3])and(Command[2])。b[1]=not(Command[3])and(Command[2]).

b[2]=not(Command[2])and(Command[3])。b[2]=not(Command[2])and(Command[3]).

b[3]=(Command[3])and(Command[2])b[3]=(Command[3])and(Command[2])

如表7B所示,當Command[3]=0與Command[2]=0時,表示暫存值選擇信號Internal_sel=0001。此時,暫存器狀態控制電路會啟動暫存單元200,並配合時脈信號CLK邏輯低準位往邏輯高準位正向邊緣觸發時,將波形輸出值Mag_SC存到暫存單元200的內部暫存器。當Command[3]=0與Command[2]=1時,表示暫存值選擇信號Internal_sel=0010,暫存器狀態控制電路會啟動暫存單元200,並配合時脈信號CLK邏輯低準位往邏輯高準位正向邊緣觸發時,將相位函數值Mag_PhZ存到暫存單元200的內部暫存器。As shown in Table 7B, when Command[3]=0 and Command[2]=0, the temporary value selection signal Internal_sel=0001 is indicated. At this time, the register state control circuit starts the temporary storage unit 200, and saves the waveform output value Mag_SC to the internal portion of the temporary storage unit 200 when the logical low level of the clock signal CLK is triggered to the positive edge of the logic high level. Register. When Command[3]=0 and Command[2]=1, it indicates that the temporary value selection signal Internal_sel=0010, the register state control circuit starts the temporary storage unit 200, and cooperates with the clock signal CLK logic low level to When the logic high level is triggered to the positive edge, the phase function value Mag_PhZ is stored in the internal register of the temporary storage unit 200.

當Command[3]=1與Command[2]=0時,表示暫存值選擇信號Internal_sel=0100,暫存器狀態控制電路會啟動暫存單元200,並配合時脈信號CLK邏輯低準位往邏輯高準位正向邊緣觸發時,將相區角度資料PhaseZ存到暫存單元200的內部暫存器。當Command[3]=1與Command[2]=1時,表示暫存值選擇信號Internal_sel=1000,暫存器狀態控制電路會啟動暫存單元200,並配合時脈信號CLK邏輯低準位往邏輯高準位正向邊緣觸發時,將基準角度資料IndexN存到暫存單元200的內部暫存器。When Command[3]=1 and Command[2]=0, it indicates that the temporary value selection signal Internal_sel=0100, the register state control circuit starts the temporary storage unit 200, and cooperates with the clock signal CLK logic low level. When the logic high level is triggered to the positive edge, the phase area angle data PhaseZ is stored in the internal register of the temporary storage unit 200. When Command[3]=1 and Command[2]=1, it indicates that the temporary value selection signal Internal_sel=1000, the register state control circuit starts the temporary storage unit 200, and cooperates with the clock signal CLK logic low level to When the logic high level is triggered to the positive edge, the reference angle data IndexN is stored in the internal register of the temporary storage unit 200.

由此可知,暫存單元200是用以儲存相位函數值Mag_PhZ、波形輸出值Mag_SC、基準角度資料IndexN以及相區角度資料PhaseZ。此外,暫存單元200還會依據暫存值選擇信號Internal_sel輸出內部暫存器的所儲存的儲存相位函數值Mag_PhZ、波形輸出值Mag_SC、基準角度資料IndexN及相區角度資料PhaseZ之其一,以作為內部暫存值Int_reg。表7C為暫存單元的真值表。It can be seen that the temporary storage unit 200 is configured to store the phase function value Mag_PhZ, the waveform output value Mag_SC, the reference angle data IndexN, and the phase angle data PhaseZ. In addition, the temporary storage unit 200 further outputs one of the stored storage phase function value Mag_PhZ, the waveform output value Mag_SC, the reference angle data IndexN, and the phase angle data PhaseZ of the internal temporary register according to the temporary value selection signal Internal_sel. As the internal temporary value Int_reg. Table 7C is a truth table of the temporary storage unit.

如表7C所示,當重置信號Reset為邏輯高準位時,則內部暫存值Int reg=00000000,亦即將內部暫存值Int reg重置為零。當重置信號Reset為邏輯低準位,時脈信號CLK由邏輯低準位至邏輯高準位正向邊緣觸發時,且暫存值選擇信號Internal sel=0001時,則暫存單元200會將內部暫存器中的波形輸出值Mag_SC輸出作為內部暫存值Int_reg。As shown in Table 7C, when the reset signal Reset is at a logic high level, the internal temporary storage value Int reg = 00000000, that is, the internal temporary storage value Int reg is reset to zero. When the reset signal Reset is at a logic low level, when the clock signal CLK is triggered from a logic low level to a logic high level positive edge, and the temporary value selection signal Internal sel=0001, the temporary storage unit 200 will The waveform output value Mag_SC in the internal register is output as the internal temporary value Int_reg.

當重置信號Reset為邏輯低準位,時脈信號CLK由邏輯低準位至邏輯高準位正向邊緣觸發,且暫存值選擇信號Internal sel=0010時,則暫存單元200會將內部暫存器中的相位函數值Mag_PhZ輸出作為內部暫存值Int_reg。When the reset signal Reset is at a logic low level, the clock signal CLK is triggered from a logic low level to a logic high level positive edge, and the temporary value selection signal Internal sel=0010, then the temporary storage unit 200 will internally The phase function value Mag_PhZ in the register is output as the internal temporary value Int_reg.

當重置信號Reset為邏輯低準位,且時脈信號CLK由邏輯低準位至邏輯高準位正向邊緣觸發時,若暫存值選擇信號Internal sel=0100,則暫存單元200會將內部暫存器中的相區角度資料PhaseZ輸出作為內部暫存值Int_reg。When the reset signal Reset is at a logic low level and the clock signal CLK is triggered from a logic low level to a logic high level positive edge, if the temporary value selection signal Internal sel=0100, the temporary storage unit 200 will The phase zone angle data PhaseZ output in the internal register is used as the internal temporary storage value Int_reg.

當重置信號Reset為邏輯低準位,時脈信號CLK由邏輯低準位至邏輯高準位正向邊緣觸發,且暫存值選擇信號Internal sel=1000時,則暫存單元200會將內部暫存器中的基準角度資料IndexN輸出作為內部暫存值Int_reg。When the reset signal Reset is at a logic low level, the clock signal CLK is triggered from a logic low level to a logic high level positive edge, and the temporary value selection signal Internal sel=1000, the temporary storage unit 200 will internally The reference angle data IndexN output in the scratchpad is used as the internal temporary storage value Int_reg.

當重置信號Reset為邏輯低準位,時脈信號CLK由邏輯低準位至邏輯高準位正向邊緣觸發,且若暫存值選擇信號Internal_sel為非上述狀況時,則暫存單元200會輸出內部暫存值Int_reg=00000000。When the reset signal Reset is at a logic low level, the clock signal CLK is triggered from a logic low level to a logic high level positive edge, and if the temporary value selection signal Internal_sel is not the above condition, the temporary storage unit 200 The internal internal storage value Int_reg=00000000 is output.

因此,藉由暫存單元200所輸出的內部暫存值Int_reg,便可清楚的瞭解到相位函數值Mag_PhZ、波形輸出值Mag_SC、基準角度資料IndexN以及相區角度資料PhaseZ是否正確,由此可偵斷出運算功能錯誤的地方。Therefore, by the internal temporary storage value Int_reg outputted by the temporary storage unit 200, it can be clearly understood whether the phase function value Mag_PhZ, the waveform output value Mag_SC, the reference angle data IndexN, and the phase angle data PhaseZ are correct, thereby detecting Break out where the arithmetic function is wrong.

再來是關於狀態控制單元190中之頻率選擇狀態控制電路的運作說明。頻率選擇狀態控制電路是對運作指令Command的第5至第7位元進行編碼,用以產生8位元的頻率選擇信號Freq_sel並輸出至頻率選擇單元110。為方便說明起見此外,當重置信號Reset為邏輯高準位時,頻率選擇信號Freq_sel被重置為零。表7D為頻率選擇狀態控制電路的真值表。其中,b[0]~b[7]依序代表頻率選擇信號Freq_sel的第1至第8位元,運作指令Command(n)用以表示運作指令Command中的第(n+1)位元,n=0~7,且Command[6:4]表運作指令Command中的第5至第7位元。Next is a description of the operation of the frequency selection state control circuit in the state control unit 190. The frequency selection state control circuit encodes the 5th to 7th bits of the operation command Command to generate an 8-bit frequency selection signal Freq_sel and outputs it to the frequency selection unit 110. For convenience of explanation, in addition, when the reset signal Reset is at a logic high level, the frequency selection signal Freq_sel is reset to zero. Table 7D is a truth table of the frequency selection state control circuit. Wherein b[0]~b[7] sequentially represent the first to eighth bits of the frequency selection signal Freq_sel, and the operation instruction Command(n) is used to represent the (n+1)th bit in the operation instruction Command. n=0~7, and the Command[6:4] table operates the 5th to 7th bits in the Command.

如表7D所示,在維持Command(7)=1並配合Command[6:4]變化的情況下,當重置信號Reset為邏輯低準位,且時脈信號CLK自邏輯低準位往邏輯高準位正向邊緣觸發時,會有8種輸出及輸入間的編碼關係。其中,Command(7)=1,表示將此位元預置於邏輯高準位,以保留此指令位元預留未來擴充之用。As shown in Table 7D, when Command(7)=1 is maintained and Command[6:4] is changed, when the reset signal Reset is at a logic low level, and the clock signal CLK is from a logic low level to logic When the high level is triggered on the positive edge, there are 8 kinds of output and the coding relationship between the inputs. Where Command(7)=1 indicates that the bit is preset to a logic high level to reserve the future expansion of the instruction bit.

請對照圖3與圖7,並參照表2與表7D,如表7D所示,當Command(7)=1且 Command[6:4]=000時,表示頻率選擇狀態控制電路處在頻率選擇信Freq_sel=00000001的狀態。此時,狀態控制單元190會將頻率選擇信號Freq_se1=00000001輸出至頻率處理單元110。當時脈信號CLK由邏輯低準位往邏輯高準位時,頻率處理單元110輸出邏輯高準位的直流信號DCout,表示頻率處理單元110目前處於直流準位狀態,尚未進行週期性數位正弦波及週期性數位餘弦波之產生過程的運算。Please refer to FIG. 3 and FIG. 7 and refer to Table 2 and Table 7D. As shown in Table 7D, when Command(7)=1 and Command[6:4]=000, it indicates that the frequency selection state control circuit is in frequency selection. The status of the letter Freq_sel=00000001. At this time, the state control unit 190 outputs the frequency selection signal Freq_se1=00000001 to the frequency processing unit 110. When the clock signal CLK is at a logic low level to a logic high level, the frequency processing unit 110 outputs a DC signal DCout of a logic high level, indicating that the frequency processing unit 110 is currently in a DC level state, and has not performed a periodic digital sine wave and period. The operation of the generation process of the sexual digital cosine wave.

當Command(7)=1且Command[6:4]=001時,表示頻率選擇狀態控制電路處在Freq_sel=00000010的狀態。此時,狀態控制單元190會將頻率選擇信號Freq_sel=00000010輸出至頻率處理單元110。當時脈信號CLK由邏輯低準位往邏輯高準位時,頻率處理單元110會直接輸出角度資料IndexM以作為基準角度資料IndexN,進而產生頻率等同於原型數位波之週期性數位正弦波或週期性數位餘弦波。When Command(7)=1 and Command[6:4]=001, it indicates that the frequency selection state control circuit is in the state of Freq_sel=00000010. At this time, the state control unit 190 outputs the frequency selection signal Freq_sel=00000010 to the frequency processing unit 110. When the pulse signal CLK is from the logic low level to the logic high level, the frequency processing unit 110 directly outputs the angle data IndexM as the reference angle data IndexN, thereby generating a periodic digital sine wave or periodicity whose frequency is equivalent to the prototype digital wave. Digital cosine wave.

當Command(7)=1且Command[6:4]=010時,表示頻率選擇狀態控制電路處在Freq_sel=00000100的狀態。此時,狀態控制單元190會將頻率選擇信號Freq_sel=00000100輸出至頻率處理單元110。當時脈信號CLK由邏輯低準位往邏輯高準位時,頻率處理單元110會將角度資料IndexM左移1位元以作為基準角度資料IndexN,進而產生頻率2倍於原型數位波之週期性數位正弦波或週期性數位餘弦波。When Command(7)=1 and Command[6:4]=010, it indicates that the frequency selection state control circuit is in the state of Freq_sel=00000100. At this time, the state control unit 190 outputs the frequency selection signal Freq_sel=00000100 to the frequency processing unit 110. When the pulse signal CLK is from the logic low level to the logic high level, the frequency processing unit 110 shifts the angle data IndexM to the left by 1 bit as the reference angle data IndexN, thereby generating a periodic digital number twice the frequency of the prototype digital wave. Sine wave or periodic digital cosine wave.

當Command(7)=1且Command[6:4]=011時,表示頻率選擇狀態控制電路處在Freq_sel=00001000的狀態。此時,狀態控制單元190會將頻率選擇信號Freq_sel=00001000輸出至頻率處理單元110。當時脈信號CLK由邏輯低準位往邏輯高準位時,頻率處理單元110會將角度資料IndexM左移2位元以作為基準角度資料IndexN,進而產生頻率4倍於原型數位波之週期性數位正弦波或週期性數位餘弦波。When Command(7)=1 and Command[6:4]=011, it indicates that the frequency selection state control circuit is in the state of Freq_sel=00001000. At this time, the state control unit 190 outputs the frequency selection signal Freq_sel=00001000 to the frequency processing unit 110. When the pulse signal CLK is from the logic low level to the logic high level, the frequency processing unit 110 shifts the angle data IndexM to the left by 2 bits as the reference angle data IndexN, thereby generating a frequency 4 times the periodic digit of the prototype digital wave. Sine wave or periodic digital cosine wave.

當Command(7)=1且Command[6:4]=100時,表示頻率選擇狀態控制電路處在Freq_sel=00010000的狀態。此時,狀態控制單元190會將頻率選擇信號Freq_sel=00010000輸出至頻率處理單元110。當時脈信號CLK由邏輯低準位往邏輯高準位時,頻率處理單元110會將角度資料IndexM左移3位元以作為基準角度資料IndexN,進而產生頻率8倍於原型數位波之週期性數位正弦波或週期性數位餘弦波。When Command(7)=1 and Command[6:4]=100, it indicates that the frequency selection state control circuit is in the state of Freq_sel=00010000. At this time, the state control unit 190 outputs the frequency selection signal Freq_sel=00010000 to the frequency processing unit 110. When the pulse signal CLK is from the logic low level to the logic high level, the frequency processing unit 110 shifts the angle data IndexM to the left by 3 bits as the reference angle data IndexN, thereby generating a frequency 8 times the periodic digit of the prototype digital wave. Sine wave or periodic digital cosine wave.

當Command(7)=1且Command[6:4]=101時,表示頻率選擇狀態控制電路處在Freq_sel=00100000的狀態。此時,狀態控制單元190會將頻率選擇信號Freq_sel=00100000輸出至頻率處理單元110。當時脈信號CLK由邏輯低準位往邏輯高準位時,頻率處理單元110會將角度資料IndexM左移4位元以作為基準角度資料IndexN,進而產生頻率16倍於原型數位波之週期性數位正弦波或週期性數位餘弦波。When Command(7)=1 and Command[6:4]=101, it indicates that the frequency selection state control circuit is in the state of Freq_sel=00100000. At this time, the state control unit 190 outputs the frequency selection signal Freq_sel=00100000 to the frequency processing unit 110. When the pulse signal CLK is from the logic low level to the logic high level, the frequency processing unit 110 shifts the angle data IndexM to the left by 4 bits as the reference angle data IndexN, thereby generating a frequency 16 times the periodic digit of the prototype digital wave. Sine wave or periodic digital cosine wave.

當Command(7)=1且Command[6:4]=110時,表示頻率選擇狀態控制電路處在Freq_sel=01000000的狀態。此時,狀態控制單元190會將頻率選擇信號Freq_sel=01000000輸出至頻率處理單元110。當時脈信號CLK由邏輯低準位往邏輯高準位時,頻率處理單元110會將角度資料IndexM左移5位元以作為基準角度資料IndexN,進而產生頻率32倍於原型數位波之週期性數位正弦波或週期性數位餘弦波。When Command(7)=1 and Command[6:4]=110, it indicates that the frequency selection state control circuit is in the state of Freq_sel=01000000. At this time, the state control unit 190 outputs the frequency selection signal Freq_sel=01000000 to the frequency processing unit 110. When the pulse signal CLK is from the logic low level to the logic high level, the frequency processing unit 110 shifts the angle data IndexM to the left by 5 bits as the reference angle data IndexN, thereby generating a frequency 32 times the periodic digit of the prototype digital wave. Sine wave or periodic digital cosine wave.

當Command(7)=1且Command[6:4]=111時,表示頻率選擇狀態控制電路處在Freq_sel=10000000的狀態。此時,狀態控制單元190會將頻率選擇信號Freq_sel=10000000輸出至頻率處理單元110。當時脈信號CLK由邏輯低準位往邏輯高準位時,頻率處理單元110會將角度資料IndexM左移6位元以作為基準角度資料IndexN,進而產生頻率64倍於原型數位波之週期性數位正弦波或週期性數位餘弦波。When Command(7)=1 and Command[6:4]=111, it indicates that the frequency selection state control circuit is in the state of Freq_sel=10000000. At this time, the state control unit 190 outputs the frequency selection signal Freq_sel=10000000 to the frequency processing unit 110. When the pulse signal CLK is from the logic low level to the logic high level, the frequency processing unit 110 shifts the angle data IndexM to the left by 6 bits as the reference angle data IndexN, thereby generating a frequency 64 times the periodic digit of the prototype digital wave. Sine wave or periodic digital cosine wave.

請繼續參照圖7,資料輸出單元210依據資料讀出信號RD以及解碼後的輸入位址ADDRin,而決定是否暫存並輸出內部暫存值Int_reg,以作為資料輸出SCdata_out。詳言之,當重置信號Reset為邏輯高準位時,資料輸出單元210被重置為零。當重置信號Reset為邏輯低準位且資料讀出信號RD在邏輯高準位,且時脈信號CLK自邏輯低準位往邏輯高準位正向邊緣觸發時,如果8位元的輸入位址ADDRin上出現E6的位址號碼,經資料輸出單元210的解碼後,資料輸出單元210會將內部暫存值Int_reg輸出作為資料輸出SCdata_out。Referring to FIG. 7, the data output unit 210 determines whether to temporarily store and output the internal temporary storage value Int_reg as the data output SCdata_out according to the data read signal RD and the decoded input address ADDRin. In detail, when the reset signal Reset is at a logic high level, the data output unit 210 is reset to zero. When the reset signal Reset is at a logic low level and the data readout signal RD is at a logic high level, and the clock signal CLK is triggered from a logic low level to a logic high level positive edge, if an 8-bit input bit is present The address number of E6 appears on the address ADDRin. After decoding by the data output unit 210, the data output unit 210 outputs the internal temporary storage value Int_reg as the data output SCdata_out.

另一方面,識別單元220係依據波形指示信號xCos與xSine所產生的指示信號xSC、資料選擇信號xVW、運作指令Command的部份位元、由基準角度資料IndexN中2個最高有效位元所形成的相區信號xdela、輸入位址ADDRin以及相區鑑別信號Ph_discri,來決定是否產生運算完成信號Done_out,以判別週期性數位波的輸出是否已完成。其中,圖7的Ph_discri[0,3,4,7]示意地表示相區鑑別信號Ph_discri的第1、第4、第5及第8位元。On the other hand, the identification unit 220 is formed according to the indication signal xSC generated by the waveform indication signals xCos and xSine, the data selection signal xVW, part of the bit of the operation instruction Command, and the two most significant bits in the reference angle data IndexN. The phase region signal xdela, the input address ADDRin, and the phase region discrimination signal Ph_discri determine whether or not the operation completion signal Done_out is generated to determine whether the output of the periodic digital wave has been completed. Here, Ph_discri[0, 3, 4, 7] of FIG. 7 schematically shows the first, fourth, fifth, and eighth bits of the phase identification signal Ph_discri.

此外,當重置信號Reset為邏輯高準位時,則運算完成信號Done_out=000,亦即將運算完成信號Done_out重置為0。在本實施例中,運算完成信號Done_out是以脈衝波的形式出現。表7E為識別單元220的真值表。其中,Ph_discri(3)、P h_discri(7)分別代表相區鑑別信號Ph_discri的第4及第8位元。In addition, when the reset signal Reset is at a logic high level, the operation completion signal Done_out=000, that is, the operation completion signal Done_out is reset to 0. In the present embodiment, the operation completion signal Done_out appears in the form of a pulse wave. Table 7E is a truth table of the identification unit 220. Among them, Ph_discri(3) and Ph_discri(7) respectively represent the 4th and 8th bits of the phase identification signal Ph_discri.

如表7E所示,在重置信號Reset為邏輯低準位,且時脈信號CLK由邏輯低準位往邏輯高準位正向邊緣觸發發的形況下,當資料選擇信號xVW=1時,則表示數位波形產生器100要進行連續角度資料的輸入,亦即會自動將角度自00000000(0度)逐一掃瞄到11111111(360度)。因此,配合相區鑑別信號Phdiscri的第1、第4、第3、第8位元(即Ph_discri(0)、Ph_discri(3)、Ph_discri(4)、Ph_discri(7))及相區信號xdela,且當角度資料IndexM=11111111時,代表波形數位產生器100已運作完成,故識別單元220會輸出完成信號Done_out,表示執行完成連續角度資料xAngle輸入的原型數位正弦波函數式FsT (n)或原型數位餘弦波函數式FCT (n)的運算。此外,完成信號Done_out(在此為脈衝信號)可用以通知處理器,以致使處理器取得原型數位正弦波函數式FZT (n)或原型數位餘弦波函數式FCT (n)已運算完畢的資訊。As shown in Table 7E, when the reset signal Reset is at a logic low level and the clock signal CLK is triggered by a logic low level to a positive edge of a logic high level, when the data selection signal xVW=1 , it means that the digital waveform generator 100 needs to input the continuous angle data, that is, the angle is automatically scanned from 000000 (0 degrees) to 11111111 (360 degrees) one by one. Therefore, the first, fourth, third, and eighth bits of the phase identification signal Phdiscri (ie, Ph_discri(0), Ph_discri(3), Ph_discri(4), Ph_discri(7)) and the phase-area signal xdela, And when the angle data IndexM=11111111, the representative waveform digit generator 100 has been completed, so the identification unit 220 outputs a completion signal Done_out indicating that the prototype digital sine wave function F sT (n) or the continuous angle data xAngle input is executed. The operation of the prototype digital cosine wave function F CT (n). In addition, the completion signal Done_out (here, a pulse signal) can be used to notify the processor such that the processor obtains the prototype digital sine wave function F ZT (n) or the prototype digital cosine wave function F CT (n) has been calculated. News.

當資料選擇信號xVW=0時,則表示數位波形產生器100要進行單一角度資料xDatain之輸入,亦即會自資料輸入單元160會將單一角度資料xDatain自動輸入到資料選擇單元180。此時,識別單元220會配合運作指令Command[7]、輸入位址ADDRin、指示信號xSC、內部計數器Count_out..等,在內部計數器Count_out完成到數計時後輸出完成信號Done_out,以代表波形數位產生器100已運作完成。因此,藉由完成信號Done_out,可以得知週期性數位波的輸出是否完成。When the data selection signal xVW=0, it indicates that the digital waveform generator 100 is to input the single angle data xDatain, that is, the single angle data xDatain is automatically input from the data input unit 160 to the data selection unit 180. At this time, the identification unit 220 cooperates with the operation command Command[7], the input address ADDRin, the indication signal xSC, the internal counter Count_out.., etc., and outputs the completion signal Done_out after the internal counter Count_out is completed to count the number of digits. The device 100 has been operational. Therefore, by completing the signal Done_out, it can be known whether the output of the periodic digital wave is completed.

從另一個角度來看,圖8繪示為依據本發明一實施例之產生數位波形的方法流程圖。請參照圖8,首先,以一原型數位波為基準,依據一頻率選擇信號而將一角度資料的數值限縮或是放大2^P倍,並據以產生一基準角度資料,P為整數且P≧0(步驟S801)。接著,依據基準角度資料中的R個最高有效位元與S個波形指示信號來產生一相區鑑別信號,以指向原型數位波所延伸出之(2^R)*S個相區中的一特定相區,R與S為正整數(步驟S802)。Viewed from another perspective, FIG. 8 is a flow chart of a method of generating a digital waveform in accordance with an embodiment of the present invention. Referring to FIG. 8 , firstly, based on a prototype digital wave, the value of the angle data is limited or amplified by 2^P times according to a frequency selection signal, and a reference angle data is generated, and P is an integer and P ≧ 0 (step S801). Then, a phase discrimination signal is generated according to the R most significant bits and the S waveform indication signals in the reference angle data, to point to one of (2^R)*S phase regions extended by the prototype digital wave. For a specific phase region, R and S are positive integers (step S802).

再來,依據相區鑑別信號從(2^R)*S個挪移關係式中選出對應特定相區的挪移關係式,以將基準角度資料的數值挪移至原型數位波的第1個相區內,並據以產生一相區角度資料(步驟S803)。繼之,提供用以合成位在第1個相區內之原型數位波的多個函數運算式,並將相區角度資料帶入至這些函數運算式之其一,以計算出相區角度資料所對應的一相位函數值(步驟S804)。Then, according to the phase region discrimination signal, the shift relationship corresponding to the specific phase region is selected from the (2^R)*S shift relationship to shift the value of the reference angle data to the first phase region of the prototype digital wave. And generating a phase region angle data accordingly (step S803). Then, a plurality of functional expressions for synthesizing the prototype digital wave located in the first phase region are provided, and the phase angle data is brought into one of the functional expressions to calculate the phase angle data. Corresponding one phase function value (step S804).

最後,依據相區鑑別信號而決定提供相位函數值的相反數或是直接提供相位函數值作為一波形輸出值,並利用波形輸出值產生頻率為原型數位波之1/(2^M)倍或是2^M倍的一週期性數位波(步驟S805)。至於本實施例所述之產生數位波形的方法的細部流程,已包含在上述各實施例中,故在此不予贅述。Finally, depending on the phase region discrimination signal, the inverse of the phase function value is determined or the phase function value is directly provided as a waveform output value, and the waveform output value is used to generate a frequency of 1/(2^M) times the prototype digital wave or It is a periodic digital wave of 2^M times (step S805). The detailed flow of the method for generating a digital waveform described in this embodiment is included in the above embodiments, and thus will not be described herein.

綜上所述,本發明因使用相區轉換法,其不但能省去正/餘弦函數對照表的使用,且僅使用8個公式就能產生完整的週期性正弦/餘弦數位波,故能提升電路的運算速度與減少記憶體的容量。此外,本發明的數位波形產生器採用位址解碼方法,其可提供使用者在電路原始碼(Source Code)的定址參數暫存器上修改微控制碼(Micro code),以擁有不同微控制碼的數位波形產生器。因此,除了設計者之外,其他人均很難破解此特定的定址碼,故可達到保密兼防止仿冒的功能。In summary, the present invention uses the phase-to-area conversion method, which not only saves the use of the positive/cosine function comparison table, but also uses only eight formulas to generate a complete periodic sine/cosine digital wave, so that it can be improved. The speed of the circuit is reduced and the capacity of the memory is reduced. In addition, the digital waveform generator of the present invention adopts an address decoding method, which can provide a user to modify a micro code on an address parameter register of a circuit source code to have different micro control codes. Digital waveform generator. Therefore, except for the designer, it is difficult for others to crack this specific address code, so that the function of confidentiality and counterfeiting can be achieved.

除此之外,本發明數位波形產生器可運用於航海、曆法、天文、地理,航空、建築、工程、土地測量等工程。其中,所產生的週期性數位正、餘波形亦可使用於通信系统(Communications Systems)晶片產品內,以提供給調變及解調變信號(Modulate/Demodulate)之用。In addition, the digital waveform generator of the present invention can be applied to navigation, calendar, astronomy, geography, aviation, architecture, engineering, land surveying and the like. The generated periodic digital positive and residual waveforms can also be used in a Communications Systems wafer product for modulation and demodulation.

雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明之精神和範圍內,當可作些許之更動與潤飾,故本發明之保護範圍當視後附之申請專利範圍所界定者為準。Although the present invention has been disclosed in the above embodiments, it is not intended to limit the invention, and any one of ordinary skill in the art can make some modifications and refinements without departing from the spirit and scope of the invention. The scope of the invention is defined by the scope of the appended claims.

100...數位波形產生器100. . . Digital waveform generator

110...頻率處理單元110. . . Frequency processing unit

120...相區鑑別單元120. . . Phase identification unit

130...相區轉換單元130. . . Phase conversion unit

140...函數值計算單元140. . . Function value calculation unit

142...運算控制單元142. . . Operation control unit

144a...第一數值調整單元144a. . . First value adjustment unit

144b...第二數值調整單元144b. . . Second value adjustment unit

144c...第三數值調整單元144c. . . Third value adjustment unit

146a...第一多工單元146a. . . First multiplex unit

146b...第二多工單元146b. . . Second multiplex unit

148...加法單元148. . . Addition unit

150...極性轉換單元150. . . Polarity conversion unit

160...資料輸入單元160. . . Data input unit

170...連續角度產生單元170. . . Continuous angle generating unit

180...資料選擇單元180. . . Data selection unit

190...狀態控制單元190. . . State control unit

200...暫存單元200. . . Staging unit

210...資料輸出單元210. . . Data output unit

220...識別單元220. . . Identification unit

Ph1~Ph8...相區Ph1~Ph8. . . Phase zone

T、T1、T2...週期T, T1, T2. . . cycle

S...取樣點S. . . Sampling point

Freq_sel:頻率選擇信號Freq_sel: frequency selection signal

IndexM:角度資料IndexM: Angle data

IndexN:基準角度資料IndexN: reference angle data

DCout:直流信號DCout: DC signal

xdela:相區信號Xdela: phase zone signal

xSin、xCos:波形指示信號xSin, xCos: waveform indication signal

Ph_discri、Ph_discri[0,3,4,7]:相區鑑別信號Ph_discri, Ph_discri[0,3,4,7]: phase zone discrimination signal

PhaseZ...相區角度資料PhaseZ. . . Phase angle data

xSC...指示信號xSC. . . Indication signal

Mag_PhZ...相位函數值Mag_PhZ. . . Phase function value

Mag_SC...波形輸出值Mag_SC. . . Waveform output value

Reset...重置信號Reset. . . Reset signal

CLK...時脈信號CLK. . . Clock signal

N70...第一常數資料N70. . . First constant data

N100...第二常數資料N100. . . Second constant data

N24...第三常數資料N24. . . Third constant data

N26...第四常數資料N26. . . Fourth constant data

N27...第五常數資料N27. . . Fifth constant data

DATAin...數位資料DATAin. . . Digital data

ADDRin...輸入位址ADDRin. . . Input address

WR...資料寫入信號WR. . . Data write signal

xDatain...單一角度資料xDatain. . . Single angle data

Command、Command(7)、Command[1:0]、Command[3:2]、Command[6:4]...運作指令Command, Command(7), Command[1:0], Command[3:2], Command[6:4]. . . Operational instruction

xVW...資料選擇信號xVW. . . Data selection signal

xAngle...連續角度資料xAngle. . . Continuous angle data

Internal_sel...暫存值選擇信號Internal_sel. . . Temporary value selection signal

RD...資料讀出信號RD. . . Data readout signal

Int_reg...內部暫存值Int_reg. . . Internal temporary value

SCdata_out...資料輸出SCdata_out. . . Data output

Done_out...運算完成信號Done_out. . . Operation completion signal

Angle_discri(n)...運算控制信號Angle_discri(n). . . Operational control signal

S801~S805...步驟S801~S805. . . step

圖1A繪示為單一週期之正弦波函數的波形圖。FIG. 1A is a waveform diagram showing a sine wave function of a single period.

圖1B繪示為單一週期之餘弦波函數的波形圖。FIG. 1B is a waveform diagram of a cosine wave function of a single period.

圖2A為圖1A單一週期之正弦波函數F(t)對時間t的時序圖。2A is a timing diagram of the sine wave function F(t) of the single cycle of FIG. 1A versus time t.

圖2B為單一週期之數位正弦波函數F1(n)對數位角度輸入變數n的作圖。2B is a plot of a single-cycle digital sine wave function F1(n) versus a digital angle input variable n.

圖2C為另一單一週期之數位正弦波函數F2(m)對數位角度輸入變數m的作圖。2C is a plot of another single cycle digital sine wave function F2(m) versus a digital angle input variable m.

圖3繪示為依據本發明一實施例之數位波形產生器的電路方塊圖。3 is a circuit block diagram of a digital waveform generator in accordance with an embodiment of the present invention.

圖4繪示為單位圓上的三角函數。Figure 4 shows a trigonometric function on a unit circle.

圖5為圖3之函數值運算單元140的內部電路方塊圖。FIG. 5 is an internal circuit block diagram of the function value operation unit 140 of FIG.

圖6為本實施例之數位波形產生器之一週邊電路方塊圖。FIG. 6 is a block diagram of a peripheral circuit of one of the digital waveform generators of the embodiment.

圖7為本實施例之數位波形產生器之另一週邊電路方塊圖。FIG. 7 is a block diagram of another peripheral circuit of the digital waveform generator of the embodiment.

圖8繪示為依據本發明一實施例之產生數位波形的方法流程圖。FIG. 8 is a flow chart of a method for generating a digital waveform according to an embodiment of the invention.

100...數位波形產生器100. . . Digital waveform generator

110...頻率處理單元110. . . Frequency processing unit

120...相區鑑別單元120. . . Phase identification unit

130...相區轉換單元130. . . Phase conversion unit

140...函數值計算單元140. . . Function value calculation unit

150...極性轉換單元150. . . Polarity conversion unit

Freq_sel...頻率選擇信號Freq_sel. . . Frequency selection signal

IndexM...角度資料IndexM. . . Angle data

IndexN...基準角度資料IndexN. . . Reference angle data

DCout...直流信號DCout. . . DC signal

xdela...相區信號Xdela. . . Phase signal

xSin、xCos...波形指示信號xSin, xCos. . . Waveform indication signal

Ph_discri...相區鑑別信號Ph_discri. . . Phase zone discrimination signal

PhaseZ...相區角度資料PhaseZ. . . Phase angle data

xSC...指示信號xSC. . . Indication signal

Mag_PhZ...相位函數值Mag_PhZ. . . Phase function value

Mag_SC...波形輸出值Mag_SC. . . Waveform output value

Reset...重置信號Reset. . . Reset signal

CLK...時脈信號CLK. . . Clock signal

Claims (21)

一種數位波形產生器,包括:一頻率處理單元,以一原型數位波為基準,依據一頻率選擇信號而將一角度資料的數值限縮或是放大2^P倍,並據以產生一基準角度資料,P為整數且P≧0;一相區鑑別單元,依據該基準角度資料中的R個最高有效位元與S個波形指示信號來產生一相區鑑別信號,以指向該原型數位波所延伸出之(2^R)*S個相區中的一特定相區,R與S為正整數;一相區轉換單元,依據該相區鑑別信號從(2^R)*S個挪移關係式中選出對應該特定相區的挪移關係式,以將該基準角度資料的數值挪移至該原型數位波的第1個相區內,並據以產生一相區角度資料;一函數值計算單元,提供用以合成位在第1個相區內之該原型數位波的多個函數運算式,並將該相區角度資料帶入至該些函數運算式之其一,以計算出該相區角度資料所對應的一相位函數值;以及一極性轉換單元,依據該相區鑑別信號而決定輸出該相位函數值的相反數或是直接輸出該相位函數值作為一波形輸出值,並利用該波形輸出值產生頻率為該原型數位波之1/(2^M)倍或是2^M倍的一週期性數位波。 A digital waveform generator includes: a frequency processing unit that limits or enlarges the value of an angle data by 2^P times according to a frequency selection signal based on a prototype digital wave, and generates a reference angle accordingly Data, P is an integer and P≧0; a phase-area identification unit generates a phase-region discrimination signal according to the R most significant bits and the S waveform indication signals in the reference angle data to point to the prototype digital wave Extending out a specific phase region of (2^R)*S phase regions, R and S are positive integers; a phase-to-phase conversion unit discriminates signals from (2^R)*S according to the phase region discrimination signal Selecting a shift relationship corresponding to a specific phase region to shift the value of the reference angle data to the first phase region of the prototype digit wave, and thereby generating a phase region angle data; a function value calculation unit Providing a plurality of function expressions for synthesizing the prototype digit wave located in the first phase region, and bringing the phase region angle data to one of the function expressions to calculate the phase region a phase function value corresponding to the angle data; and a polarity The switching unit determines whether to output the opposite value of the phase function value according to the phase region discrimination signal or directly outputs the phase function value as a waveform output value, and uses the waveform output value to generate a frequency of 1/(the prototype digital wave) 2^M) times or 2^M times a periodic digital wave. 如申請專利範圍第1項所述之數位波形產生器,其中該頻率處理單元利用將該角度資料右移或是左移P位元的方式,致使該角度資料的數值限縮或是放大2^P倍。 The digital waveform generator of claim 1, wherein the frequency processing unit uses the angle data to be shifted right or left by P bits, so that the value of the angle data is limited or enlarged. P times. 如申請專利範圍第1項所述之數位波形產生器,其中該頻率處理單元更依據該頻率選擇信號輸出一直流信號,以驅動該數位波形產生器所外接的電路。 The digital waveform generator of claim 1, wherein the frequency processing unit further outputs a direct current signal according to the frequency selection signal to drive a circuit external to the digital waveform generator. 如申請專利範圍第1項所述之數位波形產生器,其中當該原型數位波的週期為2^N個取樣點,n用以表示該基準角度資料之數值,且N為正整數,K為正數時,則該原型數位波的函數式為: The digital waveform generator according to claim 1, wherein when the period of the prototype digital wave is 2^N sampling points, n is used to represent the value of the reference angle data, and N is a positive integer, K is In the case of a positive number, the function of the prototype digital wave is: 如申請專利範圍第4項所述之數位波形產生器,其中當R與S分別等於2時,該相區鑑別信號用以識別該原型數位波所延伸出之8個相區,且該原型數位波的第1至第4個相區用以合成一正弦數位波,該原型數位波的第5至第8個相區用以合成一餘弦數位波。 The digital waveform generator of claim 4, wherein when R and S are respectively equal to 2, the phase identification signal is used to identify 8 phase regions extended by the prototype digital wave, and the prototype digit The first to fourth phase regions of the wave are used to synthesize a sinusoidal digital wave, and the fifth to eighth phase regions of the prototype digital wave are used to synthesize a cosine digital wave. 如申請專利範圍第5項所述之數位波形產生器,其中當N等於8,K等於128,且z用以表示該相區角度資料之數值時,儲存在該相區轉換單元內的8個挪移關係式與8個相區相互對應,且8個挪移關係式分別如下所示:z=n,其中n=0~63;z=128-n,其中n=64~127;z=n-128,其中n=128~191;z=256-n,其中n=192~255;z=64-n,其中n=0~63;z=n-64,其中n=64~127;z=192-n,其中n=128~191;以及 z=n-192,其中n=192~255。 The digital waveform generator of claim 5, wherein when N is equal to 8, K is equal to 128, and z is used to represent the value of the phase angle data, 8 are stored in the phase conversion unit. The shift relationship corresponds to the eight phase regions, and the eight shift relations are as follows: z=n, where n=0~63; z=128-n, where n=64~127; z=n- 128, where n=128~191; z=256-n, where n=192~255; z=64-n, where n=0~63; z=n-64, where n=64~127; z= 192-n, where n=128~191; z=n-192, where n=192~255. 如申請專利範圍第6項所述之數位波形產生器,其中該函數值計算單元所提供的該些函數運算式分別如下所示:FMP (z)=2*z+z,其中z=0~3、20~23;FMP (z)=(2*z+1)+z,其中z=4~19;FMP (z)=2*z+24,其中z=24~27;FMP (z)=2*z+26,其中z=28~31、40~43;FMP (z)=2*z+27,其中z=32~39;FMP (z)=z+70,其中z=44~55;FMP (z)=126,其中z=56~59;以及FMP (z)=127,其中z=60~64。The digital waveform generator according to claim 6, wherein the function expressions provided by the function value calculation unit are respectively as follows: F MP (z)=2*z+z, wherein z=0 ~3, 20~23; F MP (z)=(2*z+1)+z, where z=4~19; F MP (z)=2*z+24, where z=24~27;F MP (z)=2*z+26, where z=28~31, 40~43; F MP (z)=2*z+27, where z=32~39; F MP (z)=z+70 , where z=44~55; F MP (z)=126, where z=56~59; and F MP (z)=127, where z=60~64. 如申請專利範圍第7項所述之數位波形產生器,其中該函數值計算單元包括:一運算控制單元,參照該些函數運算式對該相區角度資料的部份位元進行編碼,以產生一運算控制信號;一第一數值調整單元,倍增該相區角度資料之數值,以產生一第一調整資料;一第二數值調整單元,倍增該相區角度資料之數值並加1,以產生一第二調整資料;一第三數值調整單元,接收該相區角度資料,並據以輸出作為一第三調整資料;一第一多工單元,依據該運算控制信號從該第一調整資料、該第二調整資料、一第一常數資料以及一第二常數 資料中選擇其一,以產生一第一函數調整資料,其中該第一常數資料之數值為70,該第二常數資料之數值為100;一第二多工單元,依據該運算控制信號從該第三調整資料、一第三常數資料、一第四常數資料以及一第五常數資料中選擇其一,以產生一第二函數調整資料,其中該第三常數資料之數值為24,該第四常數資料之數值為26,該第五常數資料之數值為27;以及一加法單元,用以對該第一函數調整資料與該第二函數調整資料進行加法運算,以產生該相位函數值。 The digital waveform generator of claim 7, wherein the function value calculation unit comprises: an operation control unit that encodes a part of the bit data of the phase region with reference to the function expressions to generate An operation control signal; a first value adjustment unit multiplying the value of the phase angle data to generate a first adjustment data; and a second value adjustment unit multiplying the value of the phase angle data by 1 to generate a second adjustment data; a third value adjustment unit receives the phase region angle data, and outputs the data as a third adjustment data; a first multiplex unit, according to the operation control signal, the first adjustment data, The second adjustment data, a first constant data, and a second constant Selecting one of the data to generate a first function adjustment data, wherein the first constant data has a value of 70, and the second constant data has a value of 100; a second multiplex unit according to the operation control signal Selecting one of the third adjustment data, a third constant data, a fourth constant data, and a fifth constant data to generate a second function adjustment data, wherein the third constant data has a value of 24, the fourth The value of the constant data is 26, and the value of the fifth constant data is 27; and an adding unit for adding the first function adjustment data and the second function adjustment data to generate the phase function value. 如申請專利範圍第1項所述之數位波形產生器,更包括:一資料輸入單元,對一輸入位址進行解碼,以依據解碼後的該輸入位址將一數位資料視為一單一角度資料或是一運作指令;一連續角度產生單元,接收一資料選擇信號,以決定是否產生一連續角度資料;以及一資料選擇單元,依據該資料選擇信號讀取該單一角度資料或該連續角度資料,以產生該角度資料。 The digital waveform generator of claim 1, further comprising: a data input unit that decodes an input address to treat a digital data as a single angle data according to the decoded input address; Or a operation command; a continuous angle generating unit receiving a data selection signal to determine whether to generate a continuous angle data; and a data selection unit for reading the single angle data or the continuous angle data according to the data selection signal, To generate this angle data. 如申請專利範圍第9項所述之數位波形產生器,更包括:一狀態控制單元,依序對該運作指令的部份位元進行編碼,以產生該資料選擇信號、該些波形指示信號、該頻率選擇信號及一暫存值選擇信號;一暫存單元,用以儲存該相位函數值、該波形輸出 值、該基準角度資料以及該相區角度資料,並依據該暫存值選擇信號據以輸出一內部暫存值;以及一資料輸出單元,依據一資料讀出信號以及解碼後的該輸入位址,而決定是否暫存並輸出該內部暫存值。 The digital waveform generator of claim 9, further comprising: a state control unit, sequentially encoding a part of the bit of the operation instruction to generate the data selection signal, the waveform indication signals, The frequency selection signal and a temporary value selection signal; a temporary storage unit for storing the phase function value, the waveform output a value, the reference angle data, and the phase angle data, and according to the temporary value selection signal, an internal temporary storage value is output; and a data output unit, according to a data readout signal and the decoded input address And decide whether to temporarily store and output the internal temporary value. 如申請專利範圍第9項所述之數位波形產生器,更包括:一識別單元,依據該些波形指示信號、該資料選擇信號、該運作指令的部份位元、該基準角度資料中的R個最高有效位元、該輸入位址以及該相區鑑別信號,來決定是否產生一運算完成信號,以判別該週期性數位波的輸出是否已完成。 The digital waveform generator of claim 9, further comprising: an identification unit, according to the waveform indication signal, the data selection signal, a partial bit of the operation instruction, and R in the reference angle data The most significant bit, the input address, and the phase identification signal determine whether an operation completion signal is generated to determine whether the output of the periodic digital wave has been completed. 一種產生數位波形的方法,包括:以一原型數位波為基準,依據一頻率選擇信號而將一角度資料的數值限縮或是放大2^P倍,並據以產生一基準角度資料,P為整數且P≧0;依據該基準角度資料中的R個最高有效位元與S個波形指示信號來產生一相區鑑別信號,以指向該原型數位波所延伸出之(2^R)*S個相區中的一特定相區,R與S為正整數;依據該相區鑑別信號從(2^R)*S個挪移關係式中選出對應該特定相區的挪移關係式,以將該基準角度資料的數值挪移至該原型數位波的第1個相區內,並據以產生一相區角度資料;提供用以合成位在第1個相區內之該原型數位波的多 個函數運算式,並將該相區角度資料帶入至該些函數運算式之其一,以計算出該相區角度資料所對應的一相位函數值;以及依據該相區鑑別信號而決定提供該相位函數值的相反數或是直接提供該相位函數值以作為一波形輸出值,並利用該波形輸出值產生頻率為該原型數位波之1/(2^M)倍或是2^M倍的一週期性數位波。 A method for generating a digital waveform includes: limiting a value of an angle data by a frequency selection signal according to a prototype digital wave by 2^P times, and generating a reference angle data, P is An integer and P≧0; generating a phase region discrimination signal according to the R most significant bits in the reference angle data and the S waveform indication signals to point to (2^R)*S extended by the prototype digital wave a specific phase region in each phase region, R and S are positive integers; according to the phase region discrimination signal, a shift relationship corresponding to a specific phase region is selected from (2^R)*S shift relations to The value of the reference angle data is shifted to the first phase region of the prototype digital wave, and accordingly, a phase angle data is generated; and the prototype digital wave for synthesizing the position in the first phase region is provided. a function expression, and the phase region angle data is brought to one of the function expressions to calculate a phase function value corresponding to the phase region angle data; and the decision is provided according to the phase region discrimination signal The inverse of the phase function value directly provides the phase function value as a waveform output value, and uses the waveform output value to generate a frequency of 1/(2^M) times or 2^M times the prototype digital wave. A periodic digital wave. 如申請專利範圍第12項所述之產生數位波形的方法,其中將該角度資料的數值限縮或是放大2^P倍的步驟包括將該角度資料右移或是左移P位元。 The method for generating a digital waveform according to claim 12, wherein the step of limiting or enlarging the value of the angle data by 2^P times comprises shifting the angle data to the right or left to the P bit. 如申請專利範圍第12項所述之產生數位波形的方法,其中當該原型數位波的週期為2^N個取樣點,n用以表示該基準角度資料之數值,且N為正整數,K為正數時,則該原型數位波的函數式為: The method for generating a digital waveform according to claim 12, wherein when the period of the prototype digital wave is 2^N sampling points, n is used to represent the value of the reference angle data, and N is a positive integer, K When it is a positive number, the function of the prototype digit wave is: 如申請專利範圍第14項所述之產生數位波形的方法,其中當R與S分別等於2時,該相區鑑別信號用以識別該原型數位波所延伸出之8個相區,且該原型數位波的第1至第4個相區用以合成一正弦數位波,該原型數位波的第5至第8個相區用以合成一餘弦數位波。 The method for generating a digital waveform according to claim 14, wherein when R and S are respectively equal to 2, the phase identification signal is used to identify 8 phase regions extended by the prototype digital wave, and the prototype The first to fourth phase regions of the digital wave are used to synthesize a sinusoidal digital wave, and the fifth to eighth phase regions of the prototype digital wave are used to synthesize a cosine digital wave. 如申請專利範圍第15項所述之產生數位波形的方法,其中當N等於8,K等於128,且z用以表示該相區角度資料之數值時,對應8個相區的8個挪移關係式分別如下所示: z=n,其中n=0~63;z=128-n,其中n=64~127;z=n-128,其中n=128~191;z=256-n,其中n=192~255;z=64-n,其中n=0~63;z=n-64,其中n=64~127;z=192-n,其中n=128~191;以及z=n-192,其中n=192~255。 The method for generating a digital waveform according to claim 15, wherein when N is equal to 8, K is equal to 128, and z is used to represent the value of the phase angle data, 8 shifting relations corresponding to 8 phase regions are used. The formulas are as follows: z=n, where n=0~63; z=128-n, where n=64~127; z=n-128, where n=128~191; z=256-n, where n=192~255; z=64-n, where n=0~63; z=n-64, where n=64~127; z=192-n, where n=128~191; and z=n-192, where n=192 ~255. 如申請專利範圍第16項所述之產生數位波形的方法,其中該些函數運算式分別如下所示:FMP (z)=2*z+z,其中z=0~3、20~23;FMP (z)=(2*z+1)+z,其中z=4~19;FMP (z)=2*z+24,其中z=24~27;FMP (z)=2*z+26,其中z=28~31、40~43;FMP (z)=2*z+27,其中z=32~39;FMP (z)=z+70,其中z=44~55;FMP (z)=126,其中z=56~59;以及FMP (z)=127,其中z=60~64。The method for generating a digital waveform according to claim 16 of the patent application, wherein the function expressions are as follows: F MP (z)=2*z+z, wherein z=0~3, 20~23; F MP (z)=(2*z+1)+z, where z=4~19; F MP (z)=2*z+24, where z=24~27; F MP (z)=2* z+26, where z=28~31, 40~43; F MP (z)=2*z+27, where z=32~39; F MP (z)=z+70, where z=44~55 ; F MP (z) = 126, where z = 56 to 59; and F MP (z) = 127, where z = 60 to 64. 如申請專利範圍第17項所述之產生數位波形的方法,其中計算出該相區角度資料所對應的該相位函數值的步驟包括:參照該些函數運算式對該相區角度資料的部份位元進行編碼,以產生一運算控制信號;倍增該相區角度資料之數值,以產生一第一調整資 料;倍增該相區角度資料之數值並加1,以產生一第二調整資料;依據該相區角度資料,並據以傳送該相區角度資料以作為一第三調整資料;依據該運算控制信號從該第一調整資料、該第二調整資料、一第一常數資料以及一第二常數資料中選擇其一,以產生一第一函數調整資料,其中該第一常數資料之數值為70,該第二常數資料之數值為100;依據該運算控制信號從該第三調整資料、一第三常數資料、一第四常數資料以及一第五常數資料中選擇其一,以產生一第二函數調整資料,其中該第三常數資料之數值為24,該第四常數資料之數值為26,該第五常數資料之數值為27;以及對該第一函數調整資料與該第二函數調整資料進行加法運算,以產生該相位函數值。 The method for generating a digital waveform according to claim 17, wherein the step of calculating the phase function value corresponding to the phase angle data of the phase region comprises: referring to the function of the phase angle data of the phase region Bits are encoded to generate an operational control signal; multiplying the value of the phase region angle data to generate a first adjustment Multiplying the value of the angle data of the phase region and adding 1 to generate a second adjustment data; according to the phase region angle data, and transmitting the phase region angle data as a third adjustment data; The signal selects one of the first adjustment data, the second adjustment data, a first constant data, and a second constant data to generate a first function adjustment data, wherein the first constant data has a value of 70, The value of the second constant data is 100; selecting one of the third adjustment data, a third constant data, a fourth constant data, and a fifth constant data according to the operation control signal to generate a second function Adjusting the data, wherein the value of the third constant data is 24, the value of the fourth constant data is 26, the value of the fifth constant data is 27; and the first function adjustment data and the second function adjustment data are performed Addition to generate the phase function value. 如申請專利範圍第12項所述之產生數位波形的方法,更包括:對一輸入位址進行解碼,以依據解碼後的該輸入位址將一數位資料視為一單一角度資料或是一運作指令;依據一資料選擇信號而決定是否產生一連續角度資料;以及依據該資料選擇信號讀取該單一角度資料或該連續角度資料,以產生該角度資料。 The method for generating a digital waveform according to claim 12, further comprising: decoding an input address to treat a digital data as a single angle data or an operation according to the decoded input address; An instruction; determining whether to generate a continuous angle data according to a data selection signal; and reading the single angle data or the continuous angle data according to the data selection signal to generate the angle data. 如申請專利範圍第19項所述之產生數位波形的方法,更包括:依序對該運作指令的部份位元進行編碼,以產生該資料選擇信號、該些波形指示信號、該頻率選擇信號及一暫存值選擇信號;儲存該相位函數值、該波形輸出值、該基準角度資料以及該相區角度資料,並依據該暫存值選擇信號據以提供一內部暫存值;以及依據一資料讀出信號以及解碼後的該輸入位址,而決定是否暫存並傳送該內部暫存值。 The method for generating a digital waveform according to claim 19, further comprising: sequentially encoding a part of the bit of the operation instruction to generate the data selection signal, the waveform indication signal, and the frequency selection signal. And a temporary value selection signal; storing the phase function value, the waveform output value, the reference angle data, and the phase angle data, and selecting a signal according to the temporary value to provide an internal temporary storage value; The data read signal and the decoded input address determine whether to temporarily store and transmit the internal temporary value. 如申請專利範圍第19項所述之產生數位波形的方法,更包括:依據該些波形指示信號、該資料選擇信號、該運作指令的部份位元、該基準角度資料中的R個最高有效位元、該輸入位址以及該相區鑑別信號,來決定是否產生一運算完成信號,以判別該週期性數位波的產生是否已完成。 The method for generating a digital waveform according to claim 19, further comprising: determining, according to the waveform indication signal, the data selection signal, a part of the bit of the operation instruction, and the R most effective in the reference angle data. The bit, the input address, and the phase identification signal determine whether an operation completion signal is generated to determine whether the generation of the periodic digital wave has been completed.
TW98107364A 2009-03-06 2009-03-06 Digital wave generator and method of generating a digital wave TWI390848B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW98107364A TWI390848B (en) 2009-03-06 2009-03-06 Digital wave generator and method of generating a digital wave

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW98107364A TWI390848B (en) 2009-03-06 2009-03-06 Digital wave generator and method of generating a digital wave

Publications (2)

Publication Number Publication Date
TW201034387A TW201034387A (en) 2010-09-16
TWI390848B true TWI390848B (en) 2013-03-21

Family

ID=44855481

Family Applications (1)

Application Number Title Priority Date Filing Date
TW98107364A TWI390848B (en) 2009-03-06 2009-03-06 Digital wave generator and method of generating a digital wave

Country Status (1)

Country Link
TW (1) TWI390848B (en)

Also Published As

Publication number Publication date
TW201034387A (en) 2010-09-16

Similar Documents

Publication Publication Date Title
JP5396167B2 (en) Indicator detection apparatus and indicator detection method
JP2515741Y2 (en) Multiplier demodulator
TWI390848B (en) Digital wave generator and method of generating a digital wave
CN101299204B (en) Asynchronous FIFO and address conversion method thereof
JP4696920B2 (en) DDS signal generator
CN110296722B (en) Encoding method of magnetic encoder and magnetic encoder
JPH08191217A (en) Sine wave generating circuit
US5471505A (en) Method and apparatus for increasing the resolution of a digital to analog converted pulse width modulated signal
JPH08201110A (en) Interpolation apparatus
KR100969582B1 (en) Method for detecting the position of the Rotor
TWI420325B (en) Sine/cosine value generation apparatus
US7707235B2 (en) Free-running numerically-controlled oscillator using complex multiplication with compensation for amplitude variation due to cumulative round-off errors
SU1388855A1 (en) Sine-cosine converter
WO2023028967A1 (en) Absolute position measurement device
CN112268501B (en) Detection method applicable to linear displacement or corner position of object
CN104980127B (en) Signal generator with summation modulation function
US6009449A (en) Phase angle data-trigonometric function value converter circuit and composite diversity receiver
WO2023028966A1 (en) Single-code channel absolute position measurement apparatus
Lu et al. Implementation of sinusoids and pulse width modulation with chemical reactions
CN109217743B (en) Output voltage control system and method for absolute magnetic angle encoder
CN101771793B (en) Image reading method for linear image reading device
JP3452556B2 (en) Encoder signal processing apparatus and method
SU1012328A1 (en) Indicating device
CN113686365A (en) Absolute position measuring device
Jeffrey Essentials Engineering Mathematics

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees