TW202332201A - Analog sinusoidal wave signal generating device and method - Google Patents
Analog sinusoidal wave signal generating device and method Download PDFInfo
- Publication number
- TW202332201A TW202332201A TW111102991A TW111102991A TW202332201A TW 202332201 A TW202332201 A TW 202332201A TW 111102991 A TW111102991 A TW 111102991A TW 111102991 A TW111102991 A TW 111102991A TW 202332201 A TW202332201 A TW 202332201A
- Authority
- TW
- Taiwan
- Prior art keywords
- count value
- value
- digital
- wave signal
- sine wave
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 18
- 238000005070 sampling Methods 0.000 claims description 61
- 230000007274 generation of a signal involved in cell-cell signaling Effects 0.000 claims description 10
- 238000006243 chemical reaction Methods 0.000 claims description 8
- 101000685663 Homo sapiens Sodium/nucleoside cotransporter 1 Proteins 0.000 description 13
- 102100023116 Sodium/nucleoside cotransporter 1 Human genes 0.000 description 13
- 101000821827 Homo sapiens Sodium/nucleoside cotransporter 2 Proteins 0.000 description 12
- 102100021541 Sodium/nucleoside cotransporter 2 Human genes 0.000 description 12
- 238000010586 diagram Methods 0.000 description 6
- 238000004519 manufacturing process Methods 0.000 description 4
- 239000010453 quartz Substances 0.000 description 3
- VYPSYNLAJGMNEJ-UHFFFAOYSA-N silicon dioxide Inorganic materials O=[Si]=O VYPSYNLAJGMNEJ-UHFFFAOYSA-N 0.000 description 3
- 239000013078 crystal Substances 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/02—Digital function generators
- G06F1/03—Digital function generators working, at least partly, by table look-up
- G06F1/0321—Waveform generators, i.e. devices for generating periodical functions of time, e.g. direct digital synthesizers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2101/00—Indexing scheme relating to the type of digital function generated
- G06F2101/04—Trigonometric functions
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Analogue/Digital Conversion (AREA)
- Electrophonic Musical Instruments (AREA)
- Stabilization Of Oscillater, Synchronisation, Frequency Synthesizers (AREA)
Abstract
Description
本發明涉及一種類比弦波信號產生裝置與方法,且特別是一種利用類比弦波信號之對稱性質與奇函數性質來減少所需之暫存器數量的類比弦波信號產生裝置與方法。The present invention relates to an analog sine wave signal generation device and method, and in particular to an analog sine wave signal generation device and method which utilizes the symmetric and odd function properties of the analog sine wave signal to reduce the number of required registers.
現有的類比弦波信號產生裝置可以透過晶片震盪器或石英震盪器來實現。晶片震盪器需要設計反饋迴路,使其迴路增益為1,而石英震盪器則需要配置有石英晶體。另一種類比弦波信號產生裝置的實現方式是透過預先對類比弦波信號取樣,並將多個數位取樣值儲存在具有多個暫存器的數值暫存表中,然後透過數位類比轉換器將多個數位取樣值依照時間順序進行數位類比轉換,來產生類比弦波信號。Existing devices for generating analog sine wave signals can be realized through chip oscillators or quartz oscillators. Chip oscillators need to design a feedback loop so that the loop gain is 1, while quartz oscillators need to be configured with a quartz crystal. Another way to realize the analog sine wave signal generating device is to sample the analog sine wave signal in advance, and store multiple digital sampled values in a numerical temporary storage table with multiple temporary registers, and then pass through the digital to analog converter. Digital-to-analog conversion is performed on multiple digital sampling values according to time sequence to generate an analog sine wave signal.
請參照圖1,圖1是一種傳統類比弦波信號產生裝置的方塊圖。傳統類比弦波信號產生裝置1包括數位類比轉換器11與數值暫存表12,其中類比弦波信號在[-π/2, 3π/2)的相位區間中進行取樣之N個數位取樣值會被記錄在數值暫存表12,其中[-π/2, 3π/2)的相位區間是指相位是在大於等於-π/2與小於3π/2的區間。以圖1的實施例,N為32,因此[sin(-π/2+i*π/16)+1]/2的32個數位取樣值會被記錄在數值暫存表12,即需要使用32個12位元的暫存器來儲存。數位類比轉換器11會自數值暫存表12依序讀取N個數位取樣值並進行數位類比轉換,以藉此產生類比弦波信號。傳統類比弦波信號產生裝置1是將[-π/2, 3π/2)的相位區間之N個數位取樣值全部儲存在數值暫存表12,故導致整體電路的閘數(gate count)較多,增加了製造成本與電路面積。Please refer to FIG. 1 , which is a block diagram of a conventional analog sine wave signal generating device. The traditional analog sine wave signal generating device 1 includes a digital-to-analog converter 11 and a value temporary storage table 12, wherein the N digital sampling values of the analog sine wave signal sampled in the phase interval [-π/2, 3π/2) will be It is recorded in the value temporary storage table 12, where the phase interval of [-π/2, 3π/2) means that the phase is greater than or equal to -π/2 and less than 3π/2. With the embodiment of Fig. 1, N is 32, so [sin(-π/2+i*π/16)+1]/2 32 digital sampling values will be recorded in the value temporary storage table 12, that is, need to use 32 12-bit scratchpads to store. The digital-to-analog converter 11 sequentially reads N digital sampling values from the value temporary storage table 12 and performs digital-to-analog conversion to generate an analog sine wave signal. The traditional analog sine wave signal generating device 1 is to store all the N digital sampling values of the phase interval [-π/2, 3π/2) in the value temporary storage table 12, so the gate count (gate count) of the whole circuit is relatively small. Many, increase the manufacturing cost and circuit area.
本發明實施例提供一種類比弦波信號產生裝置,其用於產生類比弦波信號,且包括數值暫存表、第一計數器、第二計數器、邏輯電路以及數位類比轉換器,其中邏輯電路電性連接數值暫存表、第一計數器、第二計數器與數位類比轉換器。數值暫存表用於儲存類比弦波信號於[-π/2, 0)之相位區間進行取樣而獲取的N/4+1個數位取樣值,其中N為類比弦波信號於[-π/2, 3π/2)之相位區間進行取樣的取樣數量,以及N為4的倍數且大於等於8。第一計數器由0開始往上計數,以產生第一計數值,且在第一計數值計數至N時,第一計數值會被重置為0。第二計數器由N開始往下計數,以產生第二計數值,且在第二計數值計數至0時,第二計數值會被重置為N。邏輯電路用於接收第一計數值及第二計數值,根據第一計數值及第二計數值向數值暫存表獲取N/4+1個數位取樣值的一者或兩者,且根據獲取的N/4+1個數位取樣值的一者或兩者產生數位輸出值。數位類比轉換器用於接收邏輯電路輸出的數位輸出值,並對數位輸出值進行數位類比轉換,以產生類比弦波信號的一部份。An embodiment of the present invention provides an analog sine wave signal generating device, which is used to generate an analog sine wave signal, and includes a value temporary storage table, a first counter, a second counter, a logic circuit, and a digital-to-analog converter, wherein the logic circuit The digital temporary storage table, the first counter, the second counter and the digital-to-analog converter are connected permanently. The value temporary storage table is used to store the N/4+1 digital sampling values obtained by sampling the analog sine wave signal in the phase interval [-π/2, 0), where N is the analog sine wave signal in [-π/ 2, 3π/2) The number of samples for sampling in the phase interval, and N is a multiple of 4 and greater than or equal to 8. The first counter starts counting up from 0 to generate a first count value, and when the first count value reaches N, the first count value is reset to 0. The second counter counts down from N to generate a second count value, and when the second count value reaches 0, the second count value is reset to N. The logic circuit is used to receive the first count value and the second count value, obtain one or both of the N/4+1 digital sampling values from the value temporary storage table according to the first count value and the second count value, and obtain One or both of the N/4+1 digital sample values of N/4+1 generate a digital output value. The digital-to-analog converter is used to receive the digital output value output by the logic circuit, and perform digital-to-analog conversion on the digital output value to generate a part of the analog sine wave signal.
本發明實施例還提供一種類比弦波信號產生方法,其用於產生類比弦波信號,且包括以下步驟:透過第一計數器與第二計數器,分別提供由0開始往上計數的第一計數值與由N開始往下計數的第二計數值;透過邏輯電路,根據第一計數值及第二計數值向數值暫存表獲取其所儲存的N/4+1個數位取樣值的一者或兩者,其中N/4+1個數位取樣值是指類比弦波信號於[-π/2, 0)之相位區間進行取樣而獲取的N/4+1個數位取樣值,N為類比弦波信號於[-π/2, 3π/2)之相位區間進行取樣的取樣數量,以及N為4的倍數且大於等於8;透過邏輯電路,根據獲取的N/4+1個數位取樣值的一者或兩者產生數位輸出值;透過數位類比轉換器,對數位輸出值進行數位類比轉換,以產生類比弦波信號的一部份;透過第一計數器與第二計數器,分別遞增第一計數值與遞減第二計數值;以及透過邏輯電路,判斷第一計數值是否計數至N以及第二計數值是否計數至0,以藉此將第一計數值與第二計數值分別重置為0與N。An embodiment of the present invention also provides a method for generating an analog sine wave signal, which is used to generate an analog sine wave signal, and includes the following steps: through the first counter and the second counter, respectively provide the first counter counting up from 0 The value and the second count value counting down from N; through the logic circuit, according to the first count value and the second count value, obtain one of the stored N/4+1 digital sampling values from the value temporary storage table Or both, where N/4+1 digital sampling value refers to the N/4+1 digital sampling value obtained by sampling the analog sine wave signal in the phase interval [-π/2, 0), N is the analog Sine wave signal is sampled in the phase interval of [-π/2, 3π/2), and N is a multiple of 4 and greater than or equal to 8; through the logic circuit, according to the acquired N/4+1 digital sampling value One or both of them generate a digital output value; through a digital-to-analog converter, digital-to-analog conversion is performed on the digital output value to generate a part of the analog sine wave signal; through the first counter and the second counter, respectively increment the first counting the value and decrementing the second counting value; and judging whether the first counting value counts to N and whether the second counting value counts to 0 through a logic circuit, thereby resetting the first counting value and the second counting value to 0 and N.
綜上所述,本發明實施例提供的類比弦波信號產生裝置與方法可以讓本來應該要儲存的N個數位取樣值減少成只要儲存N/4+1個數位取樣值,故可以減少暫存器的數量,使得整體電路的閘數變少,並減少電路面積與製造成本。To sum up, the analog sine wave signal generation device and method provided by the embodiments of the present invention can reduce the N digital sampling values that should be stored to only store N/4+1 digital sampling values, so the temporary storage can be reduced The number of devices reduces the number of gates in the overall circuit, and reduces the circuit area and manufacturing cost.
為了進一步理解本發明的技術、手段和效果,可以參考以下詳細描述和附圖,從而可以徹底和具體地理解本發明的目的、特徵和概念。然而,以下詳細描述和附圖僅用於參考和說明本發明的實現方式,其並非用於限制本發明。In order to further understand the techniques, means and effects of the present invention, reference can be made to the following detailed description and accompanying drawings, so that the purpose, features and concepts of the present invention can be thoroughly and specifically understood. However, the following detailed description and drawings are only for reference and illustration of the implementation of the present invention, and are not intended to limit the present invention.
現在將詳細參考本發明的示範實施例,其示範實施例會在附圖中被繪示出。在可能的情況下,在附圖和說明書中使用相同的元件符號來指代相同或相似的部件。另外,示範實施例的做法僅是本發明之設計概念的實現方式之一,下述的該等示範皆非用於限定本發明。Reference will now be made in detail to the exemplary embodiments of the invention, which are illustrated in the accompanying drawings. Wherever possible, the same reference numbers will be used in the drawings and description to refer to the same or like parts. In addition, the practice of the exemplary embodiment is only one of the implementations of the design concept of the present invention, and the following demonstrations are not intended to limit the present invention.
本發明實施例提供了一種可以減少所需之暫存器數量的類比弦波信號產生裝置與方法,其主要利用類比弦波信號之對稱性質與奇函數性質讓本來應該要儲存的N個數位取樣值減少成只要儲存N/4+1個數位取樣值。配合上述要達到的目的,類比弦波信號產生裝置與方法使用了兩個計數器來計數,其中一者為往上計數,另一者則為往下計數,然後,根據此兩個計數器的計數值向數值暫存表獲取N/4+1個數位取樣值的一者或兩者來產生輸入到數位類比轉換器的數位輸出值,以讓數位類比轉換器藉此產生類比弦波信號的一部份。The embodiment of the present invention provides an analog sine wave signal generation device and method that can reduce the number of registers required, which mainly utilizes the symmetry and odd function properties of the analog sine wave signal to allow N digital samples that should be stored The value is reduced to only store N/4+1 digital sample values. In line with the above-mentioned purpose, the analog sine wave signal generation device and method use two counters to count, one of which counts up and the other counts down, and then, according to the count values of the two counters Obtain one or both of the N/4+1 digital sampling values from the value temporary storage table to generate a digital output value input to the digital-to-analog converter, so that the digital-to-analog converter can thereby generate a part of the analog sine wave signal share.
首先,請參照圖2,圖2是類比弦波信號及在其[-π/2, 3π/2)的相位區間中進行取樣之N個數位取樣值的關係示意圖。於此實施例中,N=32,數位取樣值Sine[n]是[sin(-π/2+n*π/16)+1]/2的數值,即定義Sine[n]= [sin(-π/2+n*π/16)+1]/2,其中n為0至N-1的整數。基於類比弦波信號之對稱性質,區間R2與R3以對稱中心線SYM(對應於數位取樣值Sine[16])對稱,以及區間R1與R33以對稱中心線SYM對稱,因此數位取樣值Sine[15]~Sine[1]分別相同於數位取樣值Sine[17]至Sine[31],換言之,數位取樣值Sine[17]~Sine[31]可以用儲存,也就是利用類比弦波信號之對稱性質,可以僅儲存數位取樣值Sine[0]~Sine[16]。根據上述的特性,不限定N為特定數值,但N必須是4的倍數且大於等於8(若N為4,此時取樣數量不足,難以產生類比弦波信號),可以推出Sine[j]=Sine[N-j]的關係式,其中j為N/2+1至N-1的整數。First, please refer to FIG. 2 . FIG. 2 is a schematic diagram of the relationship between an analog sine wave signal and N digital sampling values sampled in its phase interval [-π/2, 3π/2). In this embodiment, N=32, and the digital sample value Sine[n] is the value of [sin(-π/2+n*π/16)+1]/2, which defines Sine[n]=[sin( -π/2+n*π/16)+1]/2, wherein n is an integer from 0 to N-1. Based on the symmetrical nature of the analog sine wave signal, the intervals R2 and R3 are symmetrical about the symmetrical center line SYM (corresponding to the digital sampling value Sine[16]), and the intervals R1 and R33 are symmetrical about the symmetrical central line SYM, so the digital sampling value Sine[15] ]~Sine[1] are respectively the same as the digital sampling values Sine[17] to Sine[31]. In other words, the digital sampling values Sine[17]~Sine[31] can be stored by using , can only store digital sampling values Sine[0]~Sine[16]. According to the above characteristics, N is not limited to a specific value, but N must be a multiple of 4 and greater than or equal to 8 (if N is 4, the number of samples is insufficient at this time, and it is difficult to generate an analog sine wave signal), it can be deduced that Sine[j]= The relational expression of Sine[N-j], where j is an integer from N/2+1 to N-1.
基於類比弦波信號之奇函數性質,數位取樣值Sine[0]~Sine[16]具有之關係:Sine[8]-Sine[7]=Sine[9]-Sine[8]、Sine[8]-Sine[6]=Sine[10]-Sine[8]、Sine[8]-Sine[5]=Sine[11]-Sine[8]、Sine[8]-Sine[4]=Sine[12]-Sine[8]、Sine[8]-Sine[3]=Sine[13]-Sine[8]、Sine[8]-Sine[2]=Sine[14]-Sine[8]、Sine[8]-Sine[1]=Sine[15]-Sine[8]、Sine[8]-Sine[0]=Sine[16]-Sine[8]。換言之,只要儲存數位取樣值Sine[0]~Sine[8],便可以計算出Sine[9]~Sine[16]。根據上述的特性,不限定N為特定數值,但N必須是4的倍數且大於等於8,可以推出Sine[x]=2*Sine[N/4]-Sine[N/4-(x-N/4)]= 2*Sine[N/4]- Sine[N/2-x]的關係式,其中x為N/4+1至N/2的整數。較佳地,N大於等於16時,會有比較高的準確值。據此,透過類比弦波信號之對稱性質與奇函數性質,僅要儲存數位取樣值Sine[0]~Sine[N/4],即可以獲取數位取樣值Sine[0]~Sine[N-1]。Based on the odd function nature of the analog sine wave signal, the digital sampling values Sine[0]~Sine[16] have the relationship: Sine[8]-Sine[7]=Sine[9]-Sine[8], Sine[8] -Sine[6]=Sine[10]-Sine[8], Sine[8]-Sine[5]=Sine[11]-Sine[8], Sine[8]-Sine[4]=Sine[12] -Sine[8], Sine[8]-Sine[3]=Sine[13]-Sine[8], Sine[8]-Sine[2]=Sine[14]-Sine[8], Sine[8] -Sine[1]=Sine[15]-Sine[8], Sine[8]-Sine[0]=Sine[16]-Sine[8]. In other words, as long as the digital sampling values Sine[0]˜Sine[8] are stored, Sine[9]˜Sine[16] can be calculated. According to the above characteristics, N is not limited to a specific value, but N must be a multiple of 4 and greater than or equal to 8. It can be deduced that Sine[x]=2*Sine[N/4]-Sine[N/4-(x-N/4 )]= 2*Sine[N/4]- Sine[N/2-x], where x is an integer from N/4+1 to N/2. Preferably, when N is greater than or equal to 16, there will be a relatively high accuracy value. Accordingly, by analogy to the symmetric and odd function properties of the sine wave signal, the digital sampling values Sine[0]~Sine[N/4] can be obtained by storing the digital sampling values Sine[0]~Sine[N-1 ].
請參照圖3,圖3是本發明實施例的類比弦波信號產生裝置的方塊圖。類比弦波信號產生裝置3用於產生類比弦波信號,且包括數值暫存表32、計數器模塊35(其包括第一計數器351與第二計數器352)、邏輯電路33、數位類比轉換器31以及時序電路34,其中邏輯電路33電性連接數值暫存表32、第一計數器351、第二計數器352、數位類比轉換器31,以及時序電路34電性連接邏輯電路33、第一計數器351及第二計數器352。Please refer to FIG. 3 . FIG. 3 is a block diagram of an analog sine wave signal generating device according to an embodiment of the present invention. The analog sine wave signal generating device 3 is used to generate the analog sine wave signal, and includes a value temporary storage table 32, a counter module 35 (which includes a first counter 351 and a second counter 352), a logic circuit 33, a digital-to-analog converter 31 and The sequential circuit 34, wherein the logic circuit 33 is electrically connected to the value temporary storage table 32, the first counter 351, the second counter 352, the digital-to-analog converter 31, and the sequential circuit 34 is electrically connected to the logic circuit 33, the first counter 351 and the second Second counter 352.
根據前面所述,數值暫存表32可以僅儲存N/4+1個數位取樣值,也就是僅儲存類比弦波信號在[-π/2, 0)之相位區間進行取樣而獲取的N/4+1個數位取樣值,而不用儲存類比弦波信號在[-π/2, 3π/2)的相位區間中進行取樣之N個數位取樣值。數值暫存表32可以所儲存N/4+1個數位取樣值分別為Sine[0]、Sine[1]、…、Sine[N/4]。According to the foregoing, the value temporary storage table 32 can only store N/4+1 digital sampling values, that is, only store the N/ 4+1 digital sampling values instead of storing N digital sampling values of the analog sine wave signal sampled in the phase interval of [-π/2, 3π/2). The value temporary storage table 32 can store N/4+1 digital sampling values respectively as Sine[0], Sine[1], . . . , Sine[N/4].
時序電路34用於提供時脈信號給邏輯電路33、第一計數器351及第二計數器352,以使邏輯電路33、第一計數器351及第二計數器352可以基於時脈信號同步工作。在其他實施例中,時序電路34可以是非必要元件,而被移除。例如,使用外部的參考時脈,而不用設置時序電路34於類比弦波信號產生裝置3。The timing circuit 34 is used to provide a clock signal to the logic circuit 33 , the first counter 351 and the second counter 352 so that the logic circuit 33 , the first counter 351 and the second counter 352 can work synchronously based on the clock signal. In other embodiments, the timing circuit 34 may be removed as an unnecessary component. For example, an external reference clock is used instead of setting the timing circuit 34 in the analog sine wave signal generating device 3 .
第一計數器351與第二計數器352分別是由0往上計數與由N往下計數的計數器,且第一計數器351的第一計數值與第二計數器352的第二計數值可以被邏輯電路33重置為第一初始值與第二初始值,且第一初始值與第二初始分別為0與N。換言之,邏輯電路33會判斷第一計數值是否小於N以及第二計數值是否大於0,並在第一計數值大於等於N以及第二計數值小於等於0時,分別將第一計數值與第二計數值重置。The first counter 351 and the second counter 352 are counters that count up from 0 and count down from N respectively, and the first count value of the first counter 351 and the second count value of the second counter 352 can be determined by the logic circuit 33 Reset to the first initial value and the second initial value, and the first initial value and the second initial value are 0 and N respectively. In other words, the logic circuit 33 will judge whether the first count value is less than N and whether the second count value is greater than 0, and when the first count value is greater than or equal to N and the second count value is less than or equal to 0, respectively compare the first count value and the second count value The second count value is reset.
邏輯電路33會比較第一計數值與第二計數值的大小,即判斷第一計數值是否小於等於第二計數值,第一計數值小於等於第二計數值,則令其內部的第三計數值為第一計數值,否則,則令第三計數值為第二計數值。The logic circuit 33 will compare the size of the first count value and the second count value, that is, judge whether the first count value is less than or equal to the second count value, and if the first count value is less than or equal to the second count value, then make its internal third count value The numerical value is the first count value, otherwise, the third count value is set to the second count value.
接著,邏輯電路33判斷第三計數值是否小於等於N/4,如果第三計數值小於等於N/4,則向數值暫存表32獲取數位取樣值Sine[i]做為數位輸出值,其中i為第三計數值;如果第三計數值大於N/4,則向數值暫存表32獲取數位取樣值Sine[k]與Sine[N/4]來計算數位輸出值,其中數位輸出值為2*Sine[N/4]-Sine[k],且k=N/2-i。Next, the logic circuit 33 judges whether the third count value is less than or equal to N/4, and if the third count value is less than or equal to N/4, obtains the digital sampling value Sine[i] from the numerical temporary storage table 32 as a digital output value, wherein i is the third count value; if the third count value is greater than N/4, then obtain the digital sampling value Sine[k] and Sine[N/4] to the numerical temporary storage table 32 to calculate the digital output value, wherein the digital output value is 2*Sine[N/4]-Sine[k], and k=N/2-i.
數位類比轉換器31用於接收數位輸出值,並且對其進行數位類比轉換,以產生類比弦波信號的一部份。一個完整的類比弦波信號可以由N個數位輸出值來形成,換言之,數位類比轉換器31依序接收N個數位輸出值,並進行類比數位轉換後,可以產生一個[-π/2, 3π/2)之相位區間的類比弦波信號。The digital-to-analog converter 31 is used to receive the digital output value and perform digital-to-analog conversion on it to generate a part of the analog sine wave signal. A complete analog sine wave signal can be formed by N digital output values. In other words, the digital-to-analog converter 31 receives N digital output values in sequence and performs analog-to-digital conversion to generate a [-π/2, 3π /2) The analog sine wave signal of the phase interval.
於此實施例中,取樣數量N是以32為例,第一計數器351與第二計數器352是以6位元的計數器實現,以及數值暫存表32的9個暫存器的每一者都是以12位元的暫存器來實現,但本發明並不以此為限制。透過本發明的作法,可以有效地約減少3/4的閘數,故可以減少製造成本與電路面積等。In this embodiment, the number of samples N is 32 as an example, the first counter 351 and the second counter 352 are implemented with 6-bit counters, and each of the 9 temporary registers of the value temporary storage table 32 is It is implemented with a 12-bit register, but the present invention is not limited thereto. Through the practice of the present invention, the number of gates can be effectively reduced by about 3/4, so the manufacturing cost and circuit area can be reduced.
請同時參照圖3與圖4,圖4是本發明實施例的類比弦波信號產生方法的流程圖。首先,在步驟S41中,初始化第一計數值CNT1與第二計數值CNT2為0與N(即CNT1=0與CNT2=N),並接著透過第一計數器351與第二計數器352,分別提供由0開始往上計數的第一計數值CNT1與由N開始往下計數的第二計數值CNT2。Please refer to FIG. 3 and FIG. 4 at the same time. FIG. 4 is a flowchart of a method for generating an analog sine wave signal according to an embodiment of the present invention. First, in step S41, the first count value CNT1 and the second count value CNT2 are initialized to be 0 and N (that is, CNT1=0 and CNT2=N), and then through the first counter 351 and the second counter 352, respectively provided by The first count value CNT1 that counts up from 0 and the second count value CNT2 that counts down from N start.
在步驟S42中,透過邏輯電路33,判斷第一計數值CNT1是否小於等於第二計數值CNT2。當第一計數值CNT1小於等於第二計數值CNT2,則在步驟S43中,令邏輯電路33內部的第三計數值CNTVal為第一計數值CNT1(即CNTVal=CNT1),否則,則在步驟S44中,令第三計數值CNTVal為第二計數值CNT2(即CNTVal=CNT2)。In step S42 , through the logic circuit 33 , it is judged whether the first count value CNT1 is less than or equal to the second count value CNT2 . When the first count value CNT1 is less than or equal to the second count value CNT2, then in step S43, make the third count value CNTVal inside the logic circuit 33 be the first count value CNT1 (i.e. CNTVal=CNT1), otherwise, in step S44 , let the third count value CNTVal be the second count value CNT2 (ie CNTVal=CNT2).
在步驟S43與S44之後,步驟S45被執行,在步驟S45中,透過邏輯電路33,判斷第三計數值CNTVal是否小於等於N/4,若第三計數值CNTVal小於等於N/4,則執行步驟S46,否則,則執行步驟S47。在步驟S46中,透過邏輯電路33,令數位輸出值DACout等於數位取樣值Sne[CNTVal](即DACout= Sne[CNTVal])。在步驟S47中,透過邏輯電路33,令數位輸出值DACout等於兩倍的數位取樣值Sine[N/4]減去數位取樣值Sine[k]的結果(DACout= 2*Sine[N/4]-Sne[k]),其中k=N/2-CNTVal。After steps S43 and S44, step S45 is executed. In step S45, through the logic circuit 33, it is judged whether the third count value CNTVal is less than or equal to N/4, and if the third count value CNTVal is less than or equal to N/4, then execute step S46, otherwise, execute step S47. In step S46 , through the logic circuit 33 , the digital output value DACout is made equal to the digital sampling value Sne[CNTVal] (ie, DACout=Sne[CNTVal]). In step S47, through the logic circuit 33, the digital output value DACout is equal to twice the digital sampling value Sine[N/4] minus the result of the digital sampling value Sine[k] (DACout=2*Sine[N/4] -Sne[k]), where k=N/2-CNTVal.
在步驟S46與S47之後,第一計數器351與第二計數器352收到下一個時脈信號,並且分別遞增第一計數值CNT1與第二計數值CNT2,即CNT1=CNT1+1,CNT2=CNT2-1。之後,在步驟S49中,透過邏輯電路33,判斷第一計數值CNT1是否計數至N以及第二計數值CNT2是否計數至0。若第一計數值CNT1計數至N以及第二計數值CNT2計數至0,則執行步驟S41,透過邏輯電路33將第一計數器351的第一計數值CNT1與第二計數器352的第二計數值CNT2分別重置為0與N,否則,則接著執行步驟S42。After steps S46 and S47, the first counter 351 and the second counter 352 receive the next clock signal, and increment the first count value CNT1 and the second count value CNT2 respectively, that is, CNT1=CNT1+1, CNT2=CNT2- 1. Afterwards, in step S49 , through the logic circuit 33 , it is determined whether the first count value CNT1 counts to N and whether the second count value CNT2 counts to 0. If the first count value CNT1 counts to N and the second count value CNT2 counts to 0, step S41 is executed, and the first count value CNT1 of the first counter 351 and the second count value CNT2 of the second counter 352 are calculated through the logic circuit 33 Respectively reset to 0 and N, otherwise, proceed to step S42.
綜合以上所述,本發明實施例提供的類比弦波信號產生裝置與方法可以讓本來應該要儲存的N個數位取樣值減少成只要儲存N/4+1個數位取樣值,故可以減少暫存器的數量,使得整體電路的閘數變少,並減少電路面積與製造成本。Based on the above, the analog sine wave signal generation device and method provided by the embodiment of the present invention can reduce the N digital sampling values that should be stored to only store N/4+1 digital sampling values, so it can reduce temporary storage The number of devices reduces the number of gates in the overall circuit, and reduces the circuit area and manufacturing cost.
應當理解,本文描述的示例和實施例僅用於說明目的,並且鑑於其的各種修改或改變將被建議給本領域技術人員,並且將被包括在本申請的精神和範圍以及所附權利要求的範圍之內。It should be understood that the examples and embodiments described herein are for illustrative purposes only, and that various modifications or changes in view thereof will be suggested to those skilled in the art, and will be included within the spirit and scope of the application and the scope of the appended claims. within range.
1:傳統類比弦波信號產生裝置 11:數位類比轉換器 12:數值暫存表 3:類比弦波信號產生裝置 31:數位類比轉換器 32:數值暫存表 33:邏輯電路 34:時序電路 35:計數器模塊 351:第一計數器 352:第二計數器 S41~S49:步驟 R1~R4:區間 1: Traditional analog sine wave signal generator 11: Digital to analog converter 12: Value temporary storage table 3: Analog sine wave signal generator 31: Digital to analog converter 32: Value temporary storage table 33: Logic circuit 34: Sequential circuit 35: Counter module 351: first counter 352: second counter S41~S49: steps R1~R4: Interval
提供的附圖用以使本發明所屬技術領域具有通常知識者可以進一步理解本發明,並且被併入與構成本發明之說明書的一部分。附圖示出了本發明的示範實施例,並且用以與本發明之說明書一起用於解釋本發明的原理。The accompanying drawings are provided to enable those skilled in the art to which the present invention pertains to further understand the present invention, and are incorporated in and constitute a part of the specification of the present invention. The drawings illustrate exemplary embodiments of the invention and together with the description serve to explain principles of the invention.
圖1是一種傳統類比弦波信號產生裝置的方塊圖。Fig. 1 is a block diagram of a traditional analog sine wave signal generating device.
圖2是類比弦波信號及在其[-π/2, 3π/2)的相位區間中進行取樣之N個數位取樣值的關係示意圖。FIG. 2 is a schematic diagram of the relationship between an analog sine wave signal and N digital sampling values sampled in its phase interval [-π/2, 3π/2).
圖3是本發明實施例的類比弦波信號產生裝置的方塊圖。FIG. 3 is a block diagram of an analog sine wave signal generating device according to an embodiment of the present invention.
圖4是本發明實施例的類比弦波信號產生方法的流程圖。FIG. 4 is a flowchart of a method for generating an analog sine wave signal according to an embodiment of the present invention.
3:類比弦波信號產生裝置 3: Analog sine wave signal generator
31:數位類比轉換器 31: Digital to analog converter
32:數值暫存表 32: Value temporary storage table
33:邏輯電路 33: Logic circuit
34:時序電路 34: Sequential circuit
35:計數器模塊 35: Counter module
351:第一計數器 351: first counter
352:第二計數器 352: second counter
Claims (10)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW111102991A TWI789220B (en) | 2022-01-24 | 2022-01-24 | Analog sinusoidal wave signal generating device and method |
CN202210298982.1A CN116520939A (en) | 2022-01-24 | 2022-03-25 | Analog sine wave signal generating device and method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW111102991A TWI789220B (en) | 2022-01-24 | 2022-01-24 | Analog sinusoidal wave signal generating device and method |
Publications (2)
Publication Number | Publication Date |
---|---|
TWI789220B TWI789220B (en) | 2023-01-01 |
TW202332201A true TW202332201A (en) | 2023-08-01 |
Family
ID=86670019
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW111102991A TWI789220B (en) | 2022-01-24 | 2022-01-24 | Analog sinusoidal wave signal generating device and method |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN116520939A (en) |
TW (1) | TWI789220B (en) |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW331054B (en) * | 1996-10-08 | 1998-05-01 | Holtek Microelectronics Inc | The method and apparatus for generating non-singular periodical cyclic wave |
TW345656B (en) * | 1997-10-16 | 1998-11-21 | Holtek Microelectronics Inc | Waveform signal generation method |
JP2012078782A (en) * | 2010-09-09 | 2012-04-19 | Ricoh Co Ltd | High voltage power supply device, image forming apparatus, and color image forming apparatus |
KR20150070791A (en) * | 2013-12-17 | 2015-06-25 | 삼성전기주식회사 | Apparatus and method for generating sinusodial wave, and piezo actuator driving system using the same |
-
2022
- 2022-01-24 TW TW111102991A patent/TWI789220B/en active
- 2022-03-25 CN CN202210298982.1A patent/CN116520939A/en active Pending
Also Published As
Publication number | Publication date |
---|---|
CN116520939A (en) | 2023-08-01 |
TWI789220B (en) | 2023-01-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI343714B (en) | Time-to-digital converter and method thereof | |
CN109143832B (en) | High-precision multichannel time-to-digital converter | |
TWI380588B (en) | Flip flops and pipelined analog to digital converter | |
TWI789220B (en) | Analog sinusoidal wave signal generating device and method | |
CN108540109A (en) | Physical fingerprint generative circuit based on ring oscillator and method | |
CN101127529B (en) | Digital/analog converter and phase locking loop built-in self test circuit and its measurement method | |
TWI239386B (en) | Apparatus and method for digital fractional phase detection and related quantizer | |
CN113098482A (en) | Delay difference measuring method of vernier type annular time-to-digital converter | |
Wu et al. | High-precision time interval measurement method based on sliding scaled time-to-digital conversion circuit | |
CN105991138B (en) | Asynchronous successive approximation modulus conversion circuit | |
CN212969610U (en) | Two-step high-resolution time-to-digital converter circuit | |
JPH05191238A (en) | Pwm circuit | |
JPH04195899A (en) | Semiconductor device | |
Tutuani et al. | High Resolution Linear Time to Digital Converter Using Pulse Shrinking Rings | |
TW579481B (en) | Improved skew pointer generation | |
TW201213824A (en) | Test system for measuring a measured device | |
CN114112077B (en) | SAR logic circuit applied to temperature sensor | |
CN110471094B (en) | Time comparison system and comparison method for digital real-time processing | |
JP2734861B2 (en) | DTMF circuit | |
Vujicic et al. | Inherently digital stochastic analog AC to DC transfer | |
KR930004262B1 (en) | Analog signal generator | |
JPS5961311A (en) | Digital signal train generator | |
張哲銘 | Effect of the Delay Elements Variation on Time-to-Digital Converter Linearity | |
JPS59191962A (en) | Memory test circuit | |
JP2022522549A (en) | Shift register and its drive method, gate drive circuit and display device |