[go: up one dir, main page]

TWI762239B - Direct current offset protection circuit and method - Google Patents

Direct current offset protection circuit and method Download PDF

Info

Publication number
TWI762239B
TWI762239B TW110109059A TW110109059A TWI762239B TW I762239 B TWI762239 B TW I762239B TW 110109059 A TW110109059 A TW 110109059A TW 110109059 A TW110109059 A TW 110109059A TW I762239 B TWI762239 B TW I762239B
Authority
TW
Taiwan
Prior art keywords
circuit
offset
register
polarity
pwm
Prior art date
Application number
TW110109059A
Other languages
Chinese (zh)
Other versions
TW202239144A (en
Inventor
邱信源
楊翔宇
Original Assignee
晶豪科技股份有限公司
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 晶豪科技股份有限公司 filed Critical 晶豪科技股份有限公司
Priority to TW110109059A priority Critical patent/TWI762239B/en
Application granted granted Critical
Publication of TWI762239B publication Critical patent/TWI762239B/en
Publication of TW202239144A publication Critical patent/TW202239144A/en

Links

Images

Landscapes

  • Amplifiers (AREA)

Abstract

A direct current (DC) offset protection circuit includes: a DC offset detection circuit and a control circuit. The DC offset detection circuit is arranged to detect whether a DC component exists in pulse-width-modulation (PWM) signals and accordingly generate a DC offset detection result. The control circuit is arranged to control an audio system according to the DC offset detection result. The DC offset detection circuit comprises a PWM polarity judgment circuit, a cascaded integrator-comb (CIC) filter and a DC offset judgment circuit. The PWM polarity judgment circuit is arranged to judge a polarity of complementary PWM signals and accordingly generate a polarity indication value. The CIC filter is arranged to generate a filter output signal by averaging a plurality of polarity indication values. The DC offset judgment circuit is arranged to generate the DC offset detection result by comparing the filter output signal with a predetermined DC threshold.

Description

直流偏移保護電路與方法 DC offset protection circuit and method

本發明關於音訊系統,尤指一種用於在音訊系統中偵測直流成分並且進行保護控制的直流偏移保護電路和方法。 The present invention relates to an audio system, in particular to a DC offset protection circuit and method for detecting DC components in the audio system and performing protection control.

在音訊系統中,對電路和元件的保護是必要的設計考量,其中之一便是輸出直流偏移保護。一般來說,直流偏移電壓被定義為,當未有電壓施加在電路的輸入端上,此時電路輸入端或輸出端的直流電壓準位。由於元件/組件的不匹配、時間導致的元件衰退、過度電性應力(electrical overstress),或者其他因素,都可能造成輸出端的直流偏移電壓。直流偏移電壓將導致大量的直流電流流經音訊系統的揚聲器,可能對揚聲器造成不可逆轉的損壞。另外,揚聲器上的大量直流電流耗逸可能有燃燒的風險。有鑑於此,直流偏移電壓可能會對音訊系統產生負面影響,因此需要適當地降低其程度。 In audio systems, protection of circuits and components is a necessary design consideration, one of which is output DC offset protection. Generally speaking, the DC offset voltage is defined as the DC voltage level at the input or output of a circuit when no voltage is applied to the input of the circuit. DC offset voltage at the output can be caused by component/component mismatch, component degradation over time, electrical overstress, or other factors. The DC offset voltage will cause a large amount of DC current to flow through the speakers of the audio system, possibly causing irreversible damage to the speakers. Also, there is a risk of burning due to the large amount of DC current drain on the speaker. In view of this, the DC offset voltage may have a negative impact on the audio system, so it needs to be appropriately reduced.

基於以上理由,本發明的目的之一在於提供一種用於音訊系統的直流偏移保護電路和方法。在本發明的多個實施例中,提供了直流偏移偵測機制,以偵測脈衝寬度調變訊號中的直流成分,這些脈衝寬度調變訊號通常在D類放大器為主的音訊系統中使用。本發明的直流偏移偵測機制主要依靠級聯積分梳狀(cascaded integrator-comb,CIC)濾波器來對脈衝寬度調變訊號的取樣進行平均 計算,從而偵測脈衝寬度調變訊號中的直流成分。 Based on the above reasons, one of the objectives of the present invention is to provide a DC offset protection circuit and method for an audio system. In various embodiments of the present invention, a DC offset detection mechanism is provided to detect DC components in pulse width modulated signals, which are commonly used in audio systems based on class D amplifiers . The DC offset detection mechanism of the present invention mainly relies on cascaded integrator-comb (CIC) filters to average the samples of the PWM signal Calculated to detect the DC component in the PWM signal.

本發明之一實施例提供一種用於一音訊系統的直流偏移保護電路,該直流偏移保護電路包含:一直流偏移偵測電路以及一控制電路。該直流偏移偵測電路用於偵測複數個脈衝寬度調變訊號中是否存在直流成分,並且據此產生一直流偏移偵測結果。該控制電路用於根據該直流偏移偵測結果,控制該音訊系統的至少一部分。該直流偏移偵測電路包含:一脈衝寬度調變極性判斷電路、一級聯積分梳狀濾波器以及一直流偏移判斷電路。該脈衝寬度調變極性判斷電路用於判斷互補的脈衝寬度調變訊號對的極性,並且據此產生一極性指示值。該級聯積分梳狀濾波器用於透過平均複數個極性指示值,產生一濾波器輸出訊號。該直流偏移判斷電路用於將該濾波器輸出訊號與至少一直流偏移臨界值比較,據此產生該直流偏移偵測結果。 An embodiment of the present invention provides a DC offset protection circuit for an audio system. The DC offset protection circuit includes a DC offset detection circuit and a control circuit. The DC offset detection circuit is used for detecting whether a DC component exists in a plurality of pulse width modulation signals, and generates a DC offset detection result accordingly. The control circuit is used for controlling at least a part of the audio system according to the DC offset detection result. The DC offset detection circuit includes: a pulse width modulation polarity judgment circuit, a cascaded integrator-comb filter and a DC offset judgment circuit. The pulse width modulation polarity judgment circuit is used for judging the polarity of the complementary pulse width modulation signal pair, and generates a polarity indication value accordingly. The cascaded integrator-comb filters are used to generate a filter output signal by averaging a plurality of polarity indicating values. The DC offset determination circuit is used for comparing the output signal of the filter with at least a DC offset threshold value to generate the DC offset detection result accordingly.

本發明之一實施例提供一種用於一音訊系統的直流偏移保護方法。該方法包含:判斷互補的脈衝寬度調變訊號對的極性,並且據此產生一極性指示值;利用一級聯積分梳狀濾波器平均複數個極性指示值,以產生一濾波器輸出訊號;將該濾波器輸出訊號與至少一直流偏移臨界值比較,以產生一直流偏移偵測結果;以及依據該直流偏移偵測結果,控制該音訊系統的至少一部分。 An embodiment of the present invention provides a DC offset protection method for an audio system. The method includes: judging the polarity of the complementary pulse width modulation signal pair, and generating a polarity indication value accordingly; using a cascaded integrator-comb filter to average a plurality of polarity indication values to generate a filter output signal; The filter output signal is compared with at least a DC offset threshold to generate a DC offset detection result; and according to the DC offset detection result, at least a part of the audio system is controlled.

10:音訊系統 10: Audio system

15:音訊訊號處理電路 15: Audio signal processing circuit

20:功率級 20: Power stage

30:直流偏移保護電路 30: DC offset protection circuit

100:直流偏移偵測電路 100: DC offset detection circuit

110:PWM極性判斷電路 110: PWM polarity judgment circuit

120:CIC濾波器 120:CIC filter

122、123、126:暫存器電路 122, 123, 126: Scratchpad circuit

130:直流偏移判斷電路 130: DC offset judgment circuit

200:控制電路 200: Control circuit

圖1繪示本發明實施例之用於音訊系統中的直流偏移保護電路的架構示意圖。 FIG. 1 is a schematic structural diagram of a DC offset protection circuit used in an audio system according to an embodiment of the present invention.

圖2繪示本發明實施例之直流偏移保護電路中的直流偏移偵測電路的架構 示意圖。 FIG. 2 illustrates the structure of the DC offset detection circuit in the DC offset protection circuit according to the embodiment of the present invention Schematic.

圖3繪示本發明實施例之用於直流偏移偵測電路中的級聯積分梳狀濾波器的架構示意圖。 FIG. 3 is a schematic structural diagram of a cascaded integrator-comb filter used in a DC offset detection circuit according to an embodiment of the present invention.

圖4A和圖4B繪示直流偏移偵測結果、濾波器輸出訊號、正直流偏移臨界值和負直流偏移臨界值的組合的波形圖。 4A and 4B are waveform diagrams showing the DC offset detection result, the filter output signal, the combination of the positive DC offset threshold and the negative DC offset threshold.

圖5繪示本發明實施例之直流偏移保護方法的流程圖。 FIG. 5 is a flowchart illustrating a DC offset protection method according to an embodiment of the present invention.

在以下內文中,描述了許多具體細節以提供閱讀者對本發明實施例的透徹理解。然而,本領域的技術人士將能理解,如何在缺少一個或多個具體細節的情況下,或者利用其他方法或元件或材料等來實現本發明。在其他情況下,眾所皆知的結構、材料或操作不會被示出或詳細描述,從而避免模糊本發明的核心概念。 In the following text, numerous specific details are described in order to provide the reader with a thorough understanding of the embodiments of the present invention. However, one skilled in the art will understand how to practice the invention in the absence of one or more of the specific details, or with other methods or elements or materials, and the like. In other instances, well-known structures, materials, or operations are not shown or described in detail to avoid obscuring the core concepts of the invention.

說明書中提到的「一實施例」意味著該實施例所描述的特定特徵、結構或特性可能被包含於本發明的至少一個實施例中。因此,本說明書中各處出現的「在一實施例中」不一定意味著同一個實施例。此外,前述的特定特徵、結構或特性可以以任何合適的形式在一個或多個實施例中結合。 Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in the embodiment may be included in at least one embodiment of the present invention. Thus, the appearances of "in an embodiment" in various places in this specification do not necessarily mean the same embodiment. Furthermore, the particular features, structures or characteristics described above may be combined in any suitable form in one or more embodiments.

請參考圖1,該圖示出本發明實施例中,用於音訊系統的直流偏移保護電路。如圖所示,音訊系統10包含(但不限於):音訊訊號處理電路15、功率級20、多個揚聲器25、直流偏移保護電路30。直流偏移保護電路30包括直流偏移偵測電路100與控制電路200。直流偏移偵測電路100被設置為用於偵測音訊系統10中是否存在直流成分。控制電路200被設置為用於根據直流偏移偵測電路 100的偵測結果,控制音訊系統10的至少一部分。 Please refer to FIG. 1 , which shows a DC offset protection circuit for an audio system according to an embodiment of the present invention. As shown in the figure, the audio system 10 includes (but is not limited to): an audio signal processing circuit 15 , a power stage 20 , a plurality of speakers 25 , and a DC offset protection circuit 30 . The DC offset protection circuit 30 includes a DC offset detection circuit 100 and a control circuit 200 . The DC offset detection circuit 100 is configured to detect whether there is a DC component in the audio system 10 . The control circuit 200 is configured to detect the circuit based on the DC offset The detection result of 100 controls at least a part of the audio system 10 .

在一實施例中,音訊訊號處理電路15可能包含(未示出)取樣率轉換單元、均衡器、音量控制單元、動態範圍控制單元、限幅單元以及PWM脈波產生器等,從而對輸入的數位音訊訊號執行一系列的音訊訊號處理,並相應地以開關方式(亦即,透過脈衝寬度調變(pulse-width modulation,PWM)訊號)驅動揚聲器25。音頻系統10可以包含N個音訊通道。音訊訊號處理電路15輸出與N個音訊通道相對應的2N個PWM訊號,從而驅動N個揚聲器。在一般情況下,一對立體聲揚聲器25將透過四個PWM訊號PWML+,PWML-,PWMR+和PWMR-來驅動。其中,四個PWM訊號中包括兩對互補訊號,一對互補PWM訊號PWML+和PWML-用來在左聲道上驅動揚聲器25,而另一對互補PWM訊號PWMR+和PWMR-用來在在右聲道上驅動揚聲器25。功率級20進一步輸出PWM訊號。功率級20可包含由PWM訊號所控制的多個功率開關(power gate),並相應地提供PWM以驅動揚聲器25。請注意,在本文中所到的音訊系統10內的聲道、揚聲器和PWM訊號的數量並非發明範圍的實質限制。 In one embodiment, the audio signal processing circuit 15 may include (not shown) a sampling rate conversion unit, an equalizer, a volume control unit, a dynamic range control unit, a limiter unit, a PWM pulse generator, etc. The digital audio signal performs a series of audio signal processing and accordingly drives the speaker 25 in an on-off manner (ie, through a pulse-width modulation (PWM) signal). Audio system 10 may contain N audio channels. The audio signal processing circuit 15 outputs 2N PWM signals corresponding to the N audio channels, thereby driving the N speakers. In general, a pair of stereo speakers 25 will be driven by four PWM signals PWML+, PWML-, PWMR+ and PWMR-. Among them, the four PWM signals include two pairs of complementary signals, one pair of complementary PWM signals PWML+ and PWML- are used to drive the speaker 25 on the left channel, and another pair of complementary PWM signals PWMR+ and PWMR- are used to drive the speaker 25 on the right channel. The speaker 25 is driven on the road. The power stage 20 further outputs a PWM signal. The power stage 20 may include a plurality of power gates controlled by PWM signals, and accordingly provide PWM to drive the speaker 25 . Please note that the number of channels, speakers and PWM signals in the audio system 10 referred to herein is not a substantial limitation of the scope of the invention.

直流偏移偵測電路100耦接至功率級20,並偵測功率級20所輸出的任何PWM訊號中是否存在直流成分。基於對直流成分的偵測,直流偏移偵測電路100將產生偵測訊號DC_DET以通知控制電路200。根據偵測訊號DC_DET,控制電路200可以控制功率級25停止提供PMW訊號到揚聲器25(一旦偵測到直流成分時)。根據本發明的多個實施例,即使只有一個聲道包含直流成分,功率級25也將停止向音訊系統10中的所有揚聲器25提供PWM訊號。而在另一個實施例中,功率級25將停止向包含直流成分的聲道相關的特定揚聲器25提供PWM訊號。另外,根據本發明的多個實施例,當偵測到直流成分時,控制電路200可以進一步 關閉音訊系統10的其他部分。 The DC offset detection circuit 100 is coupled to the power stage 20 and detects whether there is a DC component in any PWM signal output by the power stage 20 . Based on the detection of the DC component, the DC offset detection circuit 100 will generate a detection signal DC_DET to notify the control circuit 200 . According to the detection signal DC_DET, the control circuit 200 can control the power stage 25 to stop providing the PMW signal to the speaker 25 (once the DC component is detected). According to various embodiments of the present invention, the power stage 25 will stop providing PWM signals to all the speakers 25 in the audio system 10 even if only one channel contains a DC component. In another embodiment, the power stage 25 will stop providing the PWM signal to the specific speaker 25 associated with the channel containing the DC component. In addition, according to various embodiments of the present invention, when the DC component is detected, the control circuit 200 may further The rest of the audio system 10 is turned off.

圖2繪示了本發明實施例中的直流偏移偵測電路100。如圖所示,直流偏移偵測電路100包含PWM極性判斷電路110,級聯積分梳狀(cascaded integrator-comb,CIC)濾波器120和直流偏移判斷電路130。PWM極性判斷電路110用於偵測功率級20所輸出的PWM訊號的極性,從而產生多個極性指示值PI,其中極性指示值PI用以指示PWM訊號中的一對互補PWM訊號PWMR+和PWMR-(或者是,PWML+和PWML-)的極性。在一個實施例中,PWM極性判斷電路110根據正PMW訊號(PWMR+)的取樣樣本與負PWM訊號(PWMR-)的取樣樣本之間的關係來產生極性指示值PI。例如,正PMW訊號PWMR+和負PWM訊號PWMR-將在參考時脈(未示出)的特定時脈邊緣處被取樣。因此,PWM極性判斷電路110根據正PMW訊號PWMR+和負PWM訊號PWMR-的即時取樣樣本來生成極性指示值PI。取決於它們之間的關係(即,正PMW訊號PWMR+的取樣樣本大於,等於或小於負PWM訊號PWMR-的取樣樣本),極性指示值PI將不同。 FIG. 2 illustrates the DC offset detection circuit 100 in the embodiment of the present invention. As shown in the figure, the DC offset detection circuit 100 includes a PWM polarity determination circuit 110 , a cascaded integrator-comb (CIC) filter 120 and a DC offset determination circuit 130 . The PWM polarity determination circuit 110 is used for detecting the polarity of the PWM signal output by the power stage 20, thereby generating a plurality of polarity indication values PI, wherein the polarity indication value PI is used to indicate a pair of complementary PWM signals PWMR+ and PWMR- in the PWM signal (or, PWML+ and PWML-) polarity. In one embodiment, the PWM polarity determination circuit 110 generates the polarity indication value PI according to the relationship between the sampling samples of the positive PMW signal (PWMR+) and the sampling samples of the negative PWM signal (PWMR-). For example, the positive PWM signal PWMR+ and the negative PWM signal PWMR- will be sampled at specific clock edges of a reference clock (not shown). Therefore, the PWM polarity determination circuit 110 generates the polarity indication value PI according to the real-time sampling samples of the positive PMW signal PWMR+ and the negative PWM signal PWMR-. Depending on the relationship between them (ie, the samples of the positive PMW signal PWMR+ are larger, equal to or smaller than the samples of the negative PWM signal PWMR-), the polarity indicator value PI will be different.

在一個實施例中,極性指示值可以用帶有正負號的浮點數的來表示。另外,互補PWM訊號PWMR+和PWMR-的取樣樣本的位元數小於極性指示值的位元數。例如,正PWM訊號PWMR+或負PWM訊號PWMR-的取樣樣本可以是2位元資料,而極性指示值PI可以是3位元資料。 In one embodiment, the polarity indication value may be represented by a signed floating point number. In addition, the number of bits of the sampling samples of the complementary PWM signals PWMR+ and PWMR- is smaller than the number of bits of the polarity indication value. For example, the samples of the positive PWM signal PWMR+ or the negative PWM signal PWMR- may be 2-bit data, and the polarity indication value PI may be 3-bit data.

每當對互補PWM訊號PWMR+和PWMR-進行取樣後,極性指示值PI將被輸出到CIC濾波器120。CIC濾波器120被設置為在一段時間內平均多個極性指示值PI,以生成濾波器輸出訊號F_OUT。圖3示出了本發明實施例中,在直流偏移偵測電路100中使用CIC濾波器的架構示意圖。如圖所示,CIC濾波器120包 括第一加法電路121,第一暫存器電路122、第二暫存器電路123、開關電路124、第二加法電路125和第三暫存器電路126。 The polarity indication value PI will be output to the CIC filter 120 every time the complementary PWM signals PWMR+ and PWMR- are sampled. The CIC filter 120 is configured to average a plurality of polarity indication values PI over a period of time to generate the filter output signal F_OUT. FIG. 3 shows a schematic structural diagram of using a CIC filter in the DC offset detection circuit 100 according to an embodiment of the present invention. As shown, the CIC filter 120 pack It includes a first adding circuit 121 , a first register circuit 122 , a second register circuit 123 , a switch circuit 124 , a second adding circuit 125 and a third register circuit 126 .

第一加總電路121耦接至PWM極性判斷電路110,並且被設置為用於將極性指示值PI與來自第一暫存器電路122的第一暫存器輸出RO1相加,從而產生第一加總結果SUM1。第一暫存器電路122耦接至第一加總電路121,並且被設置為用於儲存第一加總結果SUM1,並相應地提供第一暫存器輸出RO1。在一定時間間隔內,極性指示值PI將在第一暫存器電路122中累積。第二暫存器電路123耦接至第一暫存器電路122,並且被設置為用於儲存第一暫存器輸出RO1,並相應地提供第二暫存器輸出RO2。開關電路124耦接在第一暫存器電路122和第二暫存器電路123之間,並且被設置為用於在一預定時間期滿之後,導通第一暫存器電路122和第二暫存器電路123之間的訊號路徑。例如,在第一加總電路121已經將極性指示值PI加到第一暫存器輸出RO1達222次之後,開關電路124將導通該訊號路徑。第二加總電路125耦接至開關電路124和第二暫存器電路123,並且被設置用於為當開關電路124導通訊號路徑時,將第一暫存器輸出RO1減去第二暫存器輸出RO2,以提供第二加總結果SUM2。第三暫存器電路126耦接至第二加總電路125和直流偏移判斷電路130,並且被設置為用於儲存第二加總結果SUM2,並相應地提供第三暫存器輸出,以作為濾波器輸出訊號F_OUT。簡而言之,CIC濾波器120被設置為用於在一段時間內對極性指示值PI執行移動平均計算,而濾波器輸出訊號F_OUT正是這個計算的結果。 The first summation circuit 121 is coupled to the PWM polarity determination circuit 110 and is configured to add the polarity indication value PI to the first register output RO1 from the first register circuit 122 to generate a first Add up the result SUM1. The first register circuit 122 is coupled to the first summation circuit 121 and is configured to store the first summation result SUM1 and accordingly provide the first register output RO1. During a certain time interval, the polarity indication value PI will be accumulated in the first register circuit 122 . The second register circuit 123 is coupled to the first register circuit 122 and is configured to store the first register output RO1 and correspondingly provide the second register output RO2. The switch circuit 124 is coupled between the first register circuit 122 and the second register circuit 123, and is configured to turn on the first register circuit 122 and the second register circuit 122 after a predetermined period of time expires. signal paths between the register circuits 123 . For example, after the first summation circuit 121 has added the polarity indication value PI to the first register output RO1 for 222 times, the switch circuit 124 will turn on the signal path. The second summation circuit 125 is coupled to the switch circuit 124 and the second register circuit 123 and is configured to subtract the second register from the first register output RO1 when the switch circuit 124 conducts the signal path output RO2 to provide a second summation result SUM2. The third register circuit 126 is coupled to the second summation circuit 125 and the DC offset judgment circuit 130, and is configured to store the second summation result SUM2, and correspondingly provide a third register output, so as to As the filter output signal F_OUT. In short, the CIC filter 120 is configured to perform a moving average calculation of the polarity indicator value PI over a period of time, and the filter output signal F_OUT is the result of this calculation.

直流偏移判斷電路130被設置為用於將濾波器輸出訊號F_OUT與正直流偏移臨界值PTH和負直流偏移臨界值NTH中的至少一個進行比較,以產生直流偏移偵測結果DC_DET。其中,直流偏移偵測結果DC_DET指出在功率級20 輸出的PWM訊號中是否存在正直流成分或負直流成分。參照圖4A和圖4B,該些圖示展示了偵測結果DC_DET、濾波器輸出訊號F_OUT與正直流偏移臨界值PTH和負直流偏移臨界值NTH的波形。如圖所示,當濾波器輸出訊號F_OUT超過正直流偏移臨界值PTH時,或濾波器輸出訊號F_OUT超過負直流偏移臨界值NTH時,直流偏移偵測結果DC_DET將被拉起。在一個實施例中,可以通過揚聲器25的額定功率來決定正直流偏移臨界值PTH和負直流偏移臨界值NTH。 The DC offset determination circuit 130 is configured to compare the filter output signal F_OUT with at least one of a positive DC offset threshold PTH and a negative DC offset threshold NTH to generate a DC offset detection result DC_DET. Among them, the DC offset detection result DC_DET indicates that the power stage 20 Whether there is a positive DC component or a negative DC component in the output PWM signal. Referring to FIGS. 4A and 4B , the graphs show the detection result DC_DET, the filter output signal F_OUT, and the waveforms of the positive DC offset threshold PTH and the negative DC offset threshold NTH. As shown in the figure, when the filter output signal F_OUT exceeds the positive DC offset threshold PTH, or when the filter output signal F_OUT exceeds the negative DC offset threshold NTH, the DC offset detection result DC_DET will be pulled up. In one embodiment, the positive DC offset threshold PTH and the negative DC offset threshold NTH may be determined by the rated power of the speaker 25 .

圖5繪示了本發明實施例的直流偏移保護方法的流程圖,該流程包括以下步驟:步驟410:判斷脈衝寬度調變訊號的極性,並且據此產生一極性指示值;步驟420:利用一CIC濾波器平均複數個極性指示值,產生一濾波器輸出訊號;步驟430:將該濾波器輸出訊號與至少一直流偏移臨界值比較,產生一直流偏移偵測訊號;以及步驟440:依據該直流偏移偵測訊號,控制一音訊系統的至少一部分。 5 is a flowchart of a DC offset protection method according to an embodiment of the present invention. The process includes the following steps: Step 410 : determine the polarity of the PWM signal, and generate a polarity indication value accordingly; Step 420 : use A CIC filter averages a plurality of polarity indication values to generate a filter output signal; Step 430: Compare the filter output signal with at least a DC offset threshold to generate a DC offset detection signal; and Step 440: At least a part of an audio system is controlled according to the DC offset detection signal.

由於以上內文中已經詳細解說了直流偏移保護電路30的原理和具體操作,為了簡潔起見,此處省略了關於步驟410~440的原理和具體操作的進一步說明。值得注意的是,本發明的直流偏移保護方法除了步驟410~440以外,還可以具有更多的額外步驟,以實現直流偏移偵測與保護。 Since the principles and specific operations of the DC offset protection circuit 30 have been explained in detail in the above context, for the sake of brevity, further explanations on the principles and specific operations of steps 410 to 440 are omitted here. It is worth noting that in addition to steps 410 to 440, the DC offset protection method of the present invention may have more additional steps to realize DC offset detection and protection.

總結來說,本發明提供了一種直流偏移保護電路和方法。本發明的 直流偏移偵測機制可用於偵測,以D類放大器為核心架構的音訊系統所使用的PWM訊號中的直流成分。並且,透過CIC濾波器對PWM訊號的取樣樣本執行平均計算,從而偵測PWM訊號中的直流成分,以防止潛在的直流電流損壞揚聲器或音訊系統內的元件。 In summary, the present invention provides a DC offset protection circuit and method. of the present invention The DC offset detection mechanism can be used to detect the DC component in the PWM signal used in the audio system with the class D amplifier as the core structure. In addition, the average calculation is performed on the sampling samples of the PWM signal through the CIC filter, thereby detecting the DC component in the PWM signal, so as to prevent the potential DC current from damaging the components in the speaker or audio system.

本發明之實施例可使用裝置、方法或計算機程式產品來實現。因此,本發明實施例可以採取下列形式:完全硬體架構,完全軟體架構(包括韌體,常駐軟體,微程式碼等),或者是同時結合了軟體和硬體的架構,這些架構可在本說明書以“模組”或“系統”的文字來描述。進一步來說,本發明之實施例除了可藉由適當的指令執行系統,使用儲存於一記憶體中之軟體或韌體來實作本發明的實施例外,也可應用下列任一技術或其相關結合來完成:具有可根據資料訊號執行邏輯功能之邏輯閘的一個別運算邏輯、具有合適的組合邏輯閘之一特定應用積體電路(application specific integrated circuit,ASIC)、可程式閘陣列(programmable gate array,PGA)或一現場可程式閘陣列(field programmable gate array,FPGA)等。 Embodiments of the present invention may be implemented using an apparatus, method or computer program product. Therefore, the embodiments of the present invention may take the following forms: a complete hardware architecture, a complete software architecture (including firmware, resident software, microcode, etc.), or an architecture combining both software and hardware. These architectures can be described in this Instructions are described in terms of "module" or "system". Further, the embodiments of the present invention can use software or firmware stored in a memory to implement the embodiments of the present invention through an appropriate instruction execution system, and can also apply any of the following technologies or their related It is accomplished by combining: an individual arithmetic logic with logic gates that can perform logic functions according to data signals, an application specific integrated circuit (ASIC) with a suitable combinational logic gate, a programmable gate array (programmable gate array) array, PGA) or a field programmable gate array (field programmable gate array, FPGA), etc.

