CN101409543B - Multilevel Pulse Width Modulation Method - Google Patents
Multilevel Pulse Width Modulation Method Download PDFInfo
- Publication number
- CN101409543B CN101409543B CN2007101631468A CN200710163146A CN101409543B CN 101409543 B CN101409543 B CN 101409543B CN 2007101631468 A CN2007101631468 A CN 2007101631468A CN 200710163146 A CN200710163146 A CN 200710163146A CN 101409543 B CN101409543 B CN 101409543B
- Authority
- CN
- China
- Prior art keywords
- pulse width
- width modulation
- value
- count value
- pulse
- Prior art date
- Legal status (The legal status 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 status listed.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 67
- 230000000630 rising effect Effects 0.000 claims abstract description 24
- 230000008859 change Effects 0.000 claims abstract description 18
- 238000005070 sampling Methods 0.000 claims abstract description 6
- 230000003247 decreasing effect Effects 0.000 claims description 2
- 238000010586 diagram Methods 0.000 description 12
- 238000005516 engineering process Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 6
- 230000000694 effects Effects 0.000 description 5
- 230000007547 defect Effects 0.000 description 4
- 238000013461 design Methods 0.000 description 4
- 230000007423 decrease Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 230000033228 biological regulation Effects 0.000 description 1
- 238000007429 general method Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000012827 research and development Methods 0.000 description 1
Images
Landscapes
- Analogue/Digital Conversion (AREA)
- Amplifiers (AREA)
Abstract
Description
技术领域technical field
本发明涉及一种脉冲宽度调制方法,特别是涉及一种具有倾斜状边缘的脉冲波,可以有效的降低瞬间能量变化程度的多电平脉冲宽度调制方法(Multi-Level Pulse Width Modulation Method)。The present invention relates to a pulse width modulation method, in particular to a multi-level pulse width modulation method (Multi-Level Pulse Width Modulation Method) which has a pulse wave with inclined edges and can effectively reduce the degree of instantaneous energy change.
背景技术Background technique
脉冲宽度调制(Pulse Width Modulation,PWM,以下均简称为PWM)利用不同的工作周期来表示各种信号(信号即讯号,本文均称为信号)。请参阅图1所示,为现有习知技术中所使用的一种PWM(脉冲宽度调制)信号的波形图。在此种技术中,PWM信号的波形是由宽度相异的方波所组成,较宽的方波代表的是较高的能量,而较窄的方波则代表较少的能量。藉由使用此类PWM信号来推动喇叭,就可以从喇叭产生类比的声音输出。这种驱动方式已被许多声音输出装置所采用。Pulse Width Modulation (PWM, hereinafter referred to as PWM) uses different duty cycles to represent various signals (signals are signals, which are referred to as signals in this article). Please refer to FIG. 1 , which is a waveform diagram of a PWM (Pulse Width Modulation) signal used in the prior art. In this technique, the waveform of the PWM signal is composed of square waves with different widths. A wider square wave represents higher energy, while a narrower square wave represents less energy. By using such a PWM signal to drive the speaker, an analog sound output can be generated from the speaker. This driving method has been adopted by many sound output devices.
由于受到工作频率的限制,所以一般的PWM信号必须在采样频率与解析度之间取得平衡,并无法十分精确的表达出原本信号的内容。这个状况会造成输出的类比信号产生失真。为了解决这个问题,许多人提出各种在同样工作频率下增加解析度或采样频率的方式。举例来说,中国台湾第453045号,名为“多电平脉冲宽度的调制装置及其控制结构”的专利,就提出了一种在维持取样率的前提下得以提高解析度的技术。Due to the limitation of the working frequency, the general PWM signal must strike a balance between sampling frequency and resolution, and cannot express the content of the original signal very accurately. This condition will cause distortion of the output analog signal. In order to solve this problem, many people have proposed various ways to increase resolution or sampling frequency at the same operating frequency. For example, Taiwan Patent No. 453045, titled "Multi-Level Pulse Width Modulation Device and Its Control Structure", proposes a technique for improving the resolution while maintaining the sampling rate.
另外,请参阅图2所示,为现有习知技术所采用的另一种PWM信号的波形图。在这种技术中,除了宽度之外,还合并使用了PWM信号中各方波的振幅来表示其代表的能量的大小。In addition, please refer to FIG. 2 , which is a waveform diagram of another PWM signal used in the prior art. In this technique, in addition to the width, the amplitude of each square wave in the PWM signal is also used to represent the magnitude of the energy it represents.
然而,无论是一般的PWM技术或是后来经过改良而成的技术,都是采用方波为基准波形。换言之,在各方波上升缘的部分都是一个巨大的瞬间能量增强。假若使用这样的PWM信号去推动前述的喇叭,那么这种瞬间的能量增强就很有可能造成声音上的突然变化,也就是一般所称的爆音。However, whether it is a general PWM technology or a technology that has been improved later, a square wave is used as a reference waveform. In other words, there is a huge momentary energy boost at the rising edge of each wave. If such a PWM signal is used to drive the aforementioned speaker, then this instantaneous energy increase is likely to cause a sudden change in sound, which is commonly known as a pop.
所以,目前使用的PWM技术所产生出来的信号仍有其缺陷存在,而如何改良这些信号也就成了一个重要的课题。Therefore, the signals generated by the currently used PWM technology still have their defects, and how to improve these signals has become an important issue.
由此可见,上述现有的脉冲宽度调制方法在方法与使用上,显然仍存在有不便与缺陷,而亟待加以进一步改进。为解决上述存在的问题,相关厂商莫不费尽心思来谋求解决之道,但长久以来一直未见适用的设计被发展完成,而一般方法又没有适切的方法能够解决上述问题,此显然是相关业者急欲解决的问题。因此如何能创设一种新的多电平脉冲宽度调制方法,实属当前重要研发课题之一,亦成为当前业界极需改进的目标。It can be seen that the above-mentioned existing pulse width modulation method obviously still has inconvenience and defects in method and use, and needs to be further improved urgently. In order to solve the above-mentioned problems, the relevant manufacturers have tried their best to find a solution, but no suitable design has been developed for a long time, and the general method has no suitable method to solve the above-mentioned problems. This is obviously related The problem that the industry is eager to solve. Therefore, how to create a new multi-level pulse width modulation method is one of the current important research and development topics, and it has also become a goal that the industry needs to improve.
有鉴于上述现有的脉冲宽度调制方法存在的缺陷,本发明人基于从事此类产品设计制造多年丰富的实务经验及专业知识,并配合学理的运用,积极加以研究创新,以期创设一种新的多电平脉冲宽度调制方法,能够改进一般现有的脉冲宽度调制方法,使其更具有实用性。经过不断的研究、设计,并经反复试作及改进后,终于创设出确具实用价值的本发明。In view of the defects in the above-mentioned existing pulse width modulation method, the inventor actively researches and innovates based on years of rich practical experience and professional knowledge engaged in the design and manufacture of such products, and cooperates with the application of academic theory, in order to create a new The multi-level pulse width modulation method can improve the general existing pulse width modulation method and make it more practical. Through continuous research, design, and after repeated trials and improvements, the present invention with practical value is finally created.
发明内容Contents of the invention
本发明的目的在于,克服现有的脉冲宽度调制方法存在的缺陷,而提供一种新的多电平脉冲宽度调制方法,所要解决的技术问题是使其可以降低瞬间能量变化的程度,非常适于实用。The purpose of the present invention is to overcome the defects of the existing pulse width modulation method and provide a new multi-level pulse width modulation method. The technical problem to be solved is to reduce the degree of instantaneous energy change, which is very suitable for practical.
本发明的目的及解决其技术问题是采用以下技术方案来实现的。依据本发明提出的一种多电平脉冲宽度调制方法,用来对一输入信号进行取样以产生相对应的一脉冲宽度调制信号,该脉冲宽度调制信号包括至少一个调制脉冲,该多电平脉冲宽度调制方法的特征在于:在该调制脉冲中以多阶方式逐步提升能量,使该调制脉冲的上升缘大致上呈现为倾斜状,以降低瞬间能量变化。The purpose of the present invention and the solution to its technical problems are achieved by adopting the following technical solutions. A multi-level pulse width modulation method proposed according to the present invention is used to sample an input signal to generate a corresponding pulse width modulation signal, the pulse width modulation signal includes at least one modulation pulse, and the multi-level pulse The characteristic of the width modulation method is that: in the modulation pulse, the energy is gradually increased in a multi-stage manner, so that the rising edge of the modulation pulse is generally inclined, so as to reduce the instantaneous energy change.
本发明的目的及解决其技术问题还可采用以下技术措施进一步实现。The purpose of the present invention and its technical problems can also be further realized by adopting the following technical measures.
前述的多电平脉冲宽度调制方法,其中所述的调制脉冲的工作周期横跨多个单位时间,且在相邻的两个单位时间之内最多只增加一个单位能量。In the aforementioned multi-level pulse width modulation method, wherein the duty cycle of the modulated pulse spans multiple unit times, and within two adjacent unit times only increases by one unit energy at most.
前述的多电平脉冲宽度调制方法,其包括下列步骤:从零开始逐步增加一脉冲宽度调制计数值,以产生多个不同的该脉冲宽度调制计数值,且该脉冲宽度调制计数值为整数;以及在该脉冲宽度调制计数值到达该调制脉冲所能横跨的最大的单位时间数量以前,对于每一个该脉冲宽度调制计数值,决定一脉冲宽度调制输出值,其中:当该脉冲宽度调制计数值不小于0且小于一第一预设值的时候,使所决定的该脉冲宽度调制输出值比前一次所决定的该脉冲宽度调制输出值最多只多出一个单位能量。The aforementioned multi-level pulse width modulation method includes the following steps: gradually increasing a pulse width modulation count value from zero to generate a plurality of different pulse width modulation count values, and the pulse width modulation count value is an integer; and before the pulse width modulation count value reaches the maximum amount of unit time that the modulation pulse can span, for each of the pulse width modulation count values, determining a pulse width modulation output value, wherein: when the pulse width modulation count value When the value is not less than 0 and less than a first preset value, the determined PWM output value is at most one unit energy more than the previously determined PWM output value.
前述的多电平脉冲宽度调制方法,其中所述的使所决定的该脉冲宽度调制输出值比前一次所决定的该脉冲宽度调制输出值最多只多出一个单位能量的步骤,其包括:利用一基准计数值指示该调制脉冲中相对应的一个单位时间:初始化该基准计数值为零;设定一增量计数值为该调制脉冲中的上升缘的单位时间内所要表示的一最大能量值;以及逐步增加该基准计数值至该第一预设值且逐步减少该增量计数值至零,并在该基准计数值到达该第一预设值且该增量计数值到达零之前,使该脉冲宽度调制输出值为该基准计数值加1。In the aforementioned multi-level pulse width modulation method, the step of making the determined output value of the pulse width modulation more than the previous determined output value of the pulse width modulation by at most one unit of energy includes: using A base count value indicates a corresponding unit time in the modulation pulse: initialize the base count value to zero; set an increment count value to represent a maximum energy value per unit time of the rising edge in the modulation pulse and gradually increasing the base count value to the first preset value and gradually decreasing the increment count value to zero, and before the base count value reaches the first preset value and the increment count value reaches zero, causing The PWM output value is one plus one to the reference count value.
前述的多电平脉冲宽度调制方法,其中所述的第一预设值为2n-1,n为表示振幅解析度的位元数。In the aforementioned multi-level pulse width modulation method, the first preset value is 2n-1, where n is the number of bits representing the amplitude resolution.
前述的多电平脉冲宽度调制方法,其中在决定该脉冲宽度调制输出值的时候更包括:当该脉冲宽度调制计数值不小于该第一预设值且不大于该工作周期减去该第一预设值时,使该脉冲宽度调制输出值为最大振幅。The aforementioned multi-level pulse width modulation method further includes when determining the pulse width modulation output value: when the pulse width modulation count value is not less than the first preset value and is not greater than the duty cycle minus the first When the preset value is used, the pulse width modulation output value is the maximum amplitude.
前述的多电平脉冲宽度调制方法,其中在决定该脉冲宽度调制输出值的时候更包括:当该脉冲宽度调制计数值大于该工作周期减去该第一预设值,且不小于该工作周期的时候,使所决定的该脉冲宽度调制输出值比前一次所决定的该脉冲宽度调制输出值最多只减少一个单位能量。The aforementioned multi-level pulse width modulation method, wherein when determining the pulse width modulation output value further includes: when the pulse width modulation count value is greater than the duty cycle minus the first preset value, and not less than the duty cycle , the determined output value of the pulse width modulation is reduced by at most one energy unit from the output value of the pulse width modulation determined last time.
前述的多电平脉冲宽度调制方法,其更包括:在该调制脉冲中以多阶方式逐步降低能量,使该调制脉冲的下降缘大致上呈现为倾斜状以降低瞬间能量变化。The aforementioned multi-level pulse width modulation method further includes: gradually reducing the energy in the modulated pulse in a multi-stage manner, so that the falling edge of the modulated pulse is generally inclined to reduce the instantaneous energy change.
前述的多电平脉冲宽度调制方法,其更包括:利用一基准计数值指示该调制脉冲中相对应的一个单位时间:初始化该基准计数值为零;设定一增量计数值为该调制脉冲中的上升缘的单位时间内所要表示的一最大能量值;以及逐步增加该基准计数值至一第二预设值且逐步减少该增量计数值至零,并在该基准计数值到达该第二预设值且该增量计数值到达零之前,使该调制脉冲中由该基准计数值所对应的单位时间所输出的能量单位为该基准计数值加1。The aforementioned multi-level pulse width modulation method further includes: using a reference count value to indicate a corresponding unit time in the modulation pulse: initializing the reference count value to zero; setting an increment count value to the modulation pulse A maximum energy value to be represented per unit time of the rising edge in the middle; and gradually increase the base count value to a second preset value and gradually decrease the increment count value to zero, and when the base count value reaches the first before the incremental count value reaches zero, the unit of energy output per unit time corresponding to the reference count value in the modulated pulse is the base count value plus 1.
前述的多电平脉冲宽度调制方法,其中所述的第二预设值为2n-1,n为表示振幅解析度的位元数。In the aforementioned multi-level pulse width modulation method, the second preset value is 2n-1, where n is the number of bits representing the amplitude resolution.
本发明与现有技术相比具有明显的优点和有益效果。由以上可知,为达到上述目的,本发明提出一种多电平脉冲宽度调制方法,其用来对输入信号进行取样以产生相对应的脉冲宽度调制信号,其中,该脉冲宽度调制信号包括至少一个调制脉冲。该多电平脉冲宽度调制方法的特征在于以多阶方式逐步提升能量,使该调制脉冲的边缘大致上呈现为倾斜状以降低瞬间能量变化。Compared with the prior art, the present invention has obvious advantages and beneficial effects. As can be seen from the above, in order to achieve the above object, the present invention proposes a multi-level pulse width modulation method, which is used to sample an input signal to generate a corresponding pulse width modulation signal, wherein the pulse width modulation signal includes at least one modulation pulse. The feature of the multi-level pulse width modulation method is that the energy is gradually increased in a multi-stage manner, so that the edge of the modulated pulse is generally inclined to reduce the instantaneous energy change.
在本发明的一个实施例中,首先是从零开始逐步增加脉冲宽度调制计数值以产生多个不同的脉冲宽度调制计数值。在该脉冲宽度调制计数值到达调制脉冲的工作周期以前,对于每一个脉冲宽度调制计数值决定相对应的一个脉冲宽度调制输出值,其中当脉冲宽度调制计数值不小于0且小于一第一预设值的时候,使所决定的脉冲宽度调制输出值比前一次所决定的脉冲宽度调制输出值最多只多出一个单位能量。In one embodiment of the present invention, firstly, the PWM count value is gradually increased from zero to generate a plurality of different PWM count values. Before the pulse width modulation count value reaches the duty cycle of the modulation pulse, a corresponding pulse width modulation output value is determined for each pulse width modulation count value, wherein when the pulse width modulation count value is not less than 0 and less than a first preset When setting the value, the determined output value of the pulse width modulation is at most one unit energy more than the output value of the previously determined pulse width modulation.
在本发明的一个实施例中,在决定脉冲宽度调制输出值的时候更在脉冲宽度调制计数值不小于前述的第一预设值,且不大于前述工作周期减去该第一预设值时,使脉冲宽度调制输出值为最大振幅。In one embodiment of the present invention, when determining the pulse width modulation output value, the pulse width modulation count value is not less than the aforementioned first preset value and is not greater than the aforementioned duty cycle minus the first preset value , so that the pulse width modulation output value is the maximum amplitude.
在本发明的一个实施例中,在决定脉冲宽度调制输出值的时候更在脉冲宽度调制计数值大于前述工作周期减去第一预设值,且不小于该工作周期的时候,使所决定的脉冲宽度调制输出值比前一次所决定的脉冲宽度调制输出值最多只减少一个单位能量。In one embodiment of the present invention, when determining the pulse width modulation output value, when the pulse width modulation count value is greater than the aforementioned duty cycle minus the first preset value and not less than the duty cycle, the determined The pulse width modulation output value is reduced by at most one energy unit from the previous determined pulse width modulation output value.
借由上述技术方案,本发明多电平脉冲宽度调制方法至少具有下列优点及有益效果:本发明因为使脉冲宽度调制信号的组成波形有较为和缓的变化,所以在瞬间能量变化上就比现有习知技术来得缓和。若使用此种改良的脉冲宽度调制信号来推动喇叭,那么杂讯产生的状况将能够得到大幅度的改善。By means of the above-mentioned technical solution, the multi-level pulse width modulation method of the present invention has at least the following advantages and beneficial effects: the present invention makes the composition waveform of the pulse width modulation signal have a relatively gentle change, so the instantaneous energy change is faster than the existing Known technology comes with ease. If this improved pulse width modulation signal is used to drive the speaker, then the situation of noise generation will be greatly improved.
综上所述,本发明多电平脉冲宽度调制方法,可以有效的降低瞬间能量变化的程度。本发明减缓PWM波形中上升缘的上升速度,藉此能够减少能量的变化程度而增进后续类比输出的流畅度,降低因强烈能量变化所产生的电磁干扰。本发明具有上述诸多优点及实用价值,其不论在方法或功能上皆有较大的改进,在技术上有显著的进步,并产生了好用及实用的效果,且较现有的脉冲宽度调制方法具有增进的突出功效,从而更加适于实用,诚为一新颖、进步、实用的新设计。To sum up, the multi-level pulse width modulation method of the present invention can effectively reduce the degree of instantaneous energy change. The present invention slows down the rising speed of the rising edge in the PWM waveform, thereby reducing the degree of energy change, improving the smoothness of subsequent analog output, and reducing electromagnetic interference caused by strong energy changes. The present invention has the above-mentioned many advantages and practical value, and it has great improvement no matter in method or function, has significant progress in technology, and has produced easy-to-use and practical effects, and compared with the existing pulse width modulation The method has the outstanding effect of promotion, thereby is more suitable for practical use, and is a novel, progressive and practical new design.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其他目的、特征和优点能够更明显易懂,以下特举较佳实施例,并配合附图,详细说明如下。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the following preferred embodiments are specifically cited below, and are described in detail as follows in conjunction with the accompanying drawings.
附图说明Description of drawings
图1为现有习知技术所使用的一种PWM信号的波形图。FIG. 1 is a waveform diagram of a PWM signal used in the prior art.
图2为现有习知技术所采用的另一种PWM信号的波形图。FIG. 2 is a waveform diagram of another PWM signal used in the prior art.
图3为根据本发明一实施例所产生的脉冲宽度调制信号的波形图。FIG. 3 is a waveform diagram of a PWM signal generated according to an embodiment of the invention.
图4为根据本发明一实施例而产生PWM信号的方法的流程图。FIG. 4 is a flowchart of a method for generating a PWM signal according to an embodiment of the invention.
图5为根据本发明一实施例所产生的PWM信号中的一个调制脉冲图。FIG. 5 is a diagram of a modulated pulse in a PWM signal generated according to an embodiment of the present invention.
图6为根据本发明一实施例在产生上升缘时所使用的方法的流程图。FIG. 6 is a flowchart of a method used in generating a rising edge according to an embodiment of the invention.
图7为根据本发明一实施例的产生缓上升缘时所用的电路方块图。FIG. 7 is a block diagram of a circuit used for generating a slowly rising edge according to an embodiment of the present invention.
图8为根据本发明一实施例的显示于图7中的后段驱动电路的详细电路方块图。FIG. 8 is a detailed circuit block diagram of the back-end driving circuit shown in FIG. 7 according to an embodiment of the present invention.
S400~S460:本发明一实施例的施行步骤S400~S460: Implementation steps of an embodiment of the present invention
S600~S660:本发明另一实施例的施行步骤S600-S660: implementation steps of another embodiment of the present invention
700:控制单元 702:时脉产生单元700: Control unit 702: Clock generation unit
704:计数器 706:闩锁器704: Counter 706: Latch
708:反相器 710:运算器708: Inverter 710: Calculator
712:比较器 714、716:脉波宽度驱动电路712:
718、718a:电流控制逻辑电路 72、72a:后段驱动电路718, 718a: current
800、810、830:多工器 802:增量暂存器800, 810, 830: Multiplexer 802: Incremental register
804:减法器 812:基准暂存器804: Subtractor 812: Reference register
814:加法器814: Adder
具体实施方式Detailed ways
为更进一步阐述本发明为达成预定发明目的所采取的技术手段及功效,以下结合附图及较佳实施例,对依据本发明提出的多电平脉冲宽度调制方法其具体实施方式、方法、步骤、特征及其功效,详细说明如后。In order to further explain the technical means and effects of the present invention to achieve the intended purpose of the invention, the specific implementation methods, methods and steps of the multi-level pulse width modulation method proposed according to the present invention will be described below in conjunction with the accompanying drawings and preferred embodiments. , features and their effects are described in detail below.
请参阅图3所示,为根据本发明一实施例所产生的脉冲宽度调制信号的波形图。为了降低瞬间的能量变化,对于脉冲宽度调制(pulse widthmodulation,PWM)信号所包含的每一个经调制所产生的脉冲波(后称调制脉冲)来说,应该要使得上升缘与下降缘为缓升或缓降的状态较佳。但相对来说,使用者一般较为重视突然的能量增加所带来的杂讯影响(因为会造成爆音),加上若为多个脉冲宽度调制同时动作且运作模式为向左靠齐(Left-aligned),则上升缘的影响更大,因为每个PWM(脉冲宽度调制)同时上升,但不同时下降。所以也可以只使得上升缘为缓升,而下降缘为一般方波式的快速下降。Please refer to FIG. 3 , which is a waveform diagram of a pulse width modulation signal generated according to an embodiment of the present invention. In order to reduce the instantaneous energy change, for each modulated pulse wave (hereinafter referred to as the modulated pulse) contained in the pulse width modulation (PWM) signal, the rising edge and falling edge should be made to rise slowly. Or the state of slow descent is better. But relatively speaking, users generally pay more attention to the noise effect caused by sudden energy increase (because it will cause popping sound). In addition, if multiple PWMs operate at the same time and the operation mode is aligned to the left (Left- aligned), the rising edge has more impact because each PWM (Pulse Width Modulation) rises at the same time, but does not fall at the same time. Therefore, it is also possible to only make the rising edge a slow rise, while the falling edge is a general square wave rapid decline.
为了产生如图3所示的两面缓降的波形,一个可行的施行方式显示于图4中。请参阅图4所示,为根据本发明一实施例而产生PWM(脉冲宽度调制)信号的方法的流程图。在本实施例中,该产生PWM(脉冲宽度调制)信号的方法,是采用多阶方式来逐步提升每一个调制脉冲的能量。该产生PWM信号的方法,包括以下步骤:In order to generate the two-sided ramp-down waveform shown in FIG. 3 , a possible implementation is shown in FIG. 4 . Please refer to FIG. 4 , which is a flowchart of a method for generating a PWM (Pulse Width Modulation) signal according to an embodiment of the present invention. In this embodiment, the method for generating a PWM (Pulse Width Modulation) signal adopts a multi-stage method to gradually increase the energy of each modulation pulse. The method for generating a PWM signal comprises the following steps:
首先,在输出任一个调制脉冲之前先确认其脉冲宽度调制输出值为0(步骤S400)。First, before outputting any modulated pulse, confirm that its pulse width modulated output value is 0 (step S400).
接下来将脉冲宽度调制计数值X(为整数)设定为0以便开始作业(X可以看成代表横轴上的数值)(步骤S410)。Next, set the pulse width modulation count value X (which is an integer) to 0 to start the operation (X can be regarded as representing the value on the horizontal axis) (step S410).
当脉冲宽度调制计数值X介于0与2n-1(n为振幅解析度的位元数)之间的时候(0≤X<2n-1),就逐步提升脉冲宽度调制输出值,亦即,使所要输出的脉冲宽度调制输出值比在同一个调制脉冲里面的前一次的脉冲宽度调制输出值最多多出一个单位能量(步骤S420)。When the pulse width modulation count value X is between 0 and 2 n -1 (n is the number of bits of the amplitude resolution) (0≤X<2 n -1), the pulse width modulation output value is gradually increased, That is, make the output value of the pulse width modulation to be output more than the previous pulse width modulation output value in the same modulation pulse by at most one unit energy (step S420 ).
再者,当脉冲宽度调制计数值X介于2n-1与该一调制脉冲的工作周期(duty cycle)PWMD减去2n-1之间的时候(2n-1≤X≤PWMD-(2n-1)),就使脉冲宽度调制输出值为最大的方波振幅(步骤S430);Furthermore, when the pulse width modulation count value X is between 2 n -1 and the duty cycle (duty cycle) PWMD of the modulation pulse minus 2 n -1 (2 n -1≤X≤PWMD-( 2 n -1)), just make the pulse width modulation output value the maximum square wave amplitude (step S430);
而当脉冲宽度调制计数值X大于工作周期PWMD减去2n-1不大于工作周期PWMD(PWMP-(2n-1)<X≤PWMD)的时候,就开始逐步降低脉冲宽度调制输出值(步骤S440)。When the pulse width modulation count value X is greater than the duty cycle PWMD minus 2 n -1 and not greater than the duty cycle PWMD (PWMP-(2 n -1)<X≤PWMD), the pulse width modulation output value will be gradually reduced ( Step S440).
在每次针对一个脉冲宽度调制计数值X进行上述的操作之后,该脉冲宽度调制计数值X就会被递增1(步骤S450)。After each time the above operation is performed on a PWM count value X, the PWM count value X will be incremented by 1 (step S450).
在脉冲宽度调制计数值X还没被递增到该调制脉冲的工作周期PWMD之前,重复前述的步骤S420~S450以输出信号,并在脉冲宽度调制计数值X到达工作周期PWMD之后(步骤S460),结束前述操作并将输出重置为0(步骤S470)。Before the pulse width modulation count value X has been incremented to the duty cycle PWMD of the modulation pulse, repeat the aforementioned steps S420-S450 to output the signal, and after the pulse width modulation count value X reaches the duty cycle PWMD (step S460), The foregoing operations are ended and the output is reset to 0 (step S470).
接下来举出一个实际的例子,以使本技术领域的技术人员能够更轻易理解本发明所提供的技术。请参阅图5所示,为根据本发明一实施例所产生的PWM信号中的一个调制脉冲图。在本实施例中,振幅的解析度位元数为2,所以振幅大小会有四种变化,其分别是如图5所示的垂直轴上的数值0~3,而两相邻数字的间隔则代表了一个单位的能量;再者,此实施例中的调制脉冲的工作周期(PWMD)为7(0~7),时间宽度(PWMP)则为9(0~9)。A practical example is given next, so that those skilled in the art can more easily understand the technology provided by the present invention. Please refer to FIG. 5 , which is a modulation pulse diagram of a PWM signal generated according to an embodiment of the present invention. In this embodiment, the number of resolution bits of the amplitude is 2, so there are four kinds of changes in the amplitude, which are respectively the
根据图4所示的施行步骤,在脉冲宽度调制计数值X为0的时候开始递增其输出为1。接下来,随着脉冲宽度调制计数值X分别被递增至1与2(小于22-1=3),PWM输出值(振幅)也就相应的被递增成2与3个单位的能量(步骤S420)。According to the execution steps shown in FIG. 4 , when the pulse width modulation count value X is 0, it starts incrementing and its output is 1. Next, as the pulse width modulation count value X is incremented to 1 and 2 (less than 2 2 −1=3), the PWM output value (amplitude) is incremented to 2 and 3 units of energy (step S420).
接下来,在脉冲宽度调制计数值X为3与4(3=22-1≤X≤7-3=4)的时候则使PWM输出值为最大的方波振幅3(步骤S430)。Next, when the pulse width modulation count value X is 3 and 4 (3=2 2 −1≤X≤7−3=4), the PWM output value is set to the maximum square wave amplitude of 3 (step S430 ).
最后,在脉冲宽度调制计数值X为5~7(7-(22-1)=4<X≤7)的时候,PWM输出值就会被逐一递减至0(步骤S440)。而在X为8~9的时候,PWM输出值则为0(或说终止输出)。Finally, when the PWM count value X is 5˜7 (7−(2 2 −1)=4<X≦7), the PWM output value will be decremented to 0 one by one (step S440 ). And when X is 8-9, the PWM output value is 0 (or terminated output).
必须注意的是,虽然此处所提的例子是调制脉冲的工作周期PWMD与整体周期PWMP不同的情况,但是工作周期PWMD与整体周期PWMP相同的情况也适用此种方式来产生调制脉冲。再者,虽然前述两个实施例中所产生波形的上升源都是绝对递增,但是此技术领域的技术人员当知,其也可为相对递增的上升方式(即可能两相邻单位时间所呈现的能量相同)。It should be noted that although the example mentioned here is the case where the duty cycle PWMD of the modulating pulse is different from the overall period PWMP, this method is also applicable to the case where the duty cycle PWMD is the same as the overall period PWMP to generate the modulating pulse. Furthermore, although the rise sources of the waveforms generated in the aforementioned two embodiments are all absolute increments, those skilled in the art will know that they can also be relatively incremental rises (that is, the two adjacent unit times may show same energy).
接下来请参阅图6所示,为根据本发明一实施例在产生上升缘时所使用的方法的流程图。在本实施例中,首先,先初始化一个基准计数值(BAS)(步骤S600),该基准计数值等同于前一个实施例中的脉冲宽度调制计数值X,可以用来指示调制脉冲中相对应的一个单位时间。Next, please refer to FIG. 6 , which is a flowchart of a method used when generating a rising edge according to an embodiment of the present invention. In this embodiment, first, initialize a base count value (BAS) (step S600), the base count value is equal to the pulse width modulation count value X in the previous embodiment, and can be used to indicate the corresponding a unit of time.
接下来,在上升缘中的每一个单位时间里所要呈现的最大能量值被设定为一个增量计数值(INC)(步骤S610)。Next, the maximum energy value to be present in each unit time of the rising edge is set as an increment count value (INC) (step S610).
接下来,本方法逐步增加基准计数值BAS至2n-1,且逐步减少增量计数值INC至零,并在基准计数值BAS到达2n-1且增量计数值INC到达零之前,使脉冲宽度调制输出值为基准计数值BAS加1(步骤S620~S660)。Next, the method gradually increases the base count value BAS to 2n -1, and gradually decreases the incremental count value INC to zero, and before the base count value BAS reaches 2n -1 and the incremental count value INC reaches zero, the The pulse width modulation output value adds 1 to the reference count value BAS (steps S620-S660).
以图5所示的波形为例,由于调制脉冲所需要呈现的能量较大,所以上升缘会上升到最大振幅处。换言之,上升缘中的单位时间里所要呈现的最大能量值是3。因此,除了将基准计数值BAS初始化为0(步骤S600)之外,也将增量计数值INC设定为3(步骤S610)。Taking the waveform shown in Figure 5 as an example, the rising edge will rise to the maximum amplitude because the modulation pulse needs to present a large amount of energy. In other words, the maximum energy value to be presented per unit time in the rising edge is 3. Therefore, in addition to initializing the base count value BAS to 0 (step S600), the increment count value INC is also set to 3 (step S610).
接下来,在第一轮的流程里,在步骤S620中由于增量计数值INC不为0,所以时间点0(因为基准计数值BAS目前为0)的输出会是1(0+1)。而由于在步骤S630中增量计数值INC不为0,所以该增量计数值INC会被递减为2(步骤S640)。又由于在步骤S650中判断出基准计数值BAS是不为3(22-1=3),所以基准计数值BAS会被递增为1(步骤S660),并使流程回到步骤S620继续进行下去。Next, in the first round of the process, in step S620 , since the incremental count value INC is not 0, the output at time 0 (because the base count value BAS is currently 0) will be 1 (0+1). Since the increment count value INC is not 0 in step S630, the increment count value INC is decremented to 2 (step S640). And because it is judged in step S650 that the base count value BAS is not 3 (22-1=3), the base count value BAS will be incremented to 1 (step S660), and the process returns to step S620 to continue.
在第二轮的流程中,由于增量计数值INC不为0,所以时间点1(BAS为1)的输出会是2(BAS+1=2)。类似的,增量计数值INC会被递减为1,而基准计数值BAS则被递增为2。接下来,在第三轮的流程中,由于增量计数值INC仍然不为0,所以时间点2(BAS为2)的输出会是3(BAS+1=3),并且增量计数值INC会被递减为0,而基准计数值BAS则被递增为3。In the second round of the process, since the incremental count value INC is not 0, the output at time point 1 (BAS is 1) will be 2 (BAS+1=2). Similarly, the increment count value INC is decremented to 1, and the base count value BAS is incremented to 2. Next, in the process of the third round, since the incremental count value INC is still not 0, the output at time point 2 (BAS is 2) will be 3 (BAS+1=3), and the incremental count value INC will be decremented to 0 and the base count value BAS will be incremented to 3.
在第四轮的流程中,由于增量计数值INC已经变成0了,所以时间点3的输出会是3(也就是BAS的值),而因为增量计数值INC为0且基准计数值BAS为3,所以步骤S650判断合乎规定,此程序将被结束。In the fourth round of the process, since the incremental count value INC has become 0, the output at
藉由图6所示的方式,可以轻易的做出一个上升缘倾斜的调整脉冲。当然,图6所示的方式也可以结合在图4的步骤S420中来产生调整脉冲的上升缘。By means of the method shown in FIG. 6 , an adjustment pulse with a rising edge slope can be easily made. Of course, the method shown in FIG. 6 can also be combined in step S420 of FIG. 4 to generate the rising edge of the adjustment pulse.
请参阅图7所示,为根据本发明一实施例的产生缓上升缘时所用的电路方块图。在该电路中,控制单元700、时脉产生单元(时钟产生器)702、计数器704、闩锁器706、反相器708、运算器710、比较器712以及脉波宽度驱动电路714与716为现有习知技术中所采用的脉波宽度调制电路,其操作大致上是以控制单元700来控制时脉产生单元(时钟产生器)702的输出频率、闩锁器706的输出模式以及比较器712的比较模式。闩锁器706将所接收的音讯资料DA输出,其在经过反相器708与运算器710的计算之后会产生一个目前脉波宽度的数值,该数值被输入到比较器712的一个输入端;比较器712的另一个输入端则接收计数器704的输出数值,该输出数值为预定脉波宽度的数值。这两个数值在经过比较器712比较之后,被用来决定是否启动脉波宽度驱动电路714与716,以分别产生脉波宽度调制信号PWM0与PWM1。Please refer to FIG. 7 , which is a block diagram of a circuit used for generating a slow rising edge according to an embodiment of the present invention. In this circuit, a
图7所示的本实施例与现有习知技术之间的主要差别在于新增了一个电流控制逻辑电路718。该电流控制逻辑电路718接收比较器712的输出以产生基于电流变化而改变的脉波宽度调制信号CUR。The main difference between this embodiment shown in FIG. 7 and the prior art is that a current
请参阅图8所示,为根据本发明一实施例的显示于图7中的后段驱动电路72的详细电路方块图。在图8中,后段驱动电路72a中的比较器712将所产生的信号传送给电流控制逻辑电路718a。增量暂存器802用以储存增量计数值INC,其与减法器804组合成一个增量计数器;基准暂存器812用以储存基准计数值BAS,其与加法器814则组合成一个基准计数器。多工器800根据比较器712的输出值而决定是将减法器804的输出存入到增量暂存器802中,或者是将所要表现的能量值(inc_value)存入到增量暂存器802中(如图6的步骤S610)。类似的,多工器810根据比较器712的输出值而决定是要将加法器814的输出储存到基准暂存器812中,或者是要将基准暂存器初始化为0(亦即,将0存入到基准暂存器812中,如图6的步骤S600)。Please refer to FIG. 8 , which is a detailed circuit block diagram of the back-
由增量暂存器802所输出的值将用来控制多工器830。藉此,多工器830可以从基准暂存器812的输出、基准暂存器812的输出递增1、最大电流值MAX_CUR与0等四个值之中,依照图6所示的流程而决定输出其中之一为脉波宽度调制信号CUR。The value output by the
综上所述,本发明减缓PWM波形中上升缘的上升速度,藉此将可减少能量的变化程度而增进后续类比输出的流畅度,降低因强烈能量变化所产生的电磁干扰。当然,此种作法也可以用在PWM波形中的下降缘,并且也具有相当的功效。To sum up, the present invention slows down the rising speed of the rising edge in the PWM waveform, thereby reducing the degree of energy variation and improving the smoothness of the subsequent analog output, reducing the electromagnetic interference caused by strong energy variation. Of course, this approach can also be used on the falling edge of the PWM waveform, and it also has considerable efficacy.
以上所述,仅是本发明的较佳实施例而已,并非对本发明作任何形式上的限制,虽然本发明已以较佳实施例揭露如上,然而并非用以限定本发明,任何熟悉本专业的技术人员,在不脱离本发明技术方案范围内,当可利用上述揭示的技术内容作出些许更动或修饰为等同变化的等效实施例,但凡是未脱离本发明技术方案内容,依据本发明的技术实质对以上实施例所作的任何简单修改、等同变化与修饰,均仍属于本发明技术方案的范围内。The above description is only a preferred embodiment of the present invention, and does not limit the present invention in any form. Although the present invention has been disclosed as above with preferred embodiments, it is not intended to limit the present invention. Anyone familiar with this field Those skilled in the art, without departing from the scope of the technical solution of the present invention, may use the technical content disclosed above to make some changes or modify them into equivalent embodiments with equivalent changes, but as long as they do not depart from the technical solution of the present invention, the Technical Essence Any simple modifications, equivalent changes and modifications made to the above embodiments still fall within the scope of the technical solution of the present invention.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2007101631468A CN101409543B (en) | 2007-10-10 | 2007-10-10 | Multilevel Pulse Width Modulation Method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2007101631468A CN101409543B (en) | 2007-10-10 | 2007-10-10 | Multilevel Pulse Width Modulation Method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101409543A CN101409543A (en) | 2009-04-15 |
CN101409543B true CN101409543B (en) | 2011-07-20 |
Family
ID=40572372
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2007101631468A Expired - Fee Related CN101409543B (en) | 2007-10-10 | 2007-10-10 | Multilevel Pulse Width Modulation Method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101409543B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1410963A (en) * | 2001-09-28 | 2003-04-16 | 佳能株式会社 | Driving signal generator and picture display |
CN1420624A (en) * | 2001-09-26 | 2003-05-28 | 株式会社东芝 | Crackle suppressing circuit and sound output amplifier |
-
2007
- 2007-10-10 CN CN2007101631468A patent/CN101409543B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1420624A (en) * | 2001-09-26 | 2003-05-28 | 株式会社东芝 | Crackle suppressing circuit and sound output amplifier |
CN1410963A (en) * | 2001-09-28 | 2003-04-16 | 佳能株式会社 | Driving signal generator and picture display |
Non-Patent Citations (1)
Title |
---|
US 2003006922 A1,说明书第99-134段,附图12、15、16. |
Also Published As
Publication number | Publication date |
---|---|
CN101409543A (en) | 2009-04-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10826478B2 (en) | Pulse-width modulation | |
KR100727409B1 (en) | Pulse width modulation method and digital power amplifier using the same | |
US20150063593A1 (en) | Noise and Cross-Talk Attenuation in an Audio System by Offsetting Outputs in Phase | |
US20110261875A1 (en) | Multi-Edge Pulse Width Modulator with Non-Stationary Residue Assignment | |
CN104254974A (en) | Pwm duty cycle synthesizer and method with adjustable corner frequency | |
CN102811026B (en) | Class D audio power amplifier for noise suppression and audio signal processing method thereof | |
CN103368538B (en) | The digital pulse width modulation device and method that a kind of switching frequency range is adjustable | |
TWI376099B (en) | Spread spectrum clock signal generator | |
CN101409543B (en) | Multilevel Pulse Width Modulation Method | |
JP2004222251A (en) | Digital amplifier | |
CN101877570B (en) | Driving circuit and driving method of voice coil motor | |
US6784710B2 (en) | Multistage pulse width modulator | |
TW200917659A (en) | Multi-level pulse width modulation method | |
CN209072444U (en) | A kind of clock duty cycle adjustment circuit | |
WO2021104119A1 (en) | Digital audio power amplifier and power amplifier loop | |
EP2056452A2 (en) | Signal generating apparatus and class-D- amplifying apparatus | |
CN101527547B (en) | Method and related device for controlling power output stage of power amplifier | |
JP4985380B2 (en) | Signal generator and class D amplifier | |
TWI846412B (en) | Pulse-width modulation circuit | |
JP2009010528A (en) | Pulse width modulation signal generation method and pulse width modulation signal generation apparatus | |
TWI603589B (en) | Apparatus for differential amplitude pulse width modulation digital-to-analog conversion and method for encoding output signal thereof | |
JP2001345705A (en) | Multi-bit pdm signal gain regulator | |
CN209486540U (en) | A pulse wave generating circuit | |
CN1219353C (en) | Device and method for controlling volume generated by PWM pulse | |
CN107579726A (en) | A Method of Improving the Output Accuracy of Counter Type Digital Pulse Width Modulator |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20110720 Termination date: 20171010 |