說明書內的流程圖中的流程和方塊示出了基於本發明的各種實施例的系統、方法和電腦軟體產品所能實現的架構,功能和操作。在這方面,流程圖或功能方塊圖中的每個方塊可以代表程式碼的模組,區段或者是部分,其包括用於實現指定的邏輯功能的一個或多個可執行指令。另外,功能方塊圖以及/或流程圖中的每個方塊,以及方塊的組合,基本上可以由執行指定功能或動作的專用硬體系統來實現,或專用硬體和電腦程式指令的組合來實現。這些電腦程式指令還可以存儲在電腦可讀媒體中,該媒體可以使電腦或其他可編程數據 處理裝置以特定方式工作,使得存儲在電腦可讀媒體中的指令,實現流程圖以及/或功能方塊圖中的方塊所指定的功能/動作。 The processes and blocks in the flowcharts within the specification illustrate the architecture, functionality, and operations that can be implemented by systems, methods, and computer software products based on various embodiments of the present invention. In this regard, each block in the flowchart or functional block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). In addition, each block of the functional block diagrams and/or flowchart illustrations, and combinations of blocks, can be substantially implemented by special purpose hardware systems that perform the specified functions or actions, or combinations of special purpose hardware and computer program instructions. . These computer program instructions may also be stored in a computer-readable medium that enables a computer or other programmable data The processing device operates in a manner such that the instructions stored in the computer-readable medium perform the functions/acts specified by the blocks in the flowcharts and/or functional block diagrams.

以上所述僅為本發明之較佳實施例,凡依本發明申請專利範圍所做之均等變化與修飾,皆應屬本發明之涵蓋範圍。 The above descriptions are only preferred embodiments of the present invention, and all equivalent changes and modifications made according to the scope of the patent application of the present invention shall fall within the scope of the present invention.

100:直流偏移偵測電路 100: DC offset detection circuit

110:PWM極性判斷電路 110: PWM polarity judgment circuit

120:級聯積分梳狀濾波器濾波器 120: Cascade Integral Comb Filter Filter

130:直流偏移判斷電路 130: DC offset judgment circuit

Claims (8)

一種用於一音訊系統的直流偏移保護電路,包含:一直流偏移偵測電路,用於偵測複數個脈衝寬度調變(pulse-width modulation,PWM)訊號中的直流成分,包含:一PWM極性判斷電路,用於判斷互補的PWM訊號對的極性,並且據此產生一極性指示值,其中互補PWM訊號對之取樣樣本的位元數低於該極性指示值中的位元數,以及該極性指示值為帶有正負號的浮點數;一級聯積分梳狀(cascaded integrator-comb,CIC)濾波器,耦接至該PWM極性判斷電路,用於透過平均複數個極性指示值,以產生一濾波器輸出訊號;以及一直流偏移判斷電路,耦接至該CIC濾波器,用於將該濾波器輸出訊號與至少一直流偏移臨界值比較,據此產生一直流偏移偵測結果;以及一控制電路,耦接於該直流偏移判斷電路,用於根據該直流偏移偵測結果,控制該音訊系統的至少一部分。 A DC offset protection circuit for an audio system, comprising: a DC offset detection circuit for detecting DC components in a plurality of pulse-width modulation (PWM) signals, comprising: a a PWM polarity judging circuit for judging the polarity of the complementary PWM signal pair, and generating a polarity indication value accordingly, wherein the number of bits of the sampling sample of the complementary PWM signal pair is lower than the number of bits in the polarity indication value, and The polarity indication value is a floating-point number with a sign; a cascaded integrator-comb (CIC) filter is coupled to the PWM polarity determination circuit for averaging a plurality of polarity indication values to obtain a generating a filter output signal; and a DC offset determination circuit, coupled to the CIC filter, for comparing the filter output signal with at least a DC offset threshold value, and generating a DC offset detection accordingly the result; and a control circuit, coupled to the DC offset determination circuit, for controlling at least a part of the audio system according to the DC offset detection result. 如請求項1所述的直流偏移保護電路,其中該PWM極性判斷電路根據該互補PWM訊號對中之一正PWM訊號的一取樣樣本以及一負PWM訊號的一取樣樣本之間的關係,產生該極性指示值。 The DC offset protection circuit as claimed in claim 1, wherein the PWM polarity determination circuit generates according to the relationship between a sampling sample of a positive PWM signal and a sampling sample of a negative PWM signal in the complementary PWM signal pair The polarity indicates the value. 如請求項1所述的直流偏移保護電路,其中該CIC濾波器包含:一第一加總電路,耦接至該PWM極性判斷電路,用於將該極性指示值與一第一暫存器輸出相加,產生一第一加總結果; 一第一暫存器電路,耦接至該第一加總電路,用於儲存該第一加總結果,並且據此提供該第一暫存器輸出;一第二暫存器電路,耦接至該第一暫存器電路,用於儲存該第一暫存器輸出,並且據此提供一第二暫存器輸出;一開關電路,耦接於該第一暫存器電路與該第二暫存器電路之間,用於在一預定時間期滿之後,導通該第一暫存器電路與該第二暫存器電路之間一訊號路徑;一第二加總電路,耦接至該關開電路與該第二暫存器電路,用於當該開關電路導通該訊號路徑時,從該第一暫存器輸出減去該第二暫存器輸出,以提供一第二加總結果;以及一第三暫存器電路,耦接至該第二加總電路和該直流偏移判斷電路,用於儲存該第二加總結果,據此提供一第三暫存器輸出作為該濾波器輸出訊號。 The DC offset protection circuit of claim 1, wherein the CIC filter comprises: a first summing circuit, coupled to the PWM polarity determination circuit, for combining the polarity indication value with a first register The outputs are added to generate a first summation result; A first register circuit, coupled to the first summation circuit, for storing the first summation result and providing the first register output accordingly; a second register circuit, coupled to to the first register circuit for storing the output of the first register and providing a second register output accordingly; a switch circuit coupled to the first register circuit and the second register between the register circuits for turning on a signal path between the first register circuit and the second register circuit after a predetermined time expires; a second summing circuit coupled to the a switch circuit and the second register circuit for subtracting the second register output from the first register output to provide a second summation result when the switch circuit turns on the signal path and a third register circuit, coupled to the second summation circuit and the DC offset judgment circuit, for storing the second summation result, thereby providing a third register output as the filter output signal. 如請求項1所述的直流偏移保護電路,其中該直流偏移判斷電路用於將該濾波器輸出訊號與一正直流偏移臨界值以及一負直流偏移臨界值中的至少一者進行比較,以產生該直流偏移偵測結果,其中該直流偏移偵測結果指出該PWM訊號中是否存在一正直流成分或者是一負直流成分。 The DC offset protection circuit of claim 1, wherein the DC offset determination circuit is configured to perform the filter output signal with at least one of a positive DC offset threshold value and a negative DC offset threshold value and comparing to generate the DC offset detection result, wherein the DC offset detection result indicates whether there is a positive DC component or a negative DC component in the PWM signal. 一種用於一音訊系統的直流偏移保護方法,包含判斷互補的脈衝寬度調變(pulse-width modulation,PWM)訊號對的極性,並且據此產生一極性指示值,其中互補PWM訊號對之取樣樣本的位元數低於該極性指示值中的位元數,以及該極性指示值為帶有正負號的浮點數; 利用一級聯積分梳狀(cascaded integrator-comb,CIC)濾波器平均複數個極性指示值,以產生一濾波器輸出訊號;將該濾波器輸出訊號與至少一直流偏移臨界值比較,以產生一直流偏移偵測結果;以及依據該直流偏移偵測結果,控制該音訊系統的至少一部分。 A DC offset protection method for an audio system, comprising judging the polarity of a complementary pulse-width modulation (PWM) signal pair, and generating a polarity indication value accordingly, wherein the complementary PWM signal pair is sampled The number of bits of the sample is lower than the number of bits in the polarity indication value, and the polarity indication value is a signed floating point number; A cascaded integrator-comb (CIC) filter is used to average a plurality of polarity indications to generate a filter output signal; the filter output signal is compared with at least a DC offset threshold to generate a constant a flow offset detection result; and controlling at least a part of the audio system according to the DC offset detection result. 如請求項5所述的直流偏移保護方法,其中產生該極性指示值的步驟包含:根據該互補PWM訊號對中之一正PWM訊號的一取樣樣本以及一負PWM訊號的一取樣樣本之間的關係,產生該極性指示值。 The DC offset protection method of claim 5, wherein the step of generating the polarity indication value comprises: according to a difference between a sampling sample of a positive PWM signal and a sampling sample of a negative PWM signal in the pair of complementary PWM signals relationship to generate the polarity indication value. 如請求項5所述的直流偏移保護方法,其中利用該CIC濾波器平均該複數個極性指示值以產生該濾波器輸出訊號的步驟包含:利用一第一加總電路將該極性指示值與一第一暫存器輸出相加,產生一第一加總結果;利用一第一暫存器電路儲存該第一加總結果,並且據此提供該第一暫存器輸出;利用一第二加總電路,在一預定時間期滿之後從該第一暫存器輸出減去一第二暫存器輸出,以提供一第二加總結果;以及利用一第二暫存器電路,在一預定時間期滿之後儲存該第一暫存器輸出,並且據此提供該第二暫存器輸出;以及利用一第三暫存器電路儲存該第二加總結果,並且據此提供一第三暫存器輸出作為該濾波器輸出訊號。 The DC offset protection method of claim 5, wherein the step of using the CIC filter to average the plurality of polarity indication values to generate the filter output signal comprises: using a first summing circuit to add the polarity indication value to the A first register output is added to generate a first summation result; a first register circuit is used to store the first summation result, and the first register output is provided accordingly; a second register circuit is used to store the first summation result. summing circuit that subtracts a second register output from the first register output after a predetermined period of time expires to provide a second summing result; and utilizing a second register circuit, a storing the first register output after a predetermined time period expires, and providing the second register output accordingly; and utilizing a third register circuit to store the second summation result and providing a third register circuit accordingly The register output is used as the filter output signal. 如請求項5所述的直流偏移保護方法,其中將該濾波器輸出訊號與該至少一直流偏移臨界值比較,以產生該直流偏移偵測結果的步驟包含:於將該濾波器輸出訊號與一正直流偏移臨界值以及一負直流偏移臨界值中的至少一者進行比較,以產生該直流偏移偵測結果,其中該直流偏移偵測結果指出該PWM訊號中是否存在一正直流成分或者是一負直流成分。 The DC offset protection method of claim 5, wherein the step of comparing the filter output signal with the at least DC offset threshold to generate the DC offset detection result comprises: outputting the filter The signal is compared with at least one of a positive DC offset threshold and a negative DC offset threshold to generate the DC offset detection result, wherein the DC offset detection result indicates whether there is a presence in the PWM signal A positive DC component or a negative DC component.
TW110109059A 2021-03-15 2021-03-15 Direct current offset protection circuit and method TWI762239B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW110109059A TWI762239B (en) 2021-03-15 2021-03-15 Direct current offset protection circuit and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW110109059A TWI762239B (en) 2021-03-15 2021-03-15 Direct current offset protection circuit and method

Publications (2)

Publication Number Publication Date
TWI762239B true TWI762239B (en) 2022-04-21
TW202239144A TW202239144A (en) 2022-10-01

Family

ID=82199029

Family Applications (1)

Application Number Title Priority Date Filing Date
TW110109059A TWI762239B (en) 2021-03-15 2021-03-15 Direct current offset protection circuit and method

Country Status (1)

Country Link
TW (1) TWI762239B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050083116A1 (en) * 2003-10-15 2005-04-21 Texas Instruments Incorporated Detection of DC output levels from a class D amplifier
US20050151585A1 (en) * 2003-12-18 2005-07-14 Jun Honda Gate control circuit with soft start/stop function
US7576604B2 (en) * 2006-12-15 2009-08-18 Bin Xu All-digital class-D audio amplifier
US20160309274A1 (en) * 2013-12-02 2016-10-20 Suzhou Sonavox Electronics Co., Ltd. Implementation method and device of multi-bit modulation-based digital speaker system
WO2019215095A1 (en) * 2018-05-09 2019-11-14 Ams Ag Class-d amplifier and method for generating a driver signal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050083116A1 (en) * 2003-10-15 2005-04-21 Texas Instruments Incorporated Detection of DC output levels from a class D amplifier
US20050151585A1 (en) * 2003-12-18 2005-07-14 Jun Honda Gate control circuit with soft start/stop function
US7576604B2 (en) * 2006-12-15 2009-08-18 Bin Xu All-digital class-D audio amplifier
US20160309274A1 (en) * 2013-12-02 2016-10-20 Suzhou Sonavox Electronics Co., Ltd. Implementation method and device of multi-bit modulation-based digital speaker system
WO2019215095A1 (en) * 2018-05-09 2019-11-14 Ams Ag Class-d amplifier and method for generating a driver signal

Also Published As

Publication number Publication date
TW202239144A (en) 2022-10-01

Similar Documents

Publication Publication Date Title
CN1941613B (en) Class d amplifier
US7142050B2 (en) Recovery from clipping events in a class D amplifier
JP5157959B2 (en) Class D amplifier
US20130089223A1 (en) Output Power Limiter in an Audio Amplifier
JP2010130340A5 (en) Actuator driving method and power amplifier
US8421540B1 (en) Method and apparatus for run-time short circuit protection for amplifiers
US8872561B2 (en) Systems and methods for edge control based on detecting current direction in a switched output stage
EP2802074B1 (en) Amplifier circuit and amplification method
KR101067985B1 (en) Class D amplifier circuit
TWI762239B (en) Direct current offset protection circuit and method
CN110708022B (en) High-efficiency Class-D amplifier with reduced EMI generation
GB2575397A (en) Fully-differential current digital-to-analog converter
CN115243157A (en) DC offset protection circuit and method
JP4853176B2 (en) Class D amplifier
US11368130B1 (en) Direct current offset protection circuit and method
JP5980133B2 (en) Zero cross detector
JP2011202753A (en) Control device for solenoid valve
CN109995329B (en) Circuit for realizing static noise elimination function in D-type power amplifier and corresponding driving circuit
EP3910791B1 (en) Class-d amplifier with high dynamic range
JP6445360B2 (en) Current measuring device
JP2018125614A (en) Audio circuit, electronic apparatus using the same and on-vehicle audio system, and abnormality detection method
JP2009089289A (en) Class-d amplifier
KR20160115491A (en) Current detection apparatus of PWM module
US8983095B2 (en) Driver circuit
TWI584579B (en) Modulation selecting circuit of audio amplifier and method thereof