[go: up one dir, main page]

WO2024099038A1 - Gain control apparatus and method - Google Patents

Gain control apparatus and method Download PDF

Info

Publication number
WO2024099038A1
WO2024099038A1 PCT/CN2023/124936 CN2023124936W WO2024099038A1 WO 2024099038 A1 WO2024099038 A1 WO 2024099038A1 CN 2023124936 W CN2023124936 W CN 2023124936W WO 2024099038 A1 WO2024099038 A1 WO 2024099038A1
Authority
WO
WIPO (PCT)
Prior art keywords
voltage
gain
signal
amplifier
threshold voltage
Prior art date
Application number
PCT/CN2023/124936
Other languages
French (fr)
Chinese (zh)
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 武汉市聚芯微电子有限责任公司
Publication of WO2024099038A1 publication Critical patent/WO2024099038A1/en

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03GCONTROL OF AMPLIFICATION
    • H03G3/00Gain control in amplifiers or frequency changers
    • H03G3/20Automatic control
    • H03G3/30Automatic control in amplifiers having semiconductor devices

Definitions

  • the present application relates to the field of power amplifier gain control, and in particular to a gain control circuit of an amplifier and an electronic device having the circuit.
  • the audio output is generated by multiplying the input signal by the gain of the corresponding circuit, and its maximum output amplitude is generally determined by the supply voltage.
  • a protection mechanism needs to be added to the circuit, such as providing an automatic gain control (AGC) circuit in the front stage of the power amplifier.
  • AGC automatic gain control
  • a protection threshold can be set and the speaker output can be compared with it. If the signal amplitude is higher than the set threshold voltage, the AGC circuit can reduce the amplifier gain to avoid truncation distortion and protect the speaker; conversely, if the signal amplitude is lower than the set release threshold voltage, the AGC circuit will increase the amplifier gain to achieve the effect of increasing the volume and ensuring the sound quality.
  • each control circuit includes discrete electronic devices such as a comparator, this will increase the occupied area of the entire AGC control circuit and the power consumption of the circuit.
  • the present application provides an automatic gain control device and method, which can reduce circuit area and circuit power consumption while ensuring sound quality.
  • One aspect of the present invention provides a gain control device, which includes: a voltage detection circuit, configured to receive a detection voltage of an amplifier and compare the detection voltage with multiple threshold voltages in a preset order, and output a control signal based on the comparison result; a switching switch, coupling the multiple threshold voltages to the voltage detection circuit in the preset order to compare with the detection voltage; and a gain control circuit, configured to output a gain signal to the amplifier based on the control signal output by the voltage detection circuit.
  • the device further includes: a mode signal generating circuit configured to generate a mode signal based on a magnitude relationship between the multiple threshold voltages, the mode signal being associated with the preset order of comparing the multiple threshold voltages with the detection voltage respectively.
  • a mode signal generating circuit configured to generate a mode signal based on a magnitude relationship between the multiple threshold voltages, the mode signal being associated with the preset order of comparing the multiple threshold voltages with the detection voltage respectively.
  • the multiple threshold voltages include a first threshold voltage and at least one fixed threshold voltage
  • the first threshold voltage is associated with the supply voltage of the amplifier
  • the mode signal is determined based on a comparison result of the first threshold voltage and the at least one fixed threshold voltage.
  • the voltage detection circuit includes: a plurality of comparators, one input terminal of each comparator is coupled to the detection voltage of the amplifier, and another input terminal of each comparator is coupled to one of the plurality of threshold voltages.
  • control signal includes a gain increase control signal, a gain decrease control signal, and a zero-crossing signal.
  • the plurality of comparators include a first comparator having a positive input terminal coupled to a detection voltage of the amplifier and a negative input terminal coupled to a common mode level, and the zero-crossing signal is determined based on an output of the first comparator.
  • the multiple comparators include a second comparator, whose positive input and reverse input are respectively coupled to one of the multiple threshold voltages and the detection voltage of the amplifier via the switching switch, and the increased gain control signal is determined at least based on the output of the second comparator.
  • the multiple comparators include a third comparator and a fourth comparator, the inverting input terminal of the third comparator is coupled to the detection voltage of the amplifier, and the other end is coupled to one of the multiple threshold voltages via the switching switch, the positive input terminal of the fourth comparator is coupled to the detection voltage of the amplifier, and the other end is coupled to one of the multiple threshold voltages via the switching switch, and the gain reduction control signal is determined based on at least the outputs of the third comparator and the fourth comparator.
  • the voltage detection circuit further includes: a first reduced gain control signal generating circuit, which includes N triggers connected in series, and the C terminal of each trigger is coupled to the output terminal of the third comparator and the fourth comparator, N ⁇ 2.
  • the zero-crossing signal is further configured to clear the outputs of the N flip-flops.
  • the voltage detection circuit further comprises: a second gain reduction control signal generating
  • the circuit comprises an AND gate operation unit, a first input end of the AND gate operation unit is coupled to the first reduced gain control signal generating circuit, and a second input end of the AND gate operation unit is coupled to the outputs of the third comparator and the fourth comparator.
  • the gain control device further includes: a switching signal generating circuit configured to generate a switch switching signal of the switch based on a result of comparing the detection voltage of the amplifier with the plurality of threshold voltages.
  • the mode signal generating circuit includes: a fifth comparator, whose positive input terminal and reverse input terminal are respectively coupled to the first threshold voltage and the fixed at least one level threshold voltage via a mode switching switch; a second trigger, whose C terminal is coupled to the output terminal of the fifth comparator; a third trigger, whose C terminal is coupled to the output terminal of the fifth comparator via an inverter, and whose D terminal is connected to the Q terminal of the second trigger; wherein the mode signal is determined based on the Q terminal outputs of the second trigger and the third trigger.
  • the voltage detection circuit is configured to output the control signal according to the comparison result and the mode signal.
  • One aspect of the present invention provides a gain control method, which includes: determining multiple threshold voltages, the multiple threshold voltages include a first threshold voltage and at least one fixed threshold voltage, wherein the first threshold voltage is associated with the supply voltage of the amplifier; comparing the first threshold voltage with the at least one fixed threshold voltage, and determining a mode signal for gain control according to the comparison result; comparing the detection voltage of the amplifier with the multiple threshold voltages in a preset order, and outputting a control signal according to the comparison result, wherein the mode signal is associated with the preset order in which the multiple threshold voltages are compared with the detection voltage; wherein a first gain reduction control signal is output when the detection voltage of the amplifier is greater than the first threshold voltage; and when there is at least one threshold voltage less than the first threshold voltage and the detection voltage of the amplifier is greater than the at least one fixed threshold voltage, another corresponding gain reduction control signal is output, and the first gain reduction control signal is configured to have a higher priority than the other gain reduction control signal.
  • the fixed at least one level threshold voltage includes at least a second threshold voltage and a third threshold voltage
  • comparing the first threshold voltage with the fixed at least one level threshold voltage, and determining the mode signal of the gain control according to the comparison result includes: when the first threshold voltage is greater than the second threshold voltage and the third threshold voltage, determining the mode signal as the first mode signal; when the first threshold voltage is between the second threshold voltage and the third threshold voltage, The mode signal is determined to be a second mode signal; when the first threshold voltage is less than the second threshold voltage and the third threshold voltage, the mode signal is determined to be a third mode signal.
  • the comparing the detection voltage of the amplifier with the multiple threshold voltages in a preset order and outputting a control signal according to the comparison result includes: under a first mode signal, outputting a third gain reduction control signal when the detection voltage of the amplifier is greater than the third threshold voltage, outputting a second gain reduction control signal when the detection voltage of the amplifier is greater than the second threshold voltage, and outputting the first gain reduction control signal when the detection voltage of the amplifier is greater than the first threshold voltage; under a second mode signal, outputting the third gain reduction control signal when the detection voltage of the amplifier is greater than the third threshold voltage, outputting the first gain reduction control signal when the detection voltage of the amplifier is greater than the first threshold voltage, and under a third mode signal, outputting the first gain reduction control signal when the detection voltage of the amplifier is greater than the first threshold voltage, wherein the first gain reduction control signal, the second gain reduction control signal, and the third gain reduction control signal are associated with different gain reduction start times.
  • the method further includes comparing a detection voltage of the amplifier with a fixed fourth threshold voltage, and outputting an increase gain control signal in response to when the detection voltage of the amplifier is less than the fourth threshold voltage, wherein the first decrease gain control signal is configured to have a higher priority than the increase gain control signal.
  • Another aspect of the present invention provides an audio device, comprising the gain control device described above, and a speaker coupled to the gain control device.
  • the exemplary gain control device provided by the present invention, by setting a switching switch to switch between multiple threshold voltages in a preset order, the reuse of circuit elements can be achieved, thereby simplifying the analog circuit structure. Under the premise of ensuring the increase of volume and the reduction of output truncation noise, the occupied area of the gain control circuit can be reduced and the power consumption of the circuit can be reduced.
  • FIG1 is a schematic structural block diagram of a gain control device according to an embodiment of the present invention.
  • FIG2 is a schematic structural block diagram of a gain control device according to an embodiment of the present invention.
  • FIG. 3 is a schematic circuit diagram of a voltage detection circuit in a gain control device according to an embodiment of the present invention.
  • FIG. 4 is a schematic circuit diagram of a mode signal generating circuit in a gain control device according to an embodiment of the present invention.
  • FIG5 is a flow chart of a gain control method according to an embodiment of the present invention.
  • FIG. 6 is a flow chart of a method for performing gain control according to a gain control mode according to an embodiment of the present invention
  • FIG7 is a gain control signal effect diagram in a control mode according to an embodiment of the present invention.
  • FIG8 is a gain control signal effect diagram in another control mode according to an embodiment of the present invention.
  • FIG. 9 is a diagram showing the effect of a gain control signal in another control mode according to an embodiment of the present invention.
  • the gain control device may include a voltage detection circuit 110, a switch 120, and a gain control circuit 130.
  • the gain control device may provide a gain signal for the audio amplifier.
  • the voltage detection circuit 110 in the gain control device may receive a detection voltage and other signals of the amplifier 100.
  • the detection voltage may be, for example, the output voltage signal V OUT of the amplifier 100 shown in FIG1 , that is, the voltage detection circuit 110 is coupled to the output end of the amplifier 100.
  • the voltage detection circuit 110 may also be coupled to the input end of the amplifier, and the detection voltage may be the input voltage signal V IN of the amplifier 100 accordingly.
  • the corresponding amplifier output voltage value may be obtained by gain conversion.
  • the detection voltage of the amplifier 100 may also be a voltage signal after the output voltage signal V OUT or the input voltage signal V IN is reduced in voltage.
  • the voltage detection circuit 110 can compare the detection voltage with a plurality of threshold voltages in a preset order, and output a control signal as a basis for determining the gain control according to the comparison result.
  • the threshold voltages can be stored in a predetermined register, for example, and the number of the threshold voltages can be It is determined according to the gain control accuracy. For example, more than 3 (for example, 4, 5, 6, etc.) threshold voltages may be set.
  • the control signal may include a gain increase control signal, a gain decrease control signal and a zero-crossing signal.
  • the voltage detection circuit 110 may generate a zero-crossing signal; when the detection voltage is less than a set threshold voltage (for example, a release threshold), the voltage detection circuit 110 may generate a gain increase control signal; and when the detection voltage is greater than another set threshold voltage (for example, a start threshold), the voltage detection circuit 110 may generate a gain decrease control signal, and the generated control signal may be output to the gain control circuit.
  • a set threshold voltage for example, a release threshold
  • the voltage detection circuit 110 may generate a gain increase control signal
  • another set threshold voltage for example, a start threshold
  • the voltage detection circuit 110 may generate a gain decrease control signal, and the generated control signal may be output to the gain control circuit.
  • multiple levels of start threshold voltages may be set, and the number of the start threshold voltages may be determined according to the gain control accuracy. For example, more than 2 (for example, 3, 4, etc.) start threshold voltages may be set.
  • Different start threshold voltages may correspond to different gain decrease control signals, that is, when the detection voltage is greater than one of the start threshold voltages, the voltage detection circuit 110 may generate a corresponding level of gain decrease control signal. Different levels of gain reduction control signals may be associated with different gain reduction start-up times.
  • the gain reduction start-up time corresponding to a larger start-up threshold voltage may be smaller than the gain reduction start-up time corresponding to a smaller start-up threshold voltage, so that when it is detected that the output voltage of the amplifier 100 is large (for example, close to the truncation voltage), the gain control device can respond quickly to reduce the gain of the amplifier to avoid truncation noise, and when the output voltage of the amplifier 100 is small, the amplifier can be controlled to smoothly reduce the gain to ensure a stable volume.
  • one of the threshold voltages can be configured to be related to the supply voltage of the amplifier 100, while the other threshold voltages can be configured to be pre-set fixed values.
  • the magnitude of the first threshold voltage can be configured to be associated with the magnitude of the supply voltage of the amplifier 100, for example, the two are positively correlated, that is, the value of the first threshold voltage decreases as the supply voltage decreases.
  • Configuring the first threshold voltage to be specifically set according to the actual supply voltage of the amplifier can reduce the power consumption of the audio power amplification system at low power, for example, while preventing truncation distortion.
  • the first threshold voltage in the multi-level threshold voltage can also be compared with the remaining fixed threshold voltages, and the gain control mode can be determined based on the comparison result.
  • the detection voltage of the amplifier can be compared with each threshold voltage in different comparison orders, and different gain control signals may be generated, which will be described in detail later.
  • One end of the switch 120 is coupled to a plurality of threshold voltages, and one or more of the threshold voltages may be coupled to the voltage detection circuit 110 in a predetermined order to be compared with the detection voltage.
  • the switch 120 may have a multi-pole multi-throw configuration, or may be configured by The switch is composed of several single-pole multi-throw or double-pole multi-throw switches.
  • the switches' poles can be connected to circuit elements such as comparators inside the voltage detection circuit 110, and the throws can be connected to different threshold voltages.
  • Each switch can be implemented in a variety of ways, including but not limited to field effect transistors, bipolar transistors, diodes and/or other types of switches.
  • the present invention sets a switching switch 120, which can, for example, couple different threshold voltages to the same comparator in the voltage detection circuit 110 in a preset order under the control of a switch switching signal, thereby achieving the effect of multiplexing the comparator in the voltage detection circuit 110.
  • a switching switch 120 can, for example, couple different threshold voltages to the same comparator in the voltage detection circuit 110 in a preset order under the control of a switch switching signal, thereby achieving the effect of multiplexing the comparator in the voltage detection circuit 110.
  • the number of analog circuit modules in the voltage detection circuit can be reduced, thereby reducing the circuit's occupied area and reducing the circuit's power consumption.
  • the input end of the gain control circuit 130 is coupled to the voltage detection circuit 110, and the gain control circuit 130 can receive the control signal output by the voltage detection circuit 110 and generate a gain signal based on the control signal, and then output the gain signal to the amplifier 100.
  • the gain control circuit 130 can generate a gain increase signal to control the amplifier 100 to increase the gain, and when receiving the decrease gain control signal, it can generate a gain decrease signal to control the amplifier 100 to decrease the gain, so as to maintain the output voltage of the amplifier within a preset range.
  • FIG2 is a schematic structural block diagram of a gain control device according to an embodiment of the present invention, which includes a voltage detection circuit 110, a switching switch 120, and a gain control circuit 130.
  • the arrangement and functions of these devices or circuits are the same as those of the circuit shown in FIG1 and are not described in detail here.
  • the gain control device further includes a switching signal generating circuit 140, which can be configured to generate a switch switching signal to control the switch 120 to couple multiple threshold voltages to the voltage detection circuit 110.
  • the switch switching signal can be generated based on the result of comparing the detection voltage of the amplifier 100 with multiple threshold voltages.
  • the switch 120 can couple multiple threshold voltages connected to different throws to the voltage detection circuit 110 in a preset order. As shown in FIG2 , the switch 120 is connected to four threshold voltages through its multiple throws S1, S2, S3, and S4. Although only four throws are shown connected to four threshold voltages in the figure, it can be understood that it is only an example and not a limitation.
  • the switch 120 can also connect the multiple threshold voltages to the voltage detection circuit 110 through its multiple blades (not shown).
  • the throw S4 is connected to the release threshold voltage RLS_Vref, while the throws S1 , S2 , S3 are connected to the multi-level start threshold voltages AGC1_Vref, AGC2_Vref, and AGC3_Vref, respectively.
  • the switching signal generating circuit 140 can be configured to detect the voltage of the amplifier 100 and multiple The threshold voltages are compared in a preset order (e.g., ascending order) to generate corresponding switch switching signals, so that the output voltage of the amplifier 100 can be smoothly increased. For example, for the example of FIG. 2 , assuming that AGC1_Vref>AGC2_Vref>AGC3_Vref>RLS_Vref, the switch signal generation circuit 140 can first output a default switch switching signal to close the throw S4 so as to couple RLS_Vref to the voltage detection circuit 110.
  • a preset order e.g., ascending order
  • the switch signal generation circuit 140 can generate a new switch signal to close the throw S3 so as to couple AGC3_Vref to the voltage detection circuit 110. After that, after the detection voltage is greater than AGC3_Vref, the switch signal generation circuit 140 can generate a new switch signal to close the throw S2 so as to couple AGC2_Vref to the voltage detection circuit 110. After that, after the detection voltage is greater than AGC2_Vref, the switch signal generation circuit 140 can generate a new switch signal to close the throw S1 so as to couple AGC1_Vref to the voltage detection circuit 110.
  • the switching switch 120 can couple the illustrated multiple threshold voltages to the voltage detection circuit 110 in the order of RLS_Vref ⁇ AGC3_Vref ⁇ AGC2_Vref ⁇ AGC1_Vref.
  • the threshold voltage is set to more than 4 (for example, 5, 6, etc.)
  • the switching signal can be deduced accordingly.
  • the switching signal generating circuit 140 can be implemented by a conventional comparator circuit.
  • the switching signal generating circuit 140 can be implemented by multiplexing the comparator circuit in the voltage detection circuit 110.
  • the release threshold voltage RLS_Vref can be associated with the gain control signal. If the voltage detection circuit 110 detects that the detection voltage of the amplifier is less than the threshold voltage, it will generate the gain control signal RLS_FLAG.
  • the start threshold voltages AGC3_Vref, AGC2_Vref, and AGC1_Vref can be associated with the gain control signal.
  • the voltage detection circuit 110 can generate corresponding gain control signals AGC3_FLAG, AGC2_FLAG, and AGC1_FLAG and output the corresponding control signal to the gain control circuit 130.
  • the voltage detection circuit 110 can also generate a zero crossing signal ZeroCross_FLAG.
  • the gain control circuit 130 may generate a gain signal according to a preset gain change logic and transmit the gain signal to the amplifier 100. To control the reduction or recovery of the gain of the amplifier.
  • the gain control circuit 130 can generate a gain signal for increasing the gain to control the amplifier 100 to increase the gain, and when receiving AGC3_FLAG, AGC2_FLAG or AGC1_FLAG, a gain signal for reducing the gain can be generated according to different levels of the corresponding gain reduction control signal to control the amplifier 100 to reduce the gain, thereby maintaining the output voltage of the amplifier within a preset range.
  • the gain reduction control signals AGC1_FLAG, AGC2_FLAG, and AGC3_FLAG can be configured to be associated with different gain reduction start times, for example, the gain reduction start times of AGC1_FLAG, AGC2_FLAG, and AGC3_FLAG are successively increased.
  • the gain control circuit 130 can trigger timing when the signal is triggered, and generate a gain signal to reduce the gain of the amplifier after determining that the signal is maintained or reaches a certain time, and after receiving the control signal AGC1_FLAG, the gain signal can be immediately generated to reduce the gain of the amplifier. In this way, when, for example, it is monitored that the detection voltage of the amplifier is greater than AGC1_Vref, the gain of the amplifier can be quickly reduced to avoid truncation distortion.
  • AGC1_FLAG, AGC2_FLAG, AGC3_FLAG, and RLS_FLAG can be configured to have different priorities, for example, the priorities of AGC1_FLAG, AGC2_FLAG, and AGC3_FLAG decrease in sequence, that is, AGC1_FLAG has the highest priority among all control signals, and once it is triggered, all other control signals being timed are invalid, and the corresponding timing is reset.
  • This can prevent logical conflicts between different gain reduction control signals, so that when, for example, the detection voltage of the amplifier is detected to be greater than AGC1_Vref, the gain of the amplifier is quickly reduced to avoid truncation distortion.
  • one of the multi-level startup threshold voltages AGC1_Vref, AGC2_Vref, and AGC3_Vref associated with the gain reduction control signal can vary with the supply voltage of the amplifier, for example, the magnitude of the threshold voltage AGC1_Vref associated with the control signal AGC1_FLAG with the highest priority varies according to the actual supply voltage of the amplifier 100. In this way, when the supply voltage of the amplifier fluctuates (for example, lower than the rated voltage), the threshold voltage AGC1_Vref for monitoring truncation distortion can be reduced accordingly, thereby improving the applicability of the gain control device.
  • AGC1_Vref When AGC1_Vref changes with the actual supply voltage of the amplifier, its actual value may be greater than AGC2_Vref and AGC3_Vref, or between AGC2_Vref and AGC3_Vref, or less than AGC2_Vref and AGC3_Vref.
  • AGC2_Vref and AGC1_Vref are coupled to the voltage detection circuit 110 under the control of the switch switching signal generated by the switch signal generating circuit 140.
  • the gain control device further includes a mode signal generating circuit 150, which may be configured to generate a mode signal (MODE_FLAG) based on the magnitude relationship between the multiple threshold voltages AGC1_Vref, AGC2_Vref, and AGC3_Vref, and the mode signal may be associated with a preset sequence of comparing the multiple threshold voltages with the detection voltages, that is, the mode signal is associated with the switching sequence of the switch 120.
  • a mode signal generating circuit 150 may be configured to generate a mode signal (MODE_FLAG) based on the magnitude relationship between the multiple threshold voltages AGC1_Vref, AGC2_Vref, and AGC3_Vref, and the mode signal may be associated with a preset sequence of comparing the multiple threshold voltages with the detection voltages, that is, the mode signal is associated with the switching sequence of the switch 120.
  • the mode signal generating circuit 150 may output the mode signal MODE_FLAG to the switching signal generating circuit 140, which determines the comparison sequence between the detection voltage of the amplifier and the multiple threshold voltages accordingly after receiving the MODE_FLAG, and generates a corresponding switch switching signal to control the switch 120 to couple the corresponding threshold voltages to the voltage detection circuit 110 in the aforementioned preset sequence.
  • the mode signal generating circuit 150 can determine the corresponding mode signal based on the comparison relationship between the threshold voltages AGC1_Vref, AGC2_Vref, and AGC3_Vref related to reducing the gain control signal. Since only the threshold voltage AGC1_Vref is variable according to the actual supply voltage of the amplifier, the AGC1_Vref can be compared with AGC2_Vref and AGC3_Vref and the mode signal can be determined based on the comparison result. Moreover, the number of mode signals is the same as the number of the set start threshold voltages.
  • the mode signal generating circuit 150 when AGC1_Vref is greater than AGC2_Vref and AGC3_Vref, the mode signal generating circuit 150 generates a default mode signal MODE1_FLAG; when AGC1_Vref is between AGC2_Vref and AGC3_Vref, the mode signal generating circuit 150 generates a second mode signal MODE2_FLAG; and when AGC1_Vref is less than AGC2_Vref and AGC3_Vref, the mode signal generating circuit 150 generates a third mode signal MODE3_FLAG.
  • Different mode signals determine the order in which the detection voltage of the amplifier is compared with the threshold voltages of each level, and accordingly, they determine the switching order of the switches S1-S4, so that, for example, the detection voltage of the amplifier can be compared with the threshold voltages of each level in a preset order (for example, ascending order).
  • a preset order for example, ascending order.
  • the switching sequence of the switch can be S4 ⁇ S3 ⁇ S1 (because the gain will be immediately reduced when the detection voltage is greater than AGC1_Vref, the switch generally does not need to be switched to S2).
  • the switching sequence of the switch can be S4 ⁇ S1. The switching control of the switch under different mode signals will be described in detail later in conjunction with Figures 6-8.
  • the voltage detection circuit 110 can generate control signals with different timings under different mode signals. Accordingly, the gain control circuit 130 will generate different gain signals to achieve gain control of the amplifier, which can improve the applicability of the gain control device. For example, even when the supply voltage of the amplifier is at a low potential, the output voltage of the amplifier can still be smoothly increased, and truncation distortion can be prevented, while reducing system power consumption.
  • the mode signal MODE_FLAG may also be output to the voltage detection circuit 110 for determining the generation of a portion of the gain control signal, which will be described in detail below in conjunction with FIG. 3 .
  • FIG3 is a schematic circuit diagram of a voltage detection circuit in a gain control device according to an embodiment of the present invention, which is implemented as an analog circuit.
  • the voltage detection circuit may include a plurality of comparators 202-208, one input end of each comparator is directly or through a switching switch (the switch blade and the throw and the threshold voltage connected to each throw are shown in FIG3) coupled to the detection voltage AGC_IN of the amplifier 100, and the other input end is directly coupled to the voltage (common mode level) for judging whether the detection voltage is zero-crossing or coupled to one of the plurality of threshold voltages through the switching switch.
  • the present embodiment only needs to set 4 comparators to realize the multi-stage gain control of the amplifier, while the prior art method will require at least 9 comparators, therefore, the present embodiment can simplify the analog circuit structure, reduce the circuit occupation area and reduce the circuit power consumption.
  • the positive input terminal of the first comparator 202 is coupled to the detection voltage AGC_IN of the amplifier, and the reverse input terminal is coupled to the common mode level VCM.
  • VCM common mode level
  • the zero-crossing signal can be used together with the gain reduction control signal (AGC1_FLAG, AGC2_FLAG, AGC3_FLAG) and/or the gain increase control signal (RLS_FLAG) to determine the gain signal to control the gain of the amplifier.
  • the XOR gate 212 compares the delayed comparison signal obtained after the zero-crossing signal ZeroCross_FLAG passes through the delay circuit 210 (composed of an inverter and a delay unit in series) with the zero-crossing signal After ZeroCross_FLAG is processed accordingly, a clear signal CLR_FLAG is output.
  • the clear signal CLR_FLAG flips to a high level when a zero-crossing signal is output.
  • the clear signal CLR_FLAG can be used to clear the outputs of the triggers 220 and 222, which will also be described in detail later.
  • the positive input terminal and the reverse input terminal of the second comparator 204 are respectively coupled to a release threshold voltage RLS_Vref associated with the gain control and the detection voltage AGC_IN of the amplifier among the multiple threshold voltages via a switching switch, wherein RLS_Vref includes a pair of threshold voltages RLS_VH and RLS_VL whose absolute values of the difference with the common mode voltage VCM are equal but are positive and negative to each other, so as to judge whether the gain needs to be increased when the detection voltage AGC_IN is positive and negative respectively.
  • the switching of the threshold voltage can be performed based on the switch switching signal.
  • the switch switching signal can control the positive input terminal of the comparator 204 to be connected to the threshold voltage RLS_VH, and the reverse input terminal to be connected to the detection voltage AGC_IN, and when the detection voltage signal AGC_IN is in a low level phase, such as AGC_IN ⁇ VCM (for example, for a sinusoidal signal, the phase is ⁇ -3/2 ⁇ ), the switch switching signal will control the positive input terminal of the comparator 204 to be connected to the detection voltage AGC_IN, and the reverse input terminal to be connected to the threshold voltage RLS_VL.
  • a high level phase such as AGC_IN>VCM (for example, for a sinusoidal signal, the phase is 0- ⁇ /2)
  • the switch switching signal can control the positive input terminal of the comparator 204 to be connected to the threshold voltage RLS_VH, and the reverse input terminal to be connected to the detection voltage AGC_IN
  • a low level phase such as AGC_IN ⁇ VCM
  • the comparator 204 will output the gain control signal RLS_FLAG.
  • the gain control signal RLS_FLAG can be output through an AND gate operation unit 216, a first input end of the AND gate operation unit 216 receiving the output signal of the comparator 204, and a second input end receiving the output of the NOR gate 214, the NOR gate 214 being provided with three input ends, which respectively receive the gain control signals AGC1_FLAG, AGC2_FLAG, and AGC3_FLAG being reduced.
  • the third comparator 206 and the fourth comparator 208 are used to determine at least one gain reduction control signal.
  • the inverting input terminal of the third comparator 206 is coupled to the detection voltage AGC_IN of the amplifier, and the other end is coupled to one of the threshold voltages (AGC1_VL, AGC2_VL, AGC3_VL) via a switching switch.
  • the positive input terminal of the fourth comparator 208 is coupled to the detection voltage AGC_IN of the amplifier, and the other end is coupled to one of the threshold voltages (AGC1_VH, AGC2_VH, AGC3_VH) via a switching switch.
  • threshold voltages AGC1_VL, AGC2_VL, AGC3_VL are respectively associated with the threshold voltages AGC1_VH, AGC2_VH, AGC3_VH, for example, the absolute values of the differences between AGC1_VL, AGC1_VH and the common mode voltage VCM are equal, but the positive and negative values are opposite, and the same is true for AGC2_Vref and AGC3_Vref.
  • the voltage pair (AGC1_VH, AGC1_VL), (AGC2_VH, AGC2_VL), (AGC3_VH, AGC3_VL) correspond to AGC1_Vref, AGC2_Vref, AGC3_Vref shown in FIG2 , respectively.
  • the switch control signal can simultaneously control the positive input terminal of the third comparator 206 and the negative input terminal of the fourth comparator 208 to be coupled to a pair of threshold voltage pairs, respectively.
  • the comparators 206 and 208 are respectively connected to three threshold voltages, it can be understood that fewer (e.g., 2) or more (e.g., 4) threshold voltages can be set based on actual needs.
  • AGC1_VH, AGC2_VH, and AGC3_VH can be set according to actual needs.
  • the relationship is AGC1_VH>AGC2_VH>AGC3_VH.
  • the value of the first threshold voltage (for example, the voltage pair of AGC1_VH and AGC1_VL) among the three threshold voltages can be positively correlated with the supply voltage of the amplifier 100, and the other two threshold voltages AGC2_VH/AGC2_VL and AGC3_VH/AGC3_VL are configured to have fixed values, so when the supply voltage of the amplifier is small, the actual AGC1_VH may be between AGC2_VH and AGC3_VH, or less than AGC2_VH and AGC3_VH.
  • the threshold voltages AGC1_VH, AGC2_VH, and AGC3_VH will be coupled to the inverting input terminal of the comparator 208 in a corresponding preset order. Accordingly, the threshold voltages AGC1_VL, AGC2_VL, AGC3_VL will also be coupled to the positive input terminal of the comparator 206 in a predetermined order.
  • the outputs of the third comparator 206 and the fourth comparator 208 are outputted after being ORed by the OR gate 218, which can be used to determine at least one gain reduction control signal.
  • the OR gate 218, can be used to determine at least one gain reduction control signal.
  • the output of the OR gate 218 can be used to determine AGC3_FLAG
  • AGC_IN exceeds AGC2_VH or is lower than AGC2_VL the output of the OR gate 218 can be used to determine AGC2_FLAG
  • AGC_IN exceeds AGC1_VH or is lower than AGC1_VL the output of the OR gate 218 can be used to determine AGC1_FLAG.
  • each gain reduction control signal (e.g., AGC1_FLAG, AGC2_FLAG, AGC3_FLAG) for the gain control circuit 130 to determine the gain signal of the amplifier, a separate gain control signal generation circuit is required to generate each gain reduction control signal separately.
  • each gain reduction control signal can be separated by a trigger.
  • each trigger 220, 222 is coupled to the output terminal of the third comparator 206 and the fourth comparator 208 through the OR gate 218.
  • the D terminal of the trigger 220 is coupled to the pull-up level. Since the detection voltage AGC_IN of the amplifier exceeds the ratio When AGC3_VH connected to comparator 208 is lower than AGC3_VL connected to comparator 206, OR gate 218 will output a rising edge signal. The output pulse signal can trigger trigger 220 to output a high level at the Q end. Therefore, the gain control signal AGC3_FLAG can be reduced based on the Q end output of trigger 220.
  • the Q terminal of the trigger 220 is connected to the D terminal of the trigger 222.
  • the switch can connect the threshold voltages AGC2_VH and AGC2_VL to the comparator 208 and the comparator 206 respectively under the control of the switching signal.
  • the OR gate 218 will output a high level again, and the output pulse signal can trigger the trigger 222 to output a high level at the Q terminal, so the gain control signal AGC2_FLAG can be determined based on the Q terminal output of the trigger 222.
  • the clear terminal CLR of the triggers 220 and 222 is coupled to the clear signal CLR_FLAG output by the XOR gate 212, which is used to clear the Q terminal output of the trigger when the detection voltage AGC_IN passes through zero.
  • a third flip-flop (not shown) connected in series with the flip-flop 222 may be set to determine the reduced gain control signal AGC1_FLAG.
  • the gain reduction control signal generating circuit of AGC1_FLAG can be implemented by other circuit modules to adapt to the situation that the threshold voltage AGC1_VH/AGC1_VL varies with the supply voltage of the amplifier.
  • FIG3 shows a specific embodiment.
  • an AND gate operation unit 224 can be set to determine the gain reduction control signal AGC1_FLAG.
  • the first input terminal of the AND gate 224 is coupled to the gain reduction control signal AGC2_FLAG output by the trigger 222 through the OR gate 226.
  • the second input terminal of the AND gate 224 is coupled to the outputs of the third comparator 206 and the fourth comparator 208 through the OR gate 218.
  • the first input terminal of the OR gate 226 is coupled to the output signal of the last trigger of the plurality of serially connected triggers 220 and 222, and the input of the second input terminal of the OR gate 226 is coupled to the mode signal through a gate circuit.
  • the second input terminal receives the output of the OR gate 228, and the first input terminal of the OR gate 228 is coupled to the mode signal MODE3_FLAG.
  • the second input terminal of the OR gate 230 receives the output of the AND gate 230, and the first input terminal of the AND gate 230 is coupled to the mode signal MODE2_FLAG, and the second input terminal of the AND gate 230 is coupled to the output signal AGC3_FLAG of the trigger 220.
  • the voltage detection circuit determines AGC1_FLAG according to the voltage comparison result and the mode signal, so as to adapt to different gain control modes. For example, in mode MODE2 (AGC2_VH>AGC1_VH>AGC3_VH), the gain control signal AGC1_FLAG can be triggered before AGC2_FLAG, and in mode MODE3 (AGC2_VH>AGC3_VH> In the case of AGC1_VH, the gain control signal AGC1_FLAG may be triggered before AGC2_FLAG and AGC3_FLAG.
  • AGC1_FLAG AGC1_FLAG according to the voltage comparison result and the mode signal
  • FIG4 is a schematic circuit diagram of a mode signal generating circuit in a gain control device according to an embodiment of the present invention, which can be applied to the case where three start-up threshold voltages (AGC1_Vref, AGC2_Vref, AGC3_Vref) are provided as shown in FIG2-3.
  • the mode signal generating circuit may include a comparator 302 and two triggers 304 and 306.
  • the positive input terminal and the reverse input terminal of the comparator 302 are respectively coupled to the first threshold voltage (e.g., AGC1_VL) and the fixed threshold voltage (e.g., AGC2_VL, AGC3_VL) via a switching switch 308.
  • the switching switch 308 can be controlled by the mode signal MODE2_FLAG. Specifically, when MODE2_FLAG is 0 (e.g., when the system works in the default MODE1), its inverted signal is 1, and at this time, the positive input terminal of the comparator 302 is coupled to AGC1_VL, and the reverse input terminal is coupled to AGC2_VL. When MODE2_FLAG is 1, the positive input of the comparator 302 is coupled to AGC3_VL, and the negative input is coupled to AGC1_VL.
  • the D terminal of the trigger 304 is coupled to the pull-up level, and its C terminal is coupled to the output terminal of the comparator 302, and its Q terminal output can be used to determine the mode signal MODE2_FLAG.
  • the C terminal of the trigger 306 is coupled to the output terminal of the comparator 302 via the inverter 310, and the D terminal is connected to the Q terminal of the trigger 304.
  • the mode signal MODE3_FLAG can be determined based on the Q terminal output of the trigger 306.
  • the working principle of the mode signal generating circuit shown in Figure 4 is as follows: in the initial state, the positive input terminal of the comparator 302 is coupled to AGC1_VL, and the reverse input terminal is coupled to AGC2_VL. If the system is in the default MODE1 (ie, AGC1_VL ⁇ AGC2_VL), the comparator 302 outputs a low level, and the outputs of the triggers 304 and 306 are also low levels, that is, MODE2_FLAG and MODE3_FLAG are both 0, and the output at the inverter 312 is 1, so the switching switch 308 does not switch.
  • MODE1 ie, AGC1_VL ⁇ AGC2_VL
  • AGC1_VL changes and the working mode is no longer MODE1, for example, AGC1_VL>AGC2_VL
  • the output of comparator 302 changes from low to high, and the output pulse signal can trigger trigger 304 to output a high level at the Q end, that is, MODE2_FLAG is 1.
  • the switch 308 switches, that is, the positive input end of comparator 302 will be coupled to AGC3_VL, and the reverse input end will be coupled to AGC1_VL. If AGC1_VL ⁇ AGC3_VL, then comparator 302 still outputs a high level, and the mode signal MODE2_FLAG is still 1.
  • FIG. 4 illustrates a specific circuit structure
  • the present application is not limited thereto.
  • a person skilled in the art may design a corresponding circuit through a comparator or a trigger to determine the mode signal.
  • FIG5 shows a flow chart of a gain control method according to an embodiment of the present invention. As shown in FIG5 , the control method may include the following steps:
  • Step 410 determining a plurality of threshold voltages, where the plurality of threshold voltages may include a first threshold voltage and at least one fixed threshold voltage, wherein the first threshold voltage is associated with a supply voltage of the amplifier.
  • a multi-level startup threshold voltage AGC1_Vref, AGC2_Vref, AGC3_Vref and a release threshold voltage RLS_Vref can be determined according to actual needs, wherein each level of startup threshold voltage includes a pair of positive and negative threshold voltages, for example, AGC1_Vref includes a positive value AGC1_VH and a corresponding negative value AGC1_VL, and AGC2_Vref, AGC3_Vref and so on.
  • the multi-level threshold voltage may include a first threshold voltage (for example, threshold voltage AGC1_Vref) associated with the supply voltage of the amplifier, and the remaining at least one level of threshold voltage AGC2_Vref, AGC3_Vref can be configured to have a fixed preset value (hereinafter referred to as the second threshold voltage and the third threshold voltage, respectively).
  • the present invention can adjust the gain control mode according to the actual supply voltage of the amplifier, thereby improving the applicability of the gain control and reducing the power consumption of the circuit.
  • fewer (for example, 2 levels) or more (for example, 4 levels) startup threshold voltages can be determined according to actual needs, that is, the gain control method of this embodiment is not limited to application to the gain control device shown in FIG. 2-3.
  • Step 420 compare the first threshold voltage with the fixed at least one level threshold voltage, and determine a gain control mode signal according to the comparison result.
  • the first threshold voltage AGC1_Vref is related to the supply voltage of the amplifier, its actual value may be greater than the threshold voltages AGC2_Vref and AGC3_Vref, or may be less than the threshold voltages AGC2_Vref and AGC3_Vref.
  • the first threshold voltage AGC1_Vref may be compared with the fixed second threshold voltage AGC2_Vref and the third threshold voltage AGC3_Vref, and the mode signal of the gain control may be determined according to the comparison result.
  • AGC1_Vref when AGC1_Vref is greater than AGC2_Vref and AGC3_Vref, it may be determined as the first mode MODE1 (default mode), for example, the mode signal generating circuit generates the first mode signal MODE1_FLAG, and when AGC1_Vref is between AGC2_Vref and AGC3_Vref, it may be determined as the second mode MODE2 and generate the second mode signal MODE1_FLAG.
  • the third mode signal MODE2_FLAG can be generated.
  • AGC1_Vref is less than AGC2_Vref and AGC3_Vref
  • the third mode MODE3 can be determined and the third mode signal MODE3_FLAG can be generated.
  • the determined mode signal may be associated with a preset order of comparing the multiple threshold voltages with the detection voltage respectively. According to the mode signal, the comparison order between the detection voltage of the amplifier and the respective threshold voltages may be determined, and on this basis, the gain control method may proceed to the next step.
  • Step 430 comparing the detection voltage of the amplifier with the plurality of threshold voltages in a preset order, and outputting a control signal according to the comparison result.
  • the input audio signal is processed by the amplifier and output as a detection voltage signal AGC_IN.
  • the determined mode signal also determines the switching order of the switch, so that a switch switching signal can be generated according to the size of the detection voltage AGC_IN to control the switch to connect the threshold voltages of each level to the voltage detection circuit in a preset order, thereby comparing the detection voltage with the threshold voltages of each level AGC3_Vref, AGC2_Vref, and AGC1_Vref, and outputting corresponding control signals AGC3_FLAG, AGC2_FLAG, and AGC1_FLAG according to the comparison results, so that the generation timing of the gain control signal is adapted to different control modes, thereby achieving the effect of controlling the gain of the amplifier.
  • the voltage detection circuit can output the gain reduction control signal AGC1_FLAG, and when the detection voltage is greater than the fixed threshold voltages AGC2_Vref and AGC3_Vref, the corresponding gain reduction control signals AGC2_FLAG and AGC3_FLAG are output respectively.
  • AGC1_FLAG, AGC2_FLAG, and AGC3_FLAG can be configured to have different priorities, for example, the priority of AGC1_FLAG is higher than the priority of AGC2_FLAG and AGC3_FLAG, that is, AGC1_FLAG has the highest priority among all control signals. Once it is triggered, AGC2_FLAG and AGC3_FLAG are invalid, and the corresponding timing is cleared, so that logical conflicts between different gain reduction control signals can be prevented.
  • AGC1_FLAG and AGC2_FLAG/AGC3_FLAG may be associated with different gain reduction start times, respectively, and AGC2_FLAG and AGC3_FLAG may also be associated with different gain reduction start times, respectively.
  • the gain reduction start time associated with AGC1_FLAG may be less than the gain reduction start time associated with AGC2_FLAG and AGC3_FLAG, so that the gain can be quickly reduced when the detection voltage is large to prevent the amplifier from truncated distortion, and the gain reduction speed can be slowed down when the detection voltage is small to steadily increase the output volume.
  • the detection voltage AGC_IN of the amplifier is compared with other threshold voltages. By comparison, other gain control signals can be determined.
  • the detection voltage AGC_IN can be compared with a fixed release threshold voltage RLS_Vref, and in response to the detection voltage of the amplifier being less than the threshold voltage RLS_Vref, the gain control signal RLS_FLAG is output to increase.
  • the detection voltage AGC_IN can be compared with a preset common mode level, and the zero-crossing signal ZeroCross_FLAG is output when the detection voltage is equal to the common mode level. Referring to FIG.
  • the zero-crossing signal ZeroCross_FLAG can be used to generate a clearing signal CLR_FLAG, which can be used to clear part of the gain reduction control signal (AGC2_FLAG, AGC3_FLAG).
  • the zero-crossing signal ZeroCross_FLAG and the gain reduction control signals AGC2_FLAG and AGC3_FLAG can be used to determine the gain signal to more smoothly control the gain of the amplifier.
  • the zero-crossing signal ZeroCross_FLAG can also be used to determine the gain signal with the gain control signal RLS_FLAG to increase the gain to control the gain of the amplifier.
  • each control signal AGC1_FLAG, AGC2_FLAG, AGC3_FLAG, and RLS_FLAG can be configured to have different priorities. For example, AGC1_FLAG has the highest priority among all control signals. Once it is triggered, all other control signals being timed are invalid, and the corresponding start time timing is reset. In this way, when, for example, the output voltage of the amplifier is detected to be greater than AGC1_Vref, the gain of the amplifier can be quickly reduced to avoid truncation distortion.
  • the gain control method of this embodiment may further include a step of determining a gain signal, wherein the gain signal is determined according to the control signal to control the gain of the amplifier.
  • the gain control circuit 130 may determine a gain signal according to a preset gain change logic to control the gain of the amplifier.
  • the gain control circuit 130 After receiving the gain increase control signal RLS_FLAG, if the gain control circuit 130 determines that the signal continues to be at a high level within a predetermined time (e.g., 10ms), it can determine to increase the gain, for example, increase the gain by 0.5dB, and increase the gain after waiting for the next zero crossing signal ZeroCross_FLAG or a predetermined time (e.g., 20ms).
  • a predetermined time e.g. 10ms
  • Different gain change logics may also be set for different gain reduction control signals. For example, after receiving the gain reduction control signal AGC3_FLAG, if the gain control circuit 130 determines that the signal is triggered, it will time the first start time (e.g., 10ms), and when the zero crossing signal is triggered, it determines to reduce the gain by 0.5dB. After receiving the gain reduction control signal AGC2_FLAG, if the gain control circuit 130 determines that the signal is triggered, it will time the second start time, and the second start time (e.g., 1ms) may be is less than the first start-up time associated with AGC3_FLAG, and determines to reduce the gain by 0.5dB after the zero-crossing signal is triggered.
  • the first start time e.g. 10ms
  • the second start time e.g., 1ms
  • the gain control circuit 130 After receiving the gain reduction control signal AGC1_FLAG, if the gain control circuit 130 determines that the third start-up time is timed after the signal is triggered, the third start-up time may be less than the second start-up time or even 0, that is, the gain is directly reduced after the signal is triggered.
  • the priority of AGC1_FLAG can be configured to be the highest. If it is triggered, the gain control circuit 130 can determine that all other control signals RLS_FLAG, AGC3_FLAG, and AGC2_FLAG being timed are invalid, and reset these control signals to zero and re-time.
  • FIG6 is a flow chart of a method for performing gain control according to a gain control mode according to an embodiment of the present invention. As shown in FIG6, the gain control method may include the following steps:
  • step 510 a detection voltage signal of an amplifier is received.
  • the input audio signal is processed by the amplifier and output as a detection voltage signal AGC_IN, and the output signal can be connected to the voltage detection circuit 110 and the switching signal generation circuit 140.
  • the switching signal generation circuit 140 can generate a switch switching signal according to the change value of AGC_IN to control the switch 120 to couple the corresponding threshold voltage to the voltage detection circuit 110, and the voltage detection circuit 110 can generate a control signal according to the comparison between AGC_IN and each threshold voltage.
  • a threshold voltage associated with the increased gain control signal is coupled to a voltage detection circuit.
  • the initial state of the switch 120 can be configured as S4 closed and the rest open, thereby coupling the threshold voltage RLS_Vref to the voltage detection circuit 110.
  • the switch signal generation circuit can control the switch 120 to couple the threshold voltage RLS_Vref to the voltage detection circuit 120.
  • steps 530 and 540 the threshold voltages are compared, and a mode signal for gain control is determined according to the comparison result.
  • the first threshold voltage AGC1_Vref may be associated with the supply voltage of the amplifier, and its actual value may be greater than the fixed second threshold voltage AGC2_Vref and the third threshold voltage AGC3_Vref, or may be less than the threshold voltages AGC2_Vref and AGC3_Vref.
  • the mode signal generating circuit may first compare the actually determined AGC1_Vref with AGC2_Vref (step 530).
  • control mode MODE1 (default control mode) may be determined, and the corresponding output Mode signal MODE1_FLAG, if AGC1_Vref is less than AGC2_Vref, then AGC1_Vref is compared with AGC3_Vref (step 540), if AGC1_Vref is greater than AGC3_Vref, control mode MODE2 can be determined and MODE2_FLAG can be output, otherwise control mode MODE3 can be determined and MODE3_FLAG can be output.
  • the gain control device can adjust the gain control method accordingly to perform gain control on the amplifier, for example, determining the switching order of the switch so that each threshold voltage can be compared with the detection voltage in a preset order (for example, ascending order), so that the amplifier can be flexibly controlled according to its supply voltage to achieve a smooth increase in the output voltage of the amplifier and effectively prevent truncation distortion, while also reducing power consumption.
  • a preset order for example, ascending order
  • Fig. 7 shows a gain control signal effect diagram under control mode MODE1.
  • the detection voltage AGC_IN of the amplifier is a sine wave
  • the voltage detection circuit can output a zero-crossing signal ZeroCross_FLAG (not shown)
  • RLS_VH and RLS_VL non-common mode voltage
  • the gain control circuit 130 can determine the gain signal according to the preset gain change logic and output it to the amplifier.
  • a gain signal with increased gain e.g., 0.5dB
  • the switching signal generating circuit 140 can control the switching switch 120 to couple the threshold voltage AGC3_Vref (including a pair of AGC3_VH and AGC3_VL) to the voltage detecting circuit 110 .
  • the voltage detection circuit 110 can compare AGC_IN with AGC3_VH and AGC3_VL. If it is less than AGC3_VH or greater than AGC3_VL, all control signals are low level, and the gain control circuit 130 can output a gain signal with increased gain after ZeroCross_FLAG is triggered and output it to the amplifier. If AGC_IN exceeds AGC3_VH or is lower than AGC3_VL, the trigger 220 receives a positive pulse and outputs a high-level AGC3_FLAG signal.
  • the switching signal generation circuit 140 can control the switching switch 120 to couple the threshold voltage AGC2_Vref (including a pair of AGC2_VH and AGC2_VL) to the voltage detection circuit 110.
  • the gain control circuit 130 performs timing after receiving the AGC3_FLAG signal. If the signal timing reaches a predetermined time (e.g., 10ms), a gain signal with reduced gain (e.g., 0.5dB) can be output and output to the amplifier when the zero-crossing signal is triggered.
  • the voltage detection circuit 110 can compare AGC_IN with AGC2_VH and AGC2_VL. If it is less than AGC2_VH or greater than AGC2_VL, only AGC3_FLAG is at a high level. If AGC_IN exceeds AGC2_VH or is lower than AGC2_VL, the trigger 220 and the trigger 222 receive a positive pulse again, thereby outputting a high-level AGC2_FLAG. At the same time, the switching signal generation circuit 140 can control the switch 120 to couple the threshold voltage AGC1_Vref (including a pair of AGC1_VH and AGC1_VL) to the voltage detection circuit 110.
  • AGC1_Vref including a pair of AGC1_VH and AGC1_VL
  • the gain control circuit 130 can clear the timing of AGC1_FLAG after receiving the AGC2_FLAG signal, and time the AGC2_FLAG signal. If the signal timing reaches a predetermined time (e.g., 500 ⁇ s), a gain signal with a gain reduction of 0.5dB can be output when the zero-crossing signal is triggered and output to the amplifier.
  • a predetermined time e.g. 500 ⁇ s
  • the voltage detection circuit 110 can compare AGC_IN with AGC1_VH and AGC1_VL. If it is less than AGC1_VH or greater than AGC1_VL, only AGC2_FLAG and AGC3_FLAG are high level. If AGC_IN exceeds AGC1_VH or is lower than AGC1_VL, both input terminals of the AND gate 224 receive high level signals, thereby outputting high level AGC1_FLAG. In one embodiment, in response to receiving the AGC1_FLAG signal, the gain control circuit 130 can immediately generate a gain signal that reduces the gain by 0.5dB to directly control the amplifier to reduce the gain to prevent truncation distortion.
  • the gain control circuit 130 may perform timing. If the signal timing reaches a predetermined time (eg, 50 ⁇ s), a gain signal with a gain reduced by 0.5 dB may be output to the amplifier to improve the stability of the amplifier output voltage.
  • a predetermined time eg, 50 ⁇ s
  • the switch 120 can keep coupling the threshold voltage AGC1_Vref to the voltage detection circuit 110.
  • AGC1_FLAG will turn to a low level, and AGC2_FLAG and AGC3_FLAG will also jump to a low level when AGC_IN crosses zero.
  • FIG8 shows a gain control signal effect diagram under control mode MODE2.
  • AGC1_Vref is between AGC2_Vref and AGC3_Vref.
  • the voltage detection circuit can output a high-level RLS_FLAG signal.
  • the gain control circuit 130 determines that the RLS_FLAG signal is continuously at a high level within a predetermined time (e.g., 10ms), it outputs a gain signal with a gain increase of 0.5dB and outputs it to the amplifier.
  • the switching signal generating circuit 140 can control the switching switch 120 to couple the threshold voltage AGC3_Vref to the voltage detecting circuit 110 .
  • the voltage detection circuit 110 can compare AGC_IN with AGC3_VH and AGC3_VL. If it is less than AGC3_VH or greater than AGC3_VL, all control signals are low level, and the gain control circuit 130 can output a gain signal with increased gain after ZeroCross_FLAG is triggered and output it to the amplifier. If AGC_IN exceeds AGC3_VH or is lower than AGC3_VL, the trigger 220 receives a positive pulse and outputs a high-level AGC3_FLAG signal. At the same time, the switching signal generation circuit 140 can control the switching switch 120 to couple the threshold voltage AGC1_Vref to the voltage detection circuit 110.
  • the gain control circuit 130 performs timing after receiving the AGC3_FLAG signal. If the signal timing reaches a predetermined time (e.g., 10ms), a gain signal with reduced gain (e.g., 0.5dB) can be output and output to the amplifier when the zero-crossing signal is triggered.
  • a predetermined time e.g. 10ms
  • a gain signal with reduced gain e.g., 0.5dB
  • the voltage detection circuit 110 can compare AGC_IN with AGC1_VH and AGC1_VL. If it is less than AGC1_VH or greater than AGC1_VL, only AGC3_FLAG is at a high level. If AGC_IN exceeds AGC1_VH or is lower than AGC1_VL, the trigger 222 is triggered again, and both input terminals of the AND gate 224 receive high-level signals, and the control signal AGC1_FLAG is also turned to a high level.
  • the gain control circuit 130 in response to receiving the AGC1_FLAG signal, can immediately generate a gain signal that reduces the gain by 0.5dB to directly control the amplifier to reduce the gain to prevent truncation distortion. At the same time, since AGC1_FLAG has the highest priority, the remaining control signals AGC2_FLAG and AGC3_FLAG are invalid, and their corresponding timings are cleared. In addition, in response to receiving the AGC1_FLAG signal for the second time, the gain control circuit 130 may perform timing. If the signal timing reaches a predetermined time (eg, 50 ⁇ s), a gain signal with a gain reduced by 0.5 dB may be output to the amplifier to improve the stability of the amplifier output voltage.
  • a predetermined time eg, 50 ⁇ s
  • the voltage detection circuit 110 only needs to compare the detection voltage AGC_IN with AGC3_Vref and AGC1_Vref to generate a control signal, thereby ensuring that the amplifier can still smoothly increase the output voltage of the amplifier under a low supply voltage, and effectively prevent the occurrence of truncation distortion, while also reducing circuit power consumption.
  • Figure 9 shows the gain control signal effect diagram under control mode MODE3.
  • AGC1_Vref is less than AGC2_Vref and AGC3_Vref.
  • the voltage detection circuit can output a high level.
  • the gain control circuit 130 determines that the RLS_FLAG signal is continuously at a high level for a predetermined time (eg, 10 ms), it outputs a gain signal with a gain increase of 0.5 dB to the amplifier.
  • the switching signal generating circuit 140 can control the switching switch 120 to couple the threshold voltage AGC1_Vref to the voltage detecting circuit 110 .
  • the voltage detection circuit 110 can compare AGC_IN with AGC1_VH and AGC1_VL. If it is less than AGC1_VH or greater than AGC1_VL, all control signals are low level, and the gain control circuit 130 can output a gain signal with increased gain after ZeroCross_FLAG is triggered and output it to the amplifier. If AGC_IN exceeds AGC1_VH or is lower than AGC1_VL, the trigger 220 receives a positive pulse and outputs a high level AGC3_FLAG signal. At the same time, both input ends of the AND gate 224 receive high level signals, and the control signal AGC1_FLAG is also converted to a high level.
  • the gain control circuit 130 in response to receiving the AGC1_FLAG signal, can immediately generate a gain signal to directly control the amplifier to reduce the gain to prevent truncation distortion. At the same time, since AGC1_FLAG has the highest priority, the control signal AGC3_FLAG is invalid and does not start the corresponding timing. In addition, in response to receiving the AGC1_FLAG signal for the second time, the gain control circuit 130 may perform timing. If the signal timing reaches a predetermined time (eg, 50 ⁇ s), a gain signal with a gain reduced by 0.5 dB may be output to the amplifier to improve the stability of the amplifier output voltage.
  • a predetermined time eg, 50 ⁇ s
  • the voltage detection circuit 110 only needs to compare the detection voltage AGC_IN with AGC1_Vref, thereby ensuring that the amplifier can still smoothly increase the output voltage of the amplifier under a low supply voltage, effectively preventing the occurrence of truncation distortion, and reducing circuit power consumption.
  • the present invention also provides an audio device, which electronic device can be a playback device including a power amplifier, such as a speaker, which includes the gain control device described above, and the gain control device can be coupled to the speaker so that the gain of the amplifier can be controlled according to the gain control method described above.
  • a power amplifier such as a speaker
  • the gain control device can be coupled to the speaker so that the gain of the amplifier can be controlled according to the gain control method described above.
  • the word “connected” refers to two or more elements that can be directly connected or connected through one or more intermediate elements.
  • the words “or” and “and” used here refer to the words “and/or”, and can be used interchangeably with them, unless the context clearly indicates otherwise.
  • the words “such as” used here refer to the phrase “such as but not limited to”, and can be used interchangeably with them.
  • each component or each step can be decomposed and/or recombined.
  • Such decomposition and/or recombination should be regarded as equivalent solutions of the present application.

Landscapes

  • Control Of Amplification And Gain Control (AREA)

Abstract

The present invention relates to a gain control apparatus and control method. According to an embodiment, the gain control apparatus may comprise: a voltage measurement circuit, configured to receive a measured voltage of an amplifier, compare the measured voltage with a plurality of threshold voltages in a preset order, and output a control signal on the basis of comparison results; a change-over switch, separately coupling the plurality of threshold voltages to the voltage measurement circuit in the preset order so as to compare same with the measured voltage; and a gain control circuit, configured to output a gain signal to the amplifier on the basis of the control signal output by the voltage measurement circuit.

Description

增益控制装置及方法Gain control device and method 技术领域Technical Field

本申请涉及功放增益控制领域,特别涉及一种放大器的增益控制电路及具有该电路的电子设备。The present application relates to the field of power amplifier gain control, and in particular to a gain control circuit of an amplifier and an electronic device having the circuit.

背景技术Background technique

通常,在诸如扬声器等音频设备中,音频的输出是由输入信号乘以相应电路的增益产生的,其最大输出幅值一般由供电电压决定。为了使扬声器工作在适当的电压区间,需要在电路中加入保护机制,例如在功率放大器的前级上提供自动增益控制(AGC)电路来实现。具体而言,可设置保护阈值并将扬声器输出与之进行比对,若信号幅值高于设定的阈值电压,AGC电路可降低放大器的增益,以避免截顶失真和保护扬声器;反之,若信号幅值低于设定的释放阈值电压,该AGC电路将提升放大器的增益,以达到提升音量保证音质的作用。Typically, in audio devices such as speakers, the audio output is generated by multiplying the input signal by the gain of the corresponding circuit, and its maximum output amplitude is generally determined by the supply voltage. In order to make the speaker work in an appropriate voltage range, a protection mechanism needs to be added to the circuit, such as providing an automatic gain control (AGC) circuit in the front stage of the power amplifier. Specifically, a protection threshold can be set and the speaker output can be compared with it. If the signal amplitude is higher than the set threshold voltage, the AGC circuit can reduce the amplifier gain to avoid truncation distortion and protect the speaker; conversely, if the signal amplitude is lower than the set release threshold voltage, the AGC circuit will increase the amplifier gain to achieve the effect of increasing the volume and ensuring the sound quality.

在现有技术的AGC控制电路中,为了提高增益控制精确度,一般需要设置多个AGC控制电路以将输出信号与多个预设阈值进行比较来获得增益信号。由于每个控制电路中都包括分立的比较器等电子器件,这将导致整个AGC控制电路的占用面积增大,电路的功耗也增大。In the AGC control circuit of the prior art, in order to improve the gain control accuracy, it is generally necessary to set multiple AGC control circuits to compare the output signal with multiple preset thresholds to obtain a gain signal. Since each control circuit includes discrete electronic devices such as a comparator, this will increase the occupied area of the entire AGC control circuit and the power consumption of the circuit.

发明内容Summary of the invention

为了解决上述技术问题,本申请提供一种自动增益控制装置和方法,其能够在保证音质的前提下,缩减电路面积、降低电路功耗。In order to solve the above technical problems, the present application provides an automatic gain control device and method, which can reduce circuit area and circuit power consumption while ensuring sound quality.

本发明的一个方面提供了一种增益控制装置,该增益控制装置包括:电压检测电路,配置为接收放大器的检测电压并将所述检测电压按预设顺序与多个阈值电压分别进行比较,并且根据比较结果输出控制信号;切换开关,按所述预设顺序将所述多个阈值电压中分别耦接到所述电压检测电路以与所述检测电压进行比较;以及增益控制电路,配置为基于所述电压检测电路输出的控制信号输出增益信号至所述放大器。 One aspect of the present invention provides a gain control device, which includes: a voltage detection circuit, configured to receive a detection voltage of an amplifier and compare the detection voltage with multiple threshold voltages in a preset order, and output a control signal based on the comparison result; a switching switch, coupling the multiple threshold voltages to the voltage detection circuit in the preset order to compare with the detection voltage; and a gain control circuit, configured to output a gain signal to the amplifier based on the control signal output by the voltage detection circuit.

在一些实施例中,所述装置还包括:模式信号生成电路,其配置为基于所述多个阈值电压之间的大小关系生成模式信号,所述模式信号与将所述多个阈值电压分别与所述检测电压进行比较的所述预设顺序相关联。In some embodiments, the device further includes: a mode signal generating circuit configured to generate a mode signal based on a magnitude relationship between the multiple threshold voltages, the mode signal being associated with the preset order of comparing the multiple threshold voltages with the detection voltage respectively.

在一些实施例中,所述多个阈值电压包括第一阈值电压和固定的至少一级阈值电压,所述第一阈值电压大小与放大器的供给电压大小相关联,并且,所述模式信号基于所述第一阈值电压与所述固定的至少一级阈值电压进行比较的比较结果而确定。In some embodiments, the multiple threshold voltages include a first threshold voltage and at least one fixed threshold voltage, the first threshold voltage is associated with the supply voltage of the amplifier, and the mode signal is determined based on a comparison result of the first threshold voltage and the at least one fixed threshold voltage.

在一些实施例中,所述电压检测电路包括:多个比较器,每个比较器的一个输入端耦接到所述放大器的检测电压,另一个输入端耦接到所述多个阈值电压中的一个阈值电压。In some embodiments, the voltage detection circuit includes: a plurality of comparators, one input terminal of each comparator is coupled to the detection voltage of the amplifier, and another input terminal of each comparator is coupled to one of the plurality of threshold voltages.

在一些实施例中,所述控制信号包括提高增益控制信号、降低增益控制信号和过零信号。In some embodiments, the control signal includes a gain increase control signal, a gain decrease control signal, and a zero-crossing signal.

在一些实施例中,所述多个比较器包括第一比较器,所述第一比较器的正向输入端与所述放大器的检测电压耦接,反向输入端与共模电平耦接,并且,所述过零信号基于所述第一比较器的输出而确定。In some embodiments, the plurality of comparators include a first comparator having a positive input terminal coupled to a detection voltage of the amplifier and a negative input terminal coupled to a common mode level, and the zero-crossing signal is determined based on an output of the first comparator.

在一些实施例中,所述多个比较器包括第二比较器,所述第二比较器的正向输入端和反向输入端经由所述切换开关分别与所述多个阈值电压中的一个阈值电压和所述放大器的检测电压耦接,并且,所述提高增益控制信号至少基于所述第二比较器的输出而确定。In some embodiments, the multiple comparators include a second comparator, whose positive input and reverse input are respectively coupled to one of the multiple threshold voltages and the detection voltage of the amplifier via the switching switch, and the increased gain control signal is determined at least based on the output of the second comparator.

在一些实施例中,所述多个比较器包括第三比较器和第四比较器,所述第三比较器的反向输入端与所述放大器的检测电压耦接,另一端经由所述切换开关与所述多个阈值电压中的一个阈值电压耦接,所述第四比较器的正向输入端与所述放大器的检测电压耦接,另一端经由所述切换开关与所述多个阈值电压中的一个阈值电压耦接,并且,所述降低增益控制信号至少基于所述第三比较器和所述第四比较器的输出而确定。In some embodiments, the multiple comparators include a third comparator and a fourth comparator, the inverting input terminal of the third comparator is coupled to the detection voltage of the amplifier, and the other end is coupled to one of the multiple threshold voltages via the switching switch, the positive input terminal of the fourth comparator is coupled to the detection voltage of the amplifier, and the other end is coupled to one of the multiple threshold voltages via the switching switch, and the gain reduction control signal is determined based on at least the outputs of the third comparator and the fourth comparator.

在一些实施例中,所述电压检测电路还包括:第一降低增益控制信号生成电路,其包括串联的N个触发器,每个触发器的C端耦接到所述第三比较器和第四比较器的输出端,N≥2。In some embodiments, the voltage detection circuit further includes: a first reduced gain control signal generating circuit, which includes N triggers connected in series, and the C terminal of each trigger is coupled to the output terminal of the third comparator and the fourth comparator, N≥2.

在一些实施例中,所述过零信号还配置为对所述N个触发器的输出进行清零。In some embodiments, the zero-crossing signal is further configured to clear the outputs of the N flip-flops.

在一些实施例中,所述电压检测电路还包括:第二降低增益控制信号生 成电路,其包括与门运算单元,所述与门运算单元的第一输入端与所述第一降低增益控制信号生成电路耦接,所述与门运算单元的第二输入端与所述第三比较器和第四比较器的输出耦接。In some embodiments, the voltage detection circuit further comprises: a second gain reduction control signal generating The circuit comprises an AND gate operation unit, a first input end of the AND gate operation unit is coupled to the first reduced gain control signal generating circuit, and a second input end of the AND gate operation unit is coupled to the outputs of the third comparator and the fourth comparator.

在一些实施例中,所述增益控制装置还包括:切换信号生成电路,其配置为基于所述放大器的检测电压与所述多个阈值电压比较的结果生成所述切换开关的开关切换信号。In some embodiments, the gain control device further includes: a switching signal generating circuit configured to generate a switch switching signal of the switch based on a result of comparing the detection voltage of the amplifier with the plurality of threshold voltages.

在一些实施例中,所述模式信号生成电路包括:第五比较器,其正向输入端和反向输入端经由模式切换开关分别与所述第一阈值电压和所述固定的至少一级阈值电压耦接;第二触发器,其C端耦接到所述第五比较器的输出端;第三触发器,其C端经由反相器耦接到所述第五比较器的输出端,其D端连接到所述第二触发器的Q端;其中,所述模式信号基于所述第二触发器和第三触发器的Q端输出而确定。In some embodiments, the mode signal generating circuit includes: a fifth comparator, whose positive input terminal and reverse input terminal are respectively coupled to the first threshold voltage and the fixed at least one level threshold voltage via a mode switching switch; a second trigger, whose C terminal is coupled to the output terminal of the fifth comparator; a third trigger, whose C terminal is coupled to the output terminal of the fifth comparator via an inverter, and whose D terminal is connected to the Q terminal of the second trigger; wherein the mode signal is determined based on the Q terminal outputs of the second trigger and the third trigger.

在一些实施例中,所述电压检测电路配置为根据所述比较结果和所述模式信号来输出所述控制信号。In some embodiments, the voltage detection circuit is configured to output the control signal according to the comparison result and the mode signal.

本发明的一方面提供一种增益控制方法,该增益控制方法包括:确定多个阈值电压,所述多个阈值电压包括第一阈值电压和固定的至少一级阈值电压,其中,所述第一阈值电压大小与放大器的供给电压大小相关联;将所述第一阈值电压与所述固定的至少一级阈值电压进行比较,根据比较结果确定增益控制的模式信号;将放大器的检测电压与所述多个阈值电压按预设顺序分别进行比较,并根据比较结果输出控制信号,所述模式信号与将所述多个阈值电压分别与所述检测电压进行比较的预设顺序相关联;其中,在所述放大器的检测电压大于所述第一阈值电压时输出第一降低增益控制信号;当存在至少一级阈值电压小于所述第一阈值电压,且在所述放大器的检测电压大于所述固定的至少一级阈值电压时输出相应的另一降低增益控制信号,所述第一降低增益控制信号配置为具有高于所述另一降低增益控制信号的优先级。One aspect of the present invention provides a gain control method, which includes: determining multiple threshold voltages, the multiple threshold voltages include a first threshold voltage and at least one fixed threshold voltage, wherein the first threshold voltage is associated with the supply voltage of the amplifier; comparing the first threshold voltage with the at least one fixed threshold voltage, and determining a mode signal for gain control according to the comparison result; comparing the detection voltage of the amplifier with the multiple threshold voltages in a preset order, and outputting a control signal according to the comparison result, wherein the mode signal is associated with the preset order in which the multiple threshold voltages are compared with the detection voltage; wherein a first gain reduction control signal is output when the detection voltage of the amplifier is greater than the first threshold voltage; and when there is at least one threshold voltage less than the first threshold voltage and the detection voltage of the amplifier is greater than the at least one fixed threshold voltage, another corresponding gain reduction control signal is output, and the first gain reduction control signal is configured to have a higher priority than the other gain reduction control signal.

在一些实施例中,所述固定的至少一级阈值电压至少包括第二阈值电压和第三阈值电压,并且,将所述第一阈值电压与所述固定的至少一级阈值电压进行比较,根据比较结果确定增益控制的模式信号包括:当所述第一阈值电压大于所述第二阈值电压和第三阈值电压时,确定所述模式信号为第一模式信号;当所述第一阈值电压介于所述第二阈值电压和第三阈值电压之间时, 确定所述模式信号为第二模式信号;当所述第一阈值电压小于所述第二阈值电压和第三阈值电压时,确定所述模式信号为第三模式信号。In some embodiments, the fixed at least one level threshold voltage includes at least a second threshold voltage and a third threshold voltage, and comparing the first threshold voltage with the fixed at least one level threshold voltage, and determining the mode signal of the gain control according to the comparison result includes: when the first threshold voltage is greater than the second threshold voltage and the third threshold voltage, determining the mode signal as the first mode signal; when the first threshold voltage is between the second threshold voltage and the third threshold voltage, The mode signal is determined to be a second mode signal; when the first threshold voltage is less than the second threshold voltage and the third threshold voltage, the mode signal is determined to be a third mode signal.

在一些实施例中,所述将放大器的检测电压与所述多个阈值电压按预设顺序分别进行比较,并根据比较结果输出控制信号包括:在第一模式信号下,当所述放大器的检测电压大于所述第三阈值电压时输出第三降低增益控制信号,当所述放大器的检测电压大于所述第二阈值电压时输出第二降低增益控制信号,当所述放大器的检测电压大于所述第一阈值电压时输出所述第一降低增益控制信号,在第二模式信号下,当所述放大器的检测电压大于所述第三阈值电压时输出所述第三降低增益控制信号,当所述放大器的检测电压大于所述第一阈值电压时输出所述第一降低增益控制信号,在第三模式信号下,当所述放大器的检测电压大于所述第一阈值电压时输出所述第一降低增益控制信号,其中,所述第一降低增益控制信号、第二降低增益控制信号、第三降低增益控制信号与不同的降低增益启动时间相关联。In some embodiments, the comparing the detection voltage of the amplifier with the multiple threshold voltages in a preset order and outputting a control signal according to the comparison result includes: under a first mode signal, outputting a third gain reduction control signal when the detection voltage of the amplifier is greater than the third threshold voltage, outputting a second gain reduction control signal when the detection voltage of the amplifier is greater than the second threshold voltage, and outputting the first gain reduction control signal when the detection voltage of the amplifier is greater than the first threshold voltage; under a second mode signal, outputting the third gain reduction control signal when the detection voltage of the amplifier is greater than the third threshold voltage, outputting the first gain reduction control signal when the detection voltage of the amplifier is greater than the first threshold voltage, and under a third mode signal, outputting the first gain reduction control signal when the detection voltage of the amplifier is greater than the first threshold voltage, wherein the first gain reduction control signal, the second gain reduction control signal, and the third gain reduction control signal are associated with different gain reduction start times.

在一些实施例中,所述方法还包括:将所述放大器的检测电压与固定的第四阈值电压进行比较,并且响应于在所述放大器的检测电压小于所述第四阈值电压时输出提高增益控制信号,其中,所述第一降低增益控制信号配置为具有高于所述提高增益控制信号的优先级。In some embodiments, the method further includes comparing a detection voltage of the amplifier with a fixed fourth threshold voltage, and outputting an increase gain control signal in response to when the detection voltage of the amplifier is less than the fourth threshold voltage, wherein the first decrease gain control signal is configured to have a higher priority than the increase gain control signal.

本发明的另一方面提供一种音频设备,其包括以上描述的增益控制装置,以及与所述增益控制装置耦接的扬声器。Another aspect of the present invention provides an audio device, comprising the gain control device described above, and a speaker coupled to the gain control device.

通过根据本发明提供的示例的增益控制装置,通过设置切换开关在多级阈值电压间按照预设顺序进行切换,可以实现电路元件的复用,从而简化了模拟电路结构,在保证提升音量和降低输出的截顶杂音的前提下可以减小增益控制电路的占用面积并降低电路的功耗。By using the exemplary gain control device provided by the present invention, by setting a switching switch to switch between multiple threshold voltages in a preset order, the reuse of circuit elements can be achieved, thereby simplifying the analog circuit structure. Under the premise of ensuring the increase of volume and the reduction of output truncation noise, the occupied area of the gain control circuit can be reduced and the power consumption of the circuit can be reduced.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

通过结合附图对本申请实施例进行更详细的描述,本申请的上述以及其他目的、特征和优势将变得更加明显。附图用来提供对本申请实施例的进一步理解,并且构成说明书的一部分,与本申请实施例一起用于解释本申请,并不构成对本申请的限制。在附图中,相同的参考标号通常代表相同部件或步骤。By describing the embodiments of the present application in more detail in conjunction with the accompanying drawings, the above and other purposes, features and advantages of the present application will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings, the same reference numerals generally represent the same components or steps.

图1是根据本发明一实施例的增益控制装置的示意性结构框图; FIG1 is a schematic structural block diagram of a gain control device according to an embodiment of the present invention;

图2是根据本发明一实施例的增益控制装置的示意性结构框图;FIG2 is a schematic structural block diagram of a gain control device according to an embodiment of the present invention;

图3是根据本发明一实施例的增益控制装置中的电压检测电路的示意性电路图;3 is a schematic circuit diagram of a voltage detection circuit in a gain control device according to an embodiment of the present invention;

图4是根据本发明一实施例的增益控制装置中的模式信号生成电路的示意性电路图;4 is a schematic circuit diagram of a mode signal generating circuit in a gain control device according to an embodiment of the present invention;

图5是根据本发明一实施例的增益控制方法的流程图;FIG5 is a flow chart of a gain control method according to an embodiment of the present invention;

图6是根据本发明一实施例的根据增益控制模式进行增益控制的方法流程图;6 is a flow chart of a method for performing gain control according to a gain control mode according to an embodiment of the present invention;

图7是根据本发明一实施例的在一控制模式下的增益控制信号效果图;FIG7 is a gain control signal effect diagram in a control mode according to an embodiment of the present invention;

图8是根据本发明一实施例的在另一控制模式下的增益控制信号效果图;FIG8 is a gain control signal effect diagram in another control mode according to an embodiment of the present invention;

图9是根据本发明一实施例的在又一控制模式下的增益控制信号效果图。FIG. 9 is a diagram showing the effect of a gain control signal in another control mode according to an embodiment of the present invention.

具体实施方式Detailed ways

下面将参考附图详细地描述本发明的一些示例实施例。显然,所描述的实施例仅仅是一部分实施例,而不是全部实施例。应理解,本发明不应被限制到这些示例实施例的特定细节。而是,可以在没有这些特定细节或者采用其他替代方式的情况下,实施本发明的实施例,而不会偏离权利要求定义的本发明的思想和原理。Some example embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments, rather than all the embodiments. It should be understood that the present invention should not be limited to the specific details of these example embodiments. Instead, embodiments of the present invention can be implemented without these specific details or in other alternatives without departing from the ideas and principles of the present invention defined in the claims.

参考图1,其示出了根据本发明一实施例的增益控制装置的示意性结构框图,该增益控制装置可包括电压检测电路110、切换开关120以及增益控制电路130。增益控制装置可为音频放大器提供增益信号,示意性地,如图1所示,增益控制装置中的电压检测电路110可接收放大器100的检测电压等信号,该检测电压可例如为图1示出的放大器100的输出电压信号VOUT,即电压检测电路110与放大器100的输出端耦接。本发明不限于此,电压检测电路110也可与放大器的输入端耦接,检测电压相应地为放大器100的输入电压信号VIN,通过增益换算可以得到相应的放大器输出电压值。在一些实施例中,为了便于电压比较的电路实现,放大器100的检测电压也可以是输出电压信号VOUT或输入电压信号VIN经过降压处理后的电压信号。Referring to FIG1 , it shows a schematic structural block diagram of a gain control device according to an embodiment of the present invention, and the gain control device may include a voltage detection circuit 110, a switch 120, and a gain control circuit 130. The gain control device may provide a gain signal for the audio amplifier. Schematically, as shown in FIG1 , the voltage detection circuit 110 in the gain control device may receive a detection voltage and other signals of the amplifier 100. The detection voltage may be, for example, the output voltage signal V OUT of the amplifier 100 shown in FIG1 , that is, the voltage detection circuit 110 is coupled to the output end of the amplifier 100. The present invention is not limited thereto, and the voltage detection circuit 110 may also be coupled to the input end of the amplifier, and the detection voltage may be the input voltage signal V IN of the amplifier 100 accordingly. The corresponding amplifier output voltage value may be obtained by gain conversion. In some embodiments, in order to facilitate the circuit implementation of voltage comparison, the detection voltage of the amplifier 100 may also be a voltage signal after the output voltage signal V OUT or the input voltage signal V IN is reduced in voltage.

在接收到放大器100的检测电压后,电压检测电路110可将该检测电压按照预设顺序与多个阈值电压进行比较,并根据比较结果而输出控制信号作为增益控制的判断依据。阈值电压可例如存储在预定的寄存器中,其个数可 根据增益控制精度情况而确定,例如,可设置有3个以上(例如4个、5个、6个等)阈值电压。在一实施例中,控制信号可包括提高增益控制信号、降低增益控制信号和过零信号。例如,在检测电压过零点或处于过零点的相邻区间时,电压检测电路110可生成过零信号;在检测电压小于一个设定阈值电压(例如释放阈值)时,电压检测电路110可生成提高增益控制信号;而在检测电压大于另一设定阈值电压(例如启动阈值)时,电压检测电路110可生成降低增益控制信号,生成的控制信号可输出至增益控制电路。在一实施例中,可设置有多级启动阈值电压,该启动阈值电压的个数可根据增益控制精度而确定,例如,可设置有2个以上(例如3个、4个等)启动阈值电压。不同的启动阈值电压可对应于不同的降低增益控制信号,也就是说,在检测电压大于其中一个启动阈值电压时,电压检测电路110可生成相应级别的降低增益控制信号。不同级别的降低增益控制信号可与不同的降低增益启动时间相关联,例如,较大的启动阈值电压所对应的降低增益启动时间可小于较小的启动阈值电压所对应的降低增益启动时间,使得在检测到放大器100的输出电压较大时(例如,接近截顶电压),增益控制装置可以快速响应降低放大器的增益以避免出现截顶杂音,而在放大器100的输出电压较小时,可以控制放大器进行平稳的降低增益以保证音量的平稳。After receiving the detection voltage of the amplifier 100, the voltage detection circuit 110 can compare the detection voltage with a plurality of threshold voltages in a preset order, and output a control signal as a basis for determining the gain control according to the comparison result. The threshold voltages can be stored in a predetermined register, for example, and the number of the threshold voltages can be It is determined according to the gain control accuracy. For example, more than 3 (for example, 4, 5, 6, etc.) threshold voltages may be set. In one embodiment, the control signal may include a gain increase control signal, a gain decrease control signal and a zero-crossing signal. For example, when the detection voltage crosses the zero point or is in the adjacent interval of the zero-crossing point, the voltage detection circuit 110 may generate a zero-crossing signal; when the detection voltage is less than a set threshold voltage (for example, a release threshold), the voltage detection circuit 110 may generate a gain increase control signal; and when the detection voltage is greater than another set threshold voltage (for example, a start threshold), the voltage detection circuit 110 may generate a gain decrease control signal, and the generated control signal may be output to the gain control circuit. In one embodiment, multiple levels of start threshold voltages may be set, and the number of the start threshold voltages may be determined according to the gain control accuracy. For example, more than 2 (for example, 3, 4, etc.) start threshold voltages may be set. Different start threshold voltages may correspond to different gain decrease control signals, that is, when the detection voltage is greater than one of the start threshold voltages, the voltage detection circuit 110 may generate a corresponding level of gain decrease control signal. Different levels of gain reduction control signals may be associated with different gain reduction start-up times. For example, the gain reduction start-up time corresponding to a larger start-up threshold voltage may be smaller than the gain reduction start-up time corresponding to a smaller start-up threshold voltage, so that when it is detected that the output voltage of the amplifier 100 is large (for example, close to the truncation voltage), the gain control device can respond quickly to reduce the gain of the amplifier to avoid truncation noise, and when the output voltage of the amplifier 100 is small, the amplifier can be controlled to smoothly reduce the gain to ensure a stable volume.

在一实施例中,在设置的多级启动阈值电压中,可将其中的一个阈值电压(以下称为第一阈值电压)配置为与放大器100的供给电压相关,而其它的阈值电压配置为预先设置的固定值。例如,该第一阈值电压的大小可配置为与放大器100的供给电压大小相关联,例如两者正相关,即该第一阈值电压的值随着供给电压的降低而减小。将该第一阈值电压配置为根据放大器的实际供给电压而具体设置,可使得例如音频功率放大系统在小功率下的功耗降低,同时防止发生截顶失真。在一具体实施方式中,还可将所述多级阈值电压中的第一阈值电压和其余固定的阈值电压进行比较,并根据该比较结果来确定增益控制模式。在不同的控制模式下,放大器的检测电压可按照不同的比较顺序与各个阈值电压进行比较,并可能生成不同的增益控制信号,这将在后面进行具体描述。In one embodiment, among the set multi-level startup threshold voltages, one of the threshold voltages (hereinafter referred to as the first threshold voltage) can be configured to be related to the supply voltage of the amplifier 100, while the other threshold voltages can be configured to be pre-set fixed values. For example, the magnitude of the first threshold voltage can be configured to be associated with the magnitude of the supply voltage of the amplifier 100, for example, the two are positively correlated, that is, the value of the first threshold voltage decreases as the supply voltage decreases. Configuring the first threshold voltage to be specifically set according to the actual supply voltage of the amplifier can reduce the power consumption of the audio power amplification system at low power, for example, while preventing truncation distortion. In a specific implementation, the first threshold voltage in the multi-level threshold voltage can also be compared with the remaining fixed threshold voltages, and the gain control mode can be determined based on the comparison result. Under different control modes, the detection voltage of the amplifier can be compared with each threshold voltage in different comparison orders, and different gain control signals may be generated, which will be described in detail later.

切换开关120的一端耦接到多个阈值电压,其可按照预设顺序将该多个阈值电压中的一个或多个阈值电压分别耦接到电压检测电路110以与检测电压进行比较。在一示例中,切换开关120可具有多刀多掷配置,也可以通过 若干个单刀多掷或双刀多掷开关组合而成。开关的刀可连接到电压检测电路110内部的比较器等电路元件,掷可连接到不同的阈值电压。各个开关可以以多种方式实现,包括但不限于场效应晶体管、双极晶体管、二极管和/或其他类型的开关。One end of the switch 120 is coupled to a plurality of threshold voltages, and one or more of the threshold voltages may be coupled to the voltage detection circuit 110 in a predetermined order to be compared with the detection voltage. In one example, the switch 120 may have a multi-pole multi-throw configuration, or may be configured by The switch is composed of several single-pole multi-throw or double-pole multi-throw switches. The switches' poles can be connected to circuit elements such as comparators inside the voltage detection circuit 110, and the throws can be connected to different threshold voltages. Each switch can be implemented in a variety of ways, including but not limited to field effect transistors, bipolar transistors, diodes and/or other types of switches.

本发明通过设置切换开关120,其可例如在开关切换信号控制下可以将不同的阈值电压按照预设顺序分别耦接到电压检测电路110中的相同的比较器,从而达到复用电压检测电路110中比较器的效果,如此,可以减少电压检测电路中模拟电路模块的个数,进而缩减了电路的占用面积并降低了电路的功耗。The present invention sets a switching switch 120, which can, for example, couple different threshold voltages to the same comparator in the voltage detection circuit 110 in a preset order under the control of a switch switching signal, thereby achieving the effect of multiplexing the comparator in the voltage detection circuit 110. In this way, the number of analog circuit modules in the voltage detection circuit can be reduced, thereby reducing the circuit's occupied area and reducing the circuit's power consumption.

增益控制电路130的输入端与电压检测电路110耦接,其可接收电压检测电路110输出的控制信号并基于该控制信号生成增益信号,然后输出增益信号至放大器100。例如,在接收到提高增益控制信号后,增益控制电路130可生成提高增益的增益信号以控制放大器100提高增益,而在接收到降低增益控制信号时,可生成降低增益的增益信号以控制放大器100降低增益,从而将放大器的输出电压维持在预设区间。The input end of the gain control circuit 130 is coupled to the voltage detection circuit 110, and the gain control circuit 130 can receive the control signal output by the voltage detection circuit 110 and generate a gain signal based on the control signal, and then output the gain signal to the amplifier 100. For example, after receiving the increase gain control signal, the gain control circuit 130 can generate a gain increase signal to control the amplifier 100 to increase the gain, and when receiving the decrease gain control signal, it can generate a gain decrease signal to control the amplifier 100 to decrease the gain, so as to maintain the output voltage of the amplifier within a preset range.

图2是根据本发明一实施例的增益控制装置的示意性结构框图,其包括电压检测电路110、切换开关120、增益控制电路130,这些器件或电路的布置和功能与图1所示的电路相同,此处不再赘述。FIG2 is a schematic structural block diagram of a gain control device according to an embodiment of the present invention, which includes a voltage detection circuit 110, a switching switch 120, and a gain control circuit 130. The arrangement and functions of these devices or circuits are the same as those of the circuit shown in FIG1 and are not described in detail here.

如图2所示,增益控制装置还包括有切换信号生成电路140,其可配置为生成开关切换信号以控制切换开关120将多个阈值电压耦接到电压检测电路110。在一实施例中,可基于放大器100的检测电压与多个阈值电压比较的结果来生成开关切换信号,切换开关120在接收到该开关切换信号后,可以将连接到不同掷的多个阈值电压按照预设顺序分别耦接到电压检测电路110。如图2所示,切换开关120通过其多个掷S1、S2、S3、S4连接到4个阈值电压,虽然图中只示出了4个掷连接到4个阈值电压,但可以理解的是,其只是一种示例而非限制,可以根据实际应用而设置更少(例如3个)或更多(例如5个、6个等)的阈值电压。切换开关120同时可通过其多个刀(未示出)而将该多个阈值电压连接到电压检测电路110。在图2的示例中,掷S4连接到释放阈值电压RLS_Vref,而掷S1、S2、S3分别连接到多级启动阈值电压AGC1_Vref、AGC2_Vref和AGC3_Vref。As shown in FIG2 , the gain control device further includes a switching signal generating circuit 140, which can be configured to generate a switch switching signal to control the switch 120 to couple multiple threshold voltages to the voltage detection circuit 110. In one embodiment, the switch switching signal can be generated based on the result of comparing the detection voltage of the amplifier 100 with multiple threshold voltages. After receiving the switch switching signal, the switch 120 can couple multiple threshold voltages connected to different throws to the voltage detection circuit 110 in a preset order. As shown in FIG2 , the switch 120 is connected to four threshold voltages through its multiple throws S1, S2, S3, and S4. Although only four throws are shown connected to four threshold voltages in the figure, it can be understood that it is only an example and not a limitation. Fewer (for example, 3) or more (for example, 5, 6, etc.) threshold voltages can be set according to actual applications. The switch 120 can also connect the multiple threshold voltages to the voltage detection circuit 110 through its multiple blades (not shown). In the example of FIG. 2 , the throw S4 is connected to the release threshold voltage RLS_Vref, while the throws S1 , S2 , S3 are connected to the multi-level start threshold voltages AGC1_Vref, AGC2_Vref, and AGC3_Vref, respectively.

在一实施例中,切换信号生成电路140可将放大器100的检测电压与多 个阈值电压按照预设顺序(例如升序)的方式进行比较来生成相应的开关切换信号,如此可实现放大器100的输出电压平稳升高。例如针对图2的示例,假设AGC1_Vref>AGC2_Vref>AGC3_Vref>RLS_Vref,切换信号生成电路140可先输出默认开关切换信号以闭合掷S4从而将RLS_Vref耦接到电压检测电路110,在检测电压大于RLS_Vref后,切换信号生成电路140可生成新的切换信号以闭合掷S3从而将AGC3_Vref耦接到电压检测电路110,之后,在检测电压大于AGC3_Vref后,切换信号生成电路140可生成新的切换信号以闭合掷S2从而将AGC2_Vref耦接到电压检测电路110,之后,在检测电压大于AGC2_Vref后,切换信号生成电路140可生成新的切换信号以闭合掷S1从而将AGC1_Vref耦接到电压检测电路110。可见,在切换信号生成电路140的控制下,切换开关120可将图示的多个阈值电压按照RLS_Vref→AGC3_Vref→AGC2_Vref→AGC1_Vref的顺序分别耦接到电压检测电路110。在阈值电压设置为4个以上(例如5个、6个等)时,切换信号可依此类推。In one embodiment, the switching signal generating circuit 140 can be configured to detect the voltage of the amplifier 100 and multiple The threshold voltages are compared in a preset order (e.g., ascending order) to generate corresponding switch switching signals, so that the output voltage of the amplifier 100 can be smoothly increased. For example, for the example of FIG. 2 , assuming that AGC1_Vref>AGC2_Vref>AGC3_Vref>RLS_Vref, the switch signal generation circuit 140 can first output a default switch switching signal to close the throw S4 so as to couple RLS_Vref to the voltage detection circuit 110. After the detection voltage is greater than RLS_Vref, the switch signal generation circuit 140 can generate a new switch signal to close the throw S3 so as to couple AGC3_Vref to the voltage detection circuit 110. After that, after the detection voltage is greater than AGC3_Vref, the switch signal generation circuit 140 can generate a new switch signal to close the throw S2 so as to couple AGC2_Vref to the voltage detection circuit 110. After that, after the detection voltage is greater than AGC2_Vref, the switch signal generation circuit 140 can generate a new switch signal to close the throw S1 so as to couple AGC1_Vref to the voltage detection circuit 110. It can be seen that under the control of the switching signal generating circuit 140, the switching switch 120 can couple the illustrated multiple threshold voltages to the voltage detection circuit 110 in the order of RLS_Vref→AGC3_Vref→AGC2_Vref→AGC1_Vref. When the threshold voltage is set to more than 4 (for example, 5, 6, etc.), the switching signal can be deduced accordingly.

在该实施例中,切换信号生成电路140可通过常规的比较器电路来实现,在一示例中,如下面描述,由于同时可依据放大器的检测电压与各阈值电压的比较结果来确定增益控制信号,因此可通过复用电压检测电路110中的比较器电路来实现切换信号生成电路140。In this embodiment, the switching signal generating circuit 140 can be implemented by a conventional comparator circuit. In one example, as described below, since the gain control signal can be determined based on the comparison results of the detection voltage of the amplifier and each threshold voltage, the switching signal generating circuit 140 can be implemented by multiplexing the comparator circuit in the voltage detection circuit 110.

下面参照图2并结合具体的阈值电压、控制信号示例等对本发明一示例的增益控制装置的控制原理做进一步详细介绍。如前所述,释放阈值电压RLS_Vref可与提高增益控制信号相关联,如果电压检测电路110检测到放大器的检测电压小于该阈值电压,其将生成提高增益控制信号RLS_FLAG。启动阈值电压AGC3_Vref、AGC2_Vref、AGC1_Vref可与降低增益控制信号相关联,即如果放大器的检测电压超过上述阈值电压,电压检测电路110可生成相应的降低增益控制信号AGC3_FLAG、AGC2_FLAG、AGC1_FLAG并将相应的控制信号输出至增益控制电路130。此外,在检测到放大器的检测电压超过过零点或处于过零区间时,电压检测电路110还可生成过零信号ZeroCross_FLAG。The control principle of the gain control device of an example of the present invention is further described in detail below with reference to FIG. 2 and in combination with specific threshold voltages, control signal examples, etc. As mentioned above, the release threshold voltage RLS_Vref can be associated with the gain control signal. If the voltage detection circuit 110 detects that the detection voltage of the amplifier is less than the threshold voltage, it will generate the gain control signal RLS_FLAG. The start threshold voltages AGC3_Vref, AGC2_Vref, and AGC1_Vref can be associated with the gain control signal. That is, if the detection voltage of the amplifier exceeds the above threshold voltage, the voltage detection circuit 110 can generate corresponding gain control signals AGC3_FLAG, AGC2_FLAG, and AGC1_FLAG and output the corresponding control signal to the gain control circuit 130. In addition, when it is detected that the detection voltage of the amplifier exceeds the zero crossing point or is in the zero crossing interval, the voltage detection circuit 110 can also generate a zero crossing signal ZeroCross_FLAG.

增益控制电路130在接收到控制信号RLS_FLAG、ZeroCross_FLAG、AGC3_FLAG、AGC2_FLAG、AGC1_FLAG中的一个或多个后,其可根据预先设置的增益变化逻辑而生成增益信号并将该增益信号输送至放大器100 以控制降低或恢复放大器的增益。例如,在接收到RLS_FLAG后并维持高电平预定时间后,增益控制电路130可生成提高增益的增益信号以控制放大器100提高增益,而在接收到AGC3_FLAG、AGC2_FLAG或AGC1_FLAG时,可根据相应降低增益控制信号的不同级别来生成降低增益的增益信号来控制放大器100降低增益,从而将放大器的输出电压维持在预设区间。After receiving one or more of the control signals RLS_FLAG, ZeroCross_FLAG, AGC3_FLAG, AGC2_FLAG, and AGC1_FLAG, the gain control circuit 130 may generate a gain signal according to a preset gain change logic and transmit the gain signal to the amplifier 100. To control the reduction or recovery of the gain of the amplifier. For example, after receiving RLS_FLAG and maintaining a high level for a predetermined time, the gain control circuit 130 can generate a gain signal for increasing the gain to control the amplifier 100 to increase the gain, and when receiving AGC3_FLAG, AGC2_FLAG or AGC1_FLAG, a gain signal for reducing the gain can be generated according to different levels of the corresponding gain reduction control signal to control the amplifier 100 to reduce the gain, thereby maintaining the output voltage of the amplifier within a preset range.

在一示例中,降低增益控制信号AGC1_FLAG、AGC2_FLAG、AGC3_FLAG可配置为与不同的降低增益启动时间相关联,例如,AGC1_FLAG、AGC2_FLAG、AGC3_FLAG的降低增益启动时间依次递增。举例而言,增益控制电路130在接收到控制信号AGC3_FLAG或AGC2_FLAG后,增益控制电路130可在该信号触发进行计时,并在确定信号保持或达到一定时间后生成增益信号来降低放大器的增益,而在接收到控制信号AGC1_FLAG后,可立即生成增益信号来降低放大器的增益。这样可以使得在例如监测到放大器的检测电压大于AGC1_Vref时,快速降低放大器的增益以避免出现截顶失真。In one example, the gain reduction control signals AGC1_FLAG, AGC2_FLAG, and AGC3_FLAG can be configured to be associated with different gain reduction start times, for example, the gain reduction start times of AGC1_FLAG, AGC2_FLAG, and AGC3_FLAG are successively increased. For example, after receiving the control signal AGC3_FLAG or AGC2_FLAG, the gain control circuit 130 can trigger timing when the signal is triggered, and generate a gain signal to reduce the gain of the amplifier after determining that the signal is maintained or reaches a certain time, and after receiving the control signal AGC1_FLAG, the gain signal can be immediately generated to reduce the gain of the amplifier. In this way, when, for example, it is monitored that the detection voltage of the amplifier is greater than AGC1_Vref, the gain of the amplifier can be quickly reduced to avoid truncation distortion.

在一示例中,AGC1_FLAG、AGC2_FLAG、AGC3_FLAG、RLS_FLAG可配置为具有不同的优先级,例如,AGC1_FLAG、AGC2_FLAG、AGC3_FLAG的优先级依次递减,即AGC1_FLAG在所有的控制信号中的优先级最高,一旦其被触发,则其余所有的正在计时的控制信号均无效,并且相应的计时清零。这样可以防止不同的降低增益控制信号之间出现逻辑冲突,从而使得在例如监测到放大器的检测电压大于AGC1_Vref时,快速降低放大器的增益以避免出现截顶失真。In one example, AGC1_FLAG, AGC2_FLAG, AGC3_FLAG, and RLS_FLAG can be configured to have different priorities, for example, the priorities of AGC1_FLAG, AGC2_FLAG, and AGC3_FLAG decrease in sequence, that is, AGC1_FLAG has the highest priority among all control signals, and once it is triggered, all other control signals being timed are invalid, and the corresponding timing is reset. This can prevent logical conflicts between different gain reduction control signals, so that when, for example, the detection voltage of the amplifier is detected to be greater than AGC1_Vref, the gain of the amplifier is quickly reduced to avoid truncation distortion.

在一示例中,与降低增益控制信号相关的多级启动阈值电压AGC1_Vref、AGC2_Vref、AGC3_Vref中的一个阈值电压是可随放大器的供给电压而变化的,例如与优先级最高的控制信号AGC1_FLAG相关联的阈值电压AGC1_Vref的大小是根据放大器100的实际供给电压大小而变化。这样可以使得在放大器的供给电压出现波动(例如低于额定电压)时,能够相应地降低用于监测截顶失真的阈值电压AGC1_Vref,从而提高增益控制装置的适用性。In one example, one of the multi-level startup threshold voltages AGC1_Vref, AGC2_Vref, and AGC3_Vref associated with the gain reduction control signal can vary with the supply voltage of the amplifier, for example, the magnitude of the threshold voltage AGC1_Vref associated with the control signal AGC1_FLAG with the highest priority varies according to the actual supply voltage of the amplifier 100. In this way, when the supply voltage of the amplifier fluctuates (for example, lower than the rated voltage), the threshold voltage AGC1_Vref for monitoring truncation distortion can be reduced accordingly, thereby improving the applicability of the gain control device.

在AGC1_Vref随放大器实际的供给电压而变化的情形下,其实际值可能大于AGC2_Vref、AGC3_Vref,也可能介于AGC2_Vref、AGC3_Vref之间,还可能小于AGC2_Vref、AGC3_Vref。由于各级阈值电压AGC3_Vref、 AGC2_Vref、AGC1_Vref是在切换信号生成电路140生成的开关切换信号控制下耦接到电压检测电路110的,因此在阈值电压AGC1_Vref、AGC2_Vref、AGC3_Vref的大小关系发生改变时,需要相应地调整开关切换信号的生成顺序,以使得各级阈值电压仍能够按照预设顺序(例如,升序)的方式与检测电压进行比较来生成开关切换信号,从而实现放大器输出电压的平稳提升,并在检测电压大于AGC1_Vref时能够及时降低增益,防止出现截顶失真。When AGC1_Vref changes with the actual supply voltage of the amplifier, its actual value may be greater than AGC2_Vref and AGC3_Vref, or between AGC2_Vref and AGC3_Vref, or less than AGC2_Vref and AGC3_Vref. AGC2_Vref and AGC1_Vref are coupled to the voltage detection circuit 110 under the control of the switch switching signal generated by the switch signal generating circuit 140. Therefore, when the magnitude relationship among the threshold voltages AGC1_Vref, AGC2_Vref and AGC3_Vref changes, it is necessary to adjust the generation order of the switch switching signals accordingly, so that the threshold voltages of each level can still be compared with the detection voltage in a preset order (for example, ascending order) to generate the switch switching signal, thereby achieving a smooth increase in the output voltage of the amplifier, and being able to reduce the gain in time when the detection voltage is greater than AGC1_Vref to prevent truncation distortion.

为此,如图2所示,在一实施例中,增益控制装置还包括有模式信号生成电路150,其可配置为基于多个阈值电压AGC1_Vref、AGC2_Vref、AGC3_Vref之间的大小关系生成模式信号(MODE_FLAG),该模式信号可与将该多个阈值电压分别与检测电压进行比较的预设顺序相关联,也就是说,该模式信号与切换开关120的切换顺序相关联。例如,模式信号生成电路150可将模式信号MODE_FLAG输出至切换信号生成电路140,其在接收到MODE_FLAG后相应地决定放大器的检测电压与多个阈值电压之间进行比较的比较顺序,并生成相应的开关切换信号来控制切换开关120将对应的阈值电压按照前述预设顺序分别耦接至电压检测电路110。To this end, as shown in FIG2 , in one embodiment, the gain control device further includes a mode signal generating circuit 150, which may be configured to generate a mode signal (MODE_FLAG) based on the magnitude relationship between the multiple threshold voltages AGC1_Vref, AGC2_Vref, and AGC3_Vref, and the mode signal may be associated with a preset sequence of comparing the multiple threshold voltages with the detection voltages, that is, the mode signal is associated with the switching sequence of the switch 120. For example, the mode signal generating circuit 150 may output the mode signal MODE_FLAG to the switching signal generating circuit 140, which determines the comparison sequence between the detection voltage of the amplifier and the multiple threshold voltages accordingly after receiving the MODE_FLAG, and generates a corresponding switch switching signal to control the switch 120 to couple the corresponding threshold voltages to the voltage detection circuit 110 in the aforementioned preset sequence.

参照图2,在放大器上电并启动增益控制时,模式信号生成电路150可根据与降低增益控制信号有关的阈值电压AGC1_Vref、AGC2_Vref、AGC3_Vref之间的比较关系确定出相应的模式信号,由于只有阈值电压AGC1_Vref为根据放大器的实际供给电压而可变的,因此,可将该AGC1_Vref与AGC2_Vref、AGC3_Vref进行比较并根据比较结果确定模式信号,而且,模式信号的数量与所设置的启动阈值电压的个数相同。例如,在AGC1_Vref大于AGC2_Vref、AGC3_Vref时,模式信号生成电路150生成默认的模式信号MODE1_FLAG,在AGC1_Vref介于AGC2_Vref、AGC3_Vref之间时,模式信号生成电路150生成第二模式信号MODE2_FLAG,而在AGC1_Vref小于AGC2_Vref、AGC3_Vref时,模式信号生成电路150生成第三模式信号MODE3_FLAG。2 , when the amplifier is powered on and gain control is started, the mode signal generating circuit 150 can determine the corresponding mode signal based on the comparison relationship between the threshold voltages AGC1_Vref, AGC2_Vref, and AGC3_Vref related to reducing the gain control signal. Since only the threshold voltage AGC1_Vref is variable according to the actual supply voltage of the amplifier, the AGC1_Vref can be compared with AGC2_Vref and AGC3_Vref and the mode signal can be determined based on the comparison result. Moreover, the number of mode signals is the same as the number of the set start threshold voltages. For example, when AGC1_Vref is greater than AGC2_Vref and AGC3_Vref, the mode signal generating circuit 150 generates a default mode signal MODE1_FLAG; when AGC1_Vref is between AGC2_Vref and AGC3_Vref, the mode signal generating circuit 150 generates a second mode signal MODE2_FLAG; and when AGC1_Vref is less than AGC2_Vref and AGC3_Vref, the mode signal generating circuit 150 generates a third mode signal MODE3_FLAG.

不同的模式信号决定了放大器的检测电压与各级阈值电压进行比较的顺序,相应地,其也就决定了切换开关S1-S4的切换顺序,使得例如放大器的检测电压能够与各级阈值电压按照预设顺序(例如,升序)的方式进行比较。例如,假定放大器上电后切换开关120初始切换到S4并将RLS_Vref耦接到电压检测电路110,因此,在MODE1_FLAG下,切换开关的切换顺 序可以是S4→S3→S2→S1,在MODE2_FLAG下,切换开关的切换顺序可以是S4→S3→S1(由于在检测电压大于AGC1_Vref时会立即降低增益,因此切换开关一般不需切换到S2),在MODE3_FLAG下,切换开关的切换顺序可以是S4→S1。不同的模式信号下切换开关的切换控制将在后面结合图6-8进行具体描述。Different mode signals determine the order in which the detection voltage of the amplifier is compared with the threshold voltages of each level, and accordingly, they determine the switching order of the switches S1-S4, so that, for example, the detection voltage of the amplifier can be compared with the threshold voltages of each level in a preset order (for example, ascending order). For example, assuming that after the amplifier is powered on, the switch 120 is initially switched to S4 and RLS_Vref is coupled to the voltage detection circuit 110, therefore, under MODE1_FLAG, the switching order of the switch is The switching sequence can be S4→S3→S2→S1. Under MODE2_FLAG, the switching sequence of the switch can be S4→S3→S1 (because the gain will be immediately reduced when the detection voltage is greater than AGC1_Vref, the switch generally does not need to be switched to S2). Under MODE3_FLAG, the switching sequence of the switch can be S4→S1. The switching control of the switch under different mode signals will be described in detail later in conjunction with Figures 6-8.

在该实施例中,由于不同的控制信号对应于不同的增益变化逻辑,并且具有不同的优先级,因此在不同的模式信号下,电压检测电路110可生成具有不同时序的控制信号,相应地,增益控制电路130将生成不同的增益信号来实现放大器的增益控制,这能够提高增益控制装置的适用性,例如即使放大器的供给电压处于低电位时,仍能实现放大器输出电压的平稳提升,并防止出现截顶失真,同时降低系统功耗。In this embodiment, since different control signals correspond to different gain change logics and have different priorities, the voltage detection circuit 110 can generate control signals with different timings under different mode signals. Accordingly, the gain control circuit 130 will generate different gain signals to achieve gain control of the amplifier, which can improve the applicability of the gain control device. For example, even when the supply voltage of the amplifier is at a low potential, the output voltage of the amplifier can still be smoothly increased, and truncation distortion can be prevented, while reducing system power consumption.

在一些实施例中,如图2所示,模式信号MODE_FLAG还可输出至电压检测电路110以用于确定部分增益控制信号的生成,这将在下面结合图3进行具体描述。In some embodiments, as shown in FIG. 2 , the mode signal MODE_FLAG may also be output to the voltage detection circuit 110 for determining the generation of a portion of the gain control signal, which will be described in detail below in conjunction with FIG. 3 .

图3是根据本发明一实施例的增益控制装置中的电压检测电路的示意性电路图,其实施为模拟电路。如图3所示,在一实施方式中,电压检测电路可包括多个比较器202-208,每个比较器的一个输入端直接或通过切换开关(图3中示出了切换开关的刀和掷和连接到各掷的阈值电压)耦接到放大器100的检测电压AGC_IN,另一个输入端直接耦接到判断检测电压是否过零的电压(共模电平)或通过切换开关耦接到多个阈值电压中的一个阈值电压。通过使用切换开关,本实施例只需设置4个比较器可以实现放大器的多级增益控制,而采用现有技术的方式将需要至少9个比较器,因此,本实施例可以简化模拟电路结构,降低电路的占用面积并降低电路功耗。FIG3 is a schematic circuit diagram of a voltage detection circuit in a gain control device according to an embodiment of the present invention, which is implemented as an analog circuit. As shown in FIG3, in one embodiment, the voltage detection circuit may include a plurality of comparators 202-208, one input end of each comparator is directly or through a switching switch (the switch blade and the throw and the threshold voltage connected to each throw are shown in FIG3) coupled to the detection voltage AGC_IN of the amplifier 100, and the other input end is directly coupled to the voltage (common mode level) for judging whether the detection voltage is zero-crossing or coupled to one of the plurality of threshold voltages through the switching switch. By using the switching switch, the present embodiment only needs to set 4 comparators to realize the multi-stage gain control of the amplifier, while the prior art method will require at least 9 comparators, therefore, the present embodiment can simplify the analog circuit structure, reduce the circuit occupation area and reduce the circuit power consumption.

第一比较器202的正向输入端与放大器的检测电压AGC_IN耦接,反向输入端与共模电平VCM耦接,通过将其接收的检测电压与预设的共模电平进行比较,当第一比较器202确定检测电压与共模电平VCM相等时,可以确定电压信号通过零点并输出过零信号ZeroCross_FLAG。如下文所述,该过零信号可与降低增益控制信号(AGC1_FLAG、AGC2_FLAG、AGC3_FLAG)和/或提高增益控制信号(RLS_FLAG)一起用于确定增益信号来控制放大器的增益。如图所示,异或门212将该过零信号ZeroCross_FLAG经过延迟电路210(由反相器和延迟单元串联构成)后得到的延迟比较信号与过零信号 ZeroCross_FLAG进行相应处理后,输出清零信号CLR_FLAG,该清零信号CLR_FLAG在输出过零信号时翻转为高电平,其可用于对触发器220、222的输出进行清零,这也将在后面进行具体描述。The positive input terminal of the first comparator 202 is coupled to the detection voltage AGC_IN of the amplifier, and the reverse input terminal is coupled to the common mode level VCM. By comparing the detection voltage received by it with the preset common mode level, when the first comparator 202 determines that the detection voltage is equal to the common mode level VCM, it can be determined that the voltage signal passes through the zero point and outputs the zero-crossing signal ZeroCross_FLAG. As described below, the zero-crossing signal can be used together with the gain reduction control signal (AGC1_FLAG, AGC2_FLAG, AGC3_FLAG) and/or the gain increase control signal (RLS_FLAG) to determine the gain signal to control the gain of the amplifier. As shown in the figure, the XOR gate 212 compares the delayed comparison signal obtained after the zero-crossing signal ZeroCross_FLAG passes through the delay circuit 210 (composed of an inverter and a delay unit in series) with the zero-crossing signal After ZeroCross_FLAG is processed accordingly, a clear signal CLR_FLAG is output. The clear signal CLR_FLAG flips to a high level when a zero-crossing signal is output. The clear signal CLR_FLAG can be used to clear the outputs of the triggers 220 and 222, which will also be described in detail later.

第二比较器204的正向输入端和反向输入端经由切换开关分别与多个阈值电压中的与提高增益控制相关联的释放阈值电压RLS_Vref和放大器的检测电压AGC_IN耦接,其中,RLS_Vref包括一对与共模电压VCM的差值的绝对值相等但互为正负的阈值电压RLS_VH、RLS_VL,以分别用于在检测电压AGC_IN为正值和负值时判断是否需要进行提高增益。在一示例中,可基于开关切换信号进行阈值电压的切换。具体而言,在检测电压信号AGC_IN处于高电平相位时,例如AGC_IN>VCM(例如对于正弦信号,相位为0-π/2)时,开关切换信号可控制比较器204的正向输入端连接到阈值电压RLS_VH,反向输入端连接到检测电压AGC_IN,而在检测电压信号AGC_IN处于低电平相位时,例如AGC_IN<VCM(例如对于正弦信号,相位为π-3/2π)时,开关切换信号将控制比较器204的正向输入端连接到检测电压AGC_IN,反向输入端连接到阈值电压RLS_VL。通过这种信号控制,当检测电压AGC_IN介于RLS_VH和RLS_VL之间时,比较器204将输出提高增益控制信号RLS_FLAG。在一示例中,如图3所示,为了保证降低增益控制信号AGC1_FLAG、AGC2_FLAG、AGC3_FLAG的优先级,提高增益控制信号RLS_FLAG可通过与门运算单元216输出,该与门运算单元216的第一输入端接收比较器204的输出信号,第二输入端接收或非门214的输出,该或非门214的设置有三个输入端,其分别接收降低增益控制信号AGC1_FLAG、AGC2_FLAG、AGC3_FLAG。The positive input terminal and the reverse input terminal of the second comparator 204 are respectively coupled to a release threshold voltage RLS_Vref associated with the gain control and the detection voltage AGC_IN of the amplifier among the multiple threshold voltages via a switching switch, wherein RLS_Vref includes a pair of threshold voltages RLS_VH and RLS_VL whose absolute values of the difference with the common mode voltage VCM are equal but are positive and negative to each other, so as to judge whether the gain needs to be increased when the detection voltage AGC_IN is positive and negative respectively. In one example, the switching of the threshold voltage can be performed based on the switch switching signal. Specifically, when the detection voltage signal AGC_IN is in a high level phase, such as AGC_IN>VCM (for example, for a sinusoidal signal, the phase is 0-π/2), the switch switching signal can control the positive input terminal of the comparator 204 to be connected to the threshold voltage RLS_VH, and the reverse input terminal to be connected to the detection voltage AGC_IN, and when the detection voltage signal AGC_IN is in a low level phase, such as AGC_IN<VCM (for example, for a sinusoidal signal, the phase is π-3/2π), the switch switching signal will control the positive input terminal of the comparator 204 to be connected to the detection voltage AGC_IN, and the reverse input terminal to be connected to the threshold voltage RLS_VL. Through this signal control, when the detection voltage AGC_IN is between RLS_VH and RLS_VL, the comparator 204 will output the gain control signal RLS_FLAG. In an example, as shown in FIG. 3 , in order to ensure the priority of the gain control signals AGC1_FLAG, AGC2_FLAG, and AGC3_FLAG being reduced, the gain control signal RLS_FLAG can be output through an AND gate operation unit 216, a first input end of the AND gate operation unit 216 receiving the output signal of the comparator 204, and a second input end receiving the output of the NOR gate 214, the NOR gate 214 being provided with three input ends, which respectively receive the gain control signals AGC1_FLAG, AGC2_FLAG, and AGC3_FLAG being reduced.

第三比较器206和第四比较器208用于确定至少一个降低增益控制信号。第三比较器206的反向输入端与放大器的检测电压AGC_IN耦接,另一端经由切换开关与多个阈值电压(AGC1_VL、AGC2_VL、AGC3_VL)中的一个阈值电压耦接。第四比较器208的正向输入端与放大器的检测电压AGC_IN耦接,另一端经由切换开关与多个阈值电压(AGC1_VH、AGC2_VH、AGC3_VH)中的一个阈值电压耦接。其中阈值电压AGC1_VL、AGC2_VL、AGC3_VL分别与阈值电压AGC1_VH、AGC2_VH、AGC3_VH相关联,例如,AGC1_VL、AGC1_VH与共模电压VCM的差值的绝对值相等,只是正负值相反,AGC2_Vref和AGC3_Vref同样如此。即电压对(AGC1_VH、 AGC1_VL)、(AGC2_VH、AGC2_VL)、(AGC3_VH、AGC3_VL)分别对应于图2所示的AGC1_Vref、AGC2_Vref、AGC3_Vref。开关控制信号可同时控制第三比较器206的正向输入端和第四比较器208的反向输入端分别耦接到一对阈值电压对。虽然图中只示出了比较器206和208分别连接到三个阈值电压,但可以理解,基于实际需要可以设置更少(例如2个)或者更多(例如4个)的阈值电压。The third comparator 206 and the fourth comparator 208 are used to determine at least one gain reduction control signal. The inverting input terminal of the third comparator 206 is coupled to the detection voltage AGC_IN of the amplifier, and the other end is coupled to one of the threshold voltages (AGC1_VL, AGC2_VL, AGC3_VL) via a switching switch. The positive input terminal of the fourth comparator 208 is coupled to the detection voltage AGC_IN of the amplifier, and the other end is coupled to one of the threshold voltages (AGC1_VH, AGC2_VH, AGC3_VH) via a switching switch. Wherein the threshold voltages AGC1_VL, AGC2_VL, AGC3_VL are respectively associated with the threshold voltages AGC1_VH, AGC2_VH, AGC3_VH, for example, the absolute values of the differences between AGC1_VL, AGC1_VH and the common mode voltage VCM are equal, but the positive and negative values are opposite, and the same is true for AGC2_Vref and AGC3_Vref. That is, the voltage pair (AGC1_VH, AGC1_VL), (AGC2_VH, AGC2_VL), (AGC3_VH, AGC3_VL) correspond to AGC1_Vref, AGC2_Vref, AGC3_Vref shown in FIG2 , respectively. The switch control signal can simultaneously control the positive input terminal of the third comparator 206 and the negative input terminal of the fourth comparator 208 to be coupled to a pair of threshold voltage pairs, respectively. Although the figure only shows that the comparators 206 and 208 are respectively connected to three threshold voltages, it can be understood that fewer (e.g., 2) or more (e.g., 4) threshold voltages can be set based on actual needs.

多个阈值电压AGC1_VH、AGC2_VH、AGC3_VH可根据实际需要而设置,作为示例,其关系为AGC1_VH>AGC2_VH>AGC3_VH。在另一示例中,如前面描述,三个阈值电压中的第一阈值电压(例如AGC1_VH、AGC1_VL电压对)的值可与放大器100的供给电压正相关联,另外两个阈值电压AGC2_VH/AGC2_VL、AGC3_VH/AGC3_VL则配置为具有固定值,因此在放大器的供给电压较小时,实际的AGC1_VH可能介于AGC2_VH、AGC3_VH之间,或者小于AGC2_VH、AGC3_VH。如前面描述,在不同的模式信号下,阈值电压AGC1_VH、AGC2_VH、AGC3_VH将按照对应的预设顺序被耦接到比较器208的反向输入端。相应地,阈值电压AGC1_VL、AGC2_VL、AGC3_VL也将按照预设顺序被耦接到比较器206的正向输入端。Multiple threshold voltages AGC1_VH, AGC2_VH, and AGC3_VH can be set according to actual needs. As an example, the relationship is AGC1_VH>AGC2_VH>AGC3_VH. In another example, as described above, the value of the first threshold voltage (for example, the voltage pair of AGC1_VH and AGC1_VL) among the three threshold voltages can be positively correlated with the supply voltage of the amplifier 100, and the other two threshold voltages AGC2_VH/AGC2_VL and AGC3_VH/AGC3_VL are configured to have fixed values, so when the supply voltage of the amplifier is small, the actual AGC1_VH may be between AGC2_VH and AGC3_VH, or less than AGC2_VH and AGC3_VH. As described above, under different mode signals, the threshold voltages AGC1_VH, AGC2_VH, and AGC3_VH will be coupled to the inverting input terminal of the comparator 208 in a corresponding preset order. Accordingly, the threshold voltages AGC1_VL, AGC2_VL, AGC3_VL will also be coupled to the positive input terminal of the comparator 206 in a predetermined order.

如图3所示,第三比较器206和第四比较器208的输出通过或门218进行或运算后输出,其可用于确定至少一个降低增益控制信号。例如,在AGC_IN超过AGC3_VH或低于AGC3_VL时,该或门218的输出可用于确定AGC3_FLAG,在AGC_IN超过AGC2_VH或低于AGC2_VL时,该或门218的输出可用于确定AGC2_FLAG,并且在AGC_IN超过AGC1_VH或低于AGC1_VL时,该或门218的输出可用于确定AGC1_FLAG。As shown in Fig. 3, the outputs of the third comparator 206 and the fourth comparator 208 are outputted after being ORed by the OR gate 218, which can be used to determine at least one gain reduction control signal. For example, when AGC_IN exceeds AGC3_VH or is lower than AGC3_VL, the output of the OR gate 218 can be used to determine AGC3_FLAG, when AGC_IN exceeds AGC2_VH or is lower than AGC2_VL, the output of the OR gate 218 can be used to determine AGC2_FLAG, and when AGC_IN exceeds AGC1_VH or is lower than AGC1_VL, the output of the OR gate 218 can be used to determine AGC1_FLAG.

为了能够对对各个降低增益控制信号(例如AGC1_FLAG、AGC2_FLAG、AGC3_FLAG)进行追踪以用于增益控制电路130确定出放大器的增益信号,需要分立的增益控制信号生成电路来分别生成每个降低增益控制信号。在一实施例中,可通过触发器来对各个降低增益控制信号进行分离。如图3所示,增益控制信号生成电路可包括串联的N个触发器,N≥2,其可对应于降低增益控制信号的个数,也可少于降低增益控制信号的个数(例如,N=降低增益控制信号的个数-1),触发器可选择为D触发器。每个触发器220、222的C端通过或门218耦接到第三比较器206和第四比较器208的输出端。触发器220的D端耦接到拉高电平。由于在放大器的检测电压AGC_IN超过比 较器208连接的AGC3_VH或低于比较器206连接的AGC3_VL时,或门218将输出一个上升沿信号,输出的脉冲信号可使触发器220触发在Q端输出高电平,因此可以基于触发器220的Q端输出确定降低增益控制信号AGC3_FLAG。In order to be able to track each gain reduction control signal (e.g., AGC1_FLAG, AGC2_FLAG, AGC3_FLAG) for the gain control circuit 130 to determine the gain signal of the amplifier, a separate gain control signal generation circuit is required to generate each gain reduction control signal separately. In one embodiment, each gain reduction control signal can be separated by a trigger. As shown in FIG3, the gain control signal generation circuit may include N triggers connected in series, N ≥ 2, which may correspond to the number of gain reduction control signals, or may be less than the number of gain reduction control signals (e.g., N = the number of gain reduction control signals - 1), and the trigger may be selected as a D trigger. The C terminal of each trigger 220, 222 is coupled to the output terminal of the third comparator 206 and the fourth comparator 208 through the OR gate 218. The D terminal of the trigger 220 is coupled to the pull-up level. Since the detection voltage AGC_IN of the amplifier exceeds the ratio When AGC3_VH connected to comparator 208 is lower than AGC3_VL connected to comparator 206, OR gate 218 will output a rising edge signal. The output pulse signal can trigger trigger 220 to output a high level at the Q end. Therefore, the gain control signal AGC3_FLAG can be reduced based on the Q end output of trigger 220.

触发器220的Q端连接到触发器222的D端,例如在放大器的检测电压AGC_IN超过AGC3_VH时,切换开关可在切换信号控制下将阈值电压AGC2_VH、AGC2_VL分别连接到比较器208和比较器206,此时如果AGC_IN超过比较器208连接的AGC2_VH或低于比较器206连接的AGC2_VL时,或门218将再次输出高电平,输出的脉冲信号可使触发器222触发在Q端输出高电平,因此可以基于触发器222的Q端输出确定降低增益控制信号AGC2_FLAG。在一示例中,触发器220、222的清零端CLR耦接到异或门212输出的清零信号CLR_FLAG,用于在检测电压AGC_IN过零时对触发器的Q端输出进行清零处理。The Q terminal of the trigger 220 is connected to the D terminal of the trigger 222. For example, when the detection voltage AGC_IN of the amplifier exceeds AGC3_VH, the switch can connect the threshold voltages AGC2_VH and AGC2_VL to the comparator 208 and the comparator 206 respectively under the control of the switching signal. At this time, if AGC_IN exceeds AGC2_VH connected to the comparator 208 or is lower than AGC2_VL connected to the comparator 206, the OR gate 218 will output a high level again, and the output pulse signal can trigger the trigger 222 to output a high level at the Q terminal, so the gain control signal AGC2_FLAG can be determined based on the Q terminal output of the trigger 222. In an example, the clear terminal CLR of the triggers 220 and 222 is coupled to the clear signal CLR_FLAG output by the XOR gate 212, which is used to clear the Q terminal output of the trigger when the detection voltage AGC_IN passes through zero.

依此类推,在一示例中,可设置与触发器222串联的第三触发器(未示出)用以确定降低增益控制信号AGC1_FLAG。By analogy, in one example, a third flip-flop (not shown) connected in series with the flip-flop 222 may be set to determine the reduced gain control signal AGC1_FLAG.

在另一示例中,AGC1_FLAG的降低增益控制信号生成电路可通过其它电路模块来实现,以适于阈值电压AGC1_VH/AGC1_VL随放大器的供给电压而变化的情形。图3示出了一具体实施方式,如图所示,可设置与门运算单元224以用于确定降低增益控制信号AGC1_FLAG,该与门224的第一输入端通过或门226与触发器222输出的降低增益控制信号AGC2_FLAG耦接,与门224的第二输入端通过或门218与第三比较器206和第四比较器208的输出耦接。或门226的第一输入端与多个串联触发器220、222的最后一个触发器的输出信号耦接,或门226的第二输入端的输入则通过门电路与模式信号耦接,例如,该第二输入端接收或门228的输出,或门228的第一输入端与模式信号MODE3_FLAG耦接,或门230的第二输入端则接收与门230的输出,该与门230的第一输入端与模式信号MODE2_FLAG耦接,与门230的第二输入端与触发器220的输出信号AGC3_FLAG耦接。通过该示例性电路设置,电压检测电路根据电压比较结果和模式信号来确定AGC1_FLAG,从而可以适应不同的增益控制模式,例如在模式MODE2(AGC2_VH>AGC1_VH>AGC3_VH)下,增益控制信号AGC1_FLAG可以先于AGC2_FLAG被触发,在模式MODE3(AGC2_VH>AGC3_VH> AGC1_VH)下,增益控制信号AGC1_FLAG可以先于AGC2_FLAG、AGC3_FLAG被触发,不同控制模式下的放大器增益控制将在下面进行具体描述。In another example, the gain reduction control signal generating circuit of AGC1_FLAG can be implemented by other circuit modules to adapt to the situation that the threshold voltage AGC1_VH/AGC1_VL varies with the supply voltage of the amplifier. FIG3 shows a specific embodiment. As shown in the figure, an AND gate operation unit 224 can be set to determine the gain reduction control signal AGC1_FLAG. The first input terminal of the AND gate 224 is coupled to the gain reduction control signal AGC2_FLAG output by the trigger 222 through the OR gate 226. The second input terminal of the AND gate 224 is coupled to the outputs of the third comparator 206 and the fourth comparator 208 through the OR gate 218. The first input terminal of the OR gate 226 is coupled to the output signal of the last trigger of the plurality of serially connected triggers 220 and 222, and the input of the second input terminal of the OR gate 226 is coupled to the mode signal through a gate circuit. For example, the second input terminal receives the output of the OR gate 228, and the first input terminal of the OR gate 228 is coupled to the mode signal MODE3_FLAG. The second input terminal of the OR gate 230 receives the output of the AND gate 230, and the first input terminal of the AND gate 230 is coupled to the mode signal MODE2_FLAG, and the second input terminal of the AND gate 230 is coupled to the output signal AGC3_FLAG of the trigger 220. With this exemplary circuit configuration, the voltage detection circuit determines AGC1_FLAG according to the voltage comparison result and the mode signal, so as to adapt to different gain control modes. For example, in mode MODE2 (AGC2_VH>AGC1_VH>AGC3_VH), the gain control signal AGC1_FLAG can be triggered before AGC2_FLAG, and in mode MODE3 (AGC2_VH>AGC3_VH> In the case of AGC1_VH, the gain control signal AGC1_FLAG may be triggered before AGC2_FLAG and AGC3_FLAG. The amplifier gain control in different control modes will be described in detail below.

图4是根据本发明一实施例的增益控制装置中的模式信号生成电路的示意性电路图,其可应用于图2-3所示出的设置有三个启动阈值电压(AGC1_Vref、AGC2_Vref、AGC3_Vref)的情形。如图4所示,模式信号生成电路可包括比较器302和两个触发器304、306。其中,比较器302的正向输入端和反向输入端经由切换开关308分别与第一阈值电压(例如AGC1_VL)和固定的阈值电压(例如AGC2_VL、AGC3_VL)耦接。该切换开关308可通过模式信号MODE2_FLAG来进行控制,具体而言,在MODE2_FLAG为0时(例如系统工作于默认的MODE1时),其反相信号为1,此时比较器302的正向输入端耦接到AGC1_VL,反向输入端耦接到AGC2_VL。在MODE2_FLAG为1时,比较器302的正向输入端则耦接到AGC3_VL,反向输入端耦接到AGC1_VL。触发器304的D端耦接到拉高电平,其C端耦接到比较器302的输出端,其Q端输出可用于确定模式信号MODE2_FLAG。触发器306的C端经由反相器310耦接到比较器302的输出端,D端连接到触发器304的Q端,可基于触发器306的Q端输出确定模式信号MODE3_FLAG。FIG4 is a schematic circuit diagram of a mode signal generating circuit in a gain control device according to an embodiment of the present invention, which can be applied to the case where three start-up threshold voltages (AGC1_Vref, AGC2_Vref, AGC3_Vref) are provided as shown in FIG2-3. As shown in FIG4, the mode signal generating circuit may include a comparator 302 and two triggers 304 and 306. The positive input terminal and the reverse input terminal of the comparator 302 are respectively coupled to the first threshold voltage (e.g., AGC1_VL) and the fixed threshold voltage (e.g., AGC2_VL, AGC3_VL) via a switching switch 308. The switching switch 308 can be controlled by the mode signal MODE2_FLAG. Specifically, when MODE2_FLAG is 0 (e.g., when the system works in the default MODE1), its inverted signal is 1, and at this time, the positive input terminal of the comparator 302 is coupled to AGC1_VL, and the reverse input terminal is coupled to AGC2_VL. When MODE2_FLAG is 1, the positive input of the comparator 302 is coupled to AGC3_VL, and the negative input is coupled to AGC1_VL. The D terminal of the trigger 304 is coupled to the pull-up level, and its C terminal is coupled to the output terminal of the comparator 302, and its Q terminal output can be used to determine the mode signal MODE2_FLAG. The C terminal of the trigger 306 is coupled to the output terminal of the comparator 302 via the inverter 310, and the D terminal is connected to the Q terminal of the trigger 304. The mode signal MODE3_FLAG can be determined based on the Q terminal output of the trigger 306.

图4示出的模式信号生成电路的工作原理如下,初始状态下,比较器302的正向输入端耦接到AGC1_VL,反向输入端耦接到AGC2_VL,如果系统处于默认的MODE1(即AGC1_VL<AGC2_VL),则比较器302输出低电平,触发器304、306的输出也均为低电平,即MODE2_FLAG、MODE3_FLAG均为0,并且反相器312处的输出为1,因此切换开关308并不发生切换。The working principle of the mode signal generating circuit shown in Figure 4 is as follows: in the initial state, the positive input terminal of the comparator 302 is coupled to AGC1_VL, and the reverse input terminal is coupled to AGC2_VL. If the system is in the default MODE1 (ie, AGC1_VL<AGC2_VL), the comparator 302 outputs a low level, and the outputs of the triggers 304 and 306 are also low levels, that is, MODE2_FLAG and MODE3_FLAG are both 0, and the output at the inverter 312 is 1, so the switching switch 308 does not switch.

如果AGC1_VL发生变动而使得工作模式不再为MODE1时,例如AGC1_VL>AGC2_VL,比较器302输出由低到高,输出的脉冲信号可使触发器304触发在Q端输出高电平,即MODE2_FLAG为1,此时切换开关308发生切换,即比较器302的正向输入端将耦接到AGC3_VL,反向输入端耦接到AGC1_VL。如果AGC1_VL<AGC3_VL,则比较器302依旧输出高电平,模式信号MODE2_FLAG依旧为1。而如果AGC1_VL>AGC3_VL,那么比较器302输出再由高变低,经由反相器310形成脉冲信号使触发器306触发在Q端输出高电平,即MODE3_FLAG为1,从而可判断系统处于工作 模式MODE3下。If AGC1_VL changes and the working mode is no longer MODE1, for example, AGC1_VL>AGC2_VL, the output of comparator 302 changes from low to high, and the output pulse signal can trigger trigger 304 to output a high level at the Q end, that is, MODE2_FLAG is 1. At this time, the switch 308 switches, that is, the positive input end of comparator 302 will be coupled to AGC3_VL, and the reverse input end will be coupled to AGC1_VL. If AGC1_VL<AGC3_VL, then comparator 302 still outputs a high level, and the mode signal MODE2_FLAG is still 1. If AGC1_VL>AGC3_VL, then the output of comparator 302 changes from high to low again, and a pulse signal is formed through inverter 310 to trigger trigger 306 to output a high level at the Q end, that is, MODE3_FLAG is 1, so that it can be determined that the system is in working state. Mode MODE3.

可以理解的是,虽然图4示意出了特定的电路结构,但本申请不限于此,例如,在设置有更少或更多个阈值电压的情况下,本领域技术人员可以通过比较器、触发器而设计相应的电路来确定模式信号。It is understandable that although FIG. 4 illustrates a specific circuit structure, the present application is not limited thereto. For example, when fewer or more threshold voltages are set, a person skilled in the art may design a corresponding circuit through a comparator or a trigger to determine the mode signal.

图5示出了根据本发明一实施例的增益控制方法的流程图,如图5所示,该控制方法可包括如下步骤:FIG5 shows a flow chart of a gain control method according to an embodiment of the present invention. As shown in FIG5 , the control method may include the following steps:

步骤410,确定多个阈值电压,该多个阈值电压可包括第一阈值电压和固定的至少一级阈值电压,其中,所述第一阈值电压大小与放大器的供给电压大小相关联。Step 410 : determining a plurality of threshold voltages, where the plurality of threshold voltages may include a first threshold voltage and at least one fixed threshold voltage, wherein the first threshold voltage is associated with a supply voltage of the amplifier.

在一实施例中,结合图2-3,可根据实际需要确定多级启动阈值电压AGC1_Vref、AGC2_Vref、AGC3_Vref和释放阈值电压RLS_Vref,其中每级启动阈值电压分别包括一对正负值阈值电压,例如AGC1_Vref包括正值AGC1_VH和相应的负值AGC1_VL,AGC2_Vref、AGC3_Vref依此类推。其中,该多级阈值电压中可包括与放大器的供给电压相关联的第一阈值电压(例如,阈值电压AGC1_Vref),其余至少一级阈值电压AGC2_Vref、AGC3_Vref可配置为具有固定的预设值(以下分别称为第二阈值电压和第三阈值电压)。通过这种配置,本发明可以根据放大器的实际供给电压而调整增益控制模式,从而提高增益控制的适用性,并降低电路功耗。可以理解的是,可以根据实际需要确定更少(例如2级)或更多(例如4级)的启动阈值电压,即本实施例的增益控制方法不限于应用于图2-3所示的增益控制装置。In one embodiment, in combination with FIG. 2-3, a multi-level startup threshold voltage AGC1_Vref, AGC2_Vref, AGC3_Vref and a release threshold voltage RLS_Vref can be determined according to actual needs, wherein each level of startup threshold voltage includes a pair of positive and negative threshold voltages, for example, AGC1_Vref includes a positive value AGC1_VH and a corresponding negative value AGC1_VL, and AGC2_Vref, AGC3_Vref and so on. Among them, the multi-level threshold voltage may include a first threshold voltage (for example, threshold voltage AGC1_Vref) associated with the supply voltage of the amplifier, and the remaining at least one level of threshold voltage AGC2_Vref, AGC3_Vref can be configured to have a fixed preset value (hereinafter referred to as the second threshold voltage and the third threshold voltage, respectively). Through this configuration, the present invention can adjust the gain control mode according to the actual supply voltage of the amplifier, thereby improving the applicability of the gain control and reducing the power consumption of the circuit. It can be understood that fewer (for example, 2 levels) or more (for example, 4 levels) startup threshold voltages can be determined according to actual needs, that is, the gain control method of this embodiment is not limited to application to the gain control device shown in FIG. 2-3.

步骤420,将所述第一阈值电压与所述固定的至少一级阈值电压进行比较,根据比较结果确定增益控制的模式信号。Step 420: compare the first threshold voltage with the fixed at least one level threshold voltage, and determine a gain control mode signal according to the comparison result.

例如,由于第一阈值电压AGC1_Vref与放大器的供给电压相关,因此其实际值可能大于阈值电压AGC2_Vref、AGC3_Vref,也可能小于阈值电压AGC2_Vref、AGC3_Vref。在一实施例中,可以将第一阈值电压AGC1_Vref和固定的第二阈值电压AGC2_Vref、第三阈值电压AGC3_Vref进行比较,并根据比较结果确定增益控制的模式信号,例如,在AGC1_Vref大于AGC2_Vref、AGC3_Vref时,可确定为第一模式MODE1(默认模式),例如模式信号生成电路生成第一模式信号MODE1_FLAG,在AGC1_Vref介于AGC2_Vref、AGC3_Vref之间时,可确定为第二模式MODE2并生成第二模 式信号MODE2_FLAG,在AGC1_Vref小于AGC2_Vref、AGC3_Vref时,可确定第三模式MODE3并生成第三模式信号MODE3_FLAG。For example, since the first threshold voltage AGC1_Vref is related to the supply voltage of the amplifier, its actual value may be greater than the threshold voltages AGC2_Vref and AGC3_Vref, or may be less than the threshold voltages AGC2_Vref and AGC3_Vref. In one embodiment, the first threshold voltage AGC1_Vref may be compared with the fixed second threshold voltage AGC2_Vref and the third threshold voltage AGC3_Vref, and the mode signal of the gain control may be determined according to the comparison result. For example, when AGC1_Vref is greater than AGC2_Vref and AGC3_Vref, it may be determined as the first mode MODE1 (default mode), for example, the mode signal generating circuit generates the first mode signal MODE1_FLAG, and when AGC1_Vref is between AGC2_Vref and AGC3_Vref, it may be determined as the second mode MODE2 and generate the second mode signal MODE1_FLAG. The third mode signal MODE2_FLAG can be generated. When AGC1_Vref is less than AGC2_Vref and AGC3_Vref, the third mode MODE3 can be determined and the third mode signal MODE3_FLAG can be generated.

在一示例中,确定的模式信号可与将所述多个阈值电压分别与所述检测电压进行比较的预设顺序相关联,根据模式信号可以确定放大器的检测电压与各个阈值电压之间进行比较的比较顺序,在此基础上,增益控制方法可以进行下一步骤。In one example, the determined mode signal may be associated with a preset order of comparing the multiple threshold voltages with the detection voltage respectively. According to the mode signal, the comparison order between the detection voltage of the amplifier and the respective threshold voltages may be determined, and on this basis, the gain control method may proceed to the next step.

步骤430,将放大器的检测电压与所述多个阈值电压按预设顺序分别进行比较,并根据比较结果输出控制信号。Step 430 , comparing the detection voltage of the amplifier with the plurality of threshold voltages in a preset order, and outputting a control signal according to the comparison result.

在一实施例中,输入的音频信号通过放大器处理后,作为检测电压信号AGC_IN输出。结合图2-3,确定的模式信号同时决定了切换开关的切换顺序,由此根据检测电压AGC_IN的大小可生成开关切换信号,以控制切换开关将各级阈值电压按照预设顺序连接到电压检测电路,由此,可将检测电压与各级阈值电压AGC3_Vref、AGC2_Vref、AGC1_Vref进行比较,并根据比较结果输出相应的控制信号AGC3_FLAG、AGC2_FLAG、AGC1_FLAG,从而使增益控制信号的生成时序适应于不同的控制模式,达到控制放大器增益的效果。In one embodiment, the input audio signal is processed by the amplifier and output as a detection voltage signal AGC_IN. In conjunction with Figures 2-3, the determined mode signal also determines the switching order of the switch, so that a switch switching signal can be generated according to the size of the detection voltage AGC_IN to control the switch to connect the threshold voltages of each level to the voltage detection circuit in a preset order, thereby comparing the detection voltage with the threshold voltages of each level AGC3_Vref, AGC2_Vref, and AGC1_Vref, and outputting corresponding control signals AGC3_FLAG, AGC2_FLAG, and AGC1_FLAG according to the comparison results, so that the generation timing of the gain control signal is adapted to different control modes, thereby achieving the effect of controlling the gain of the amplifier.

例如,在检测电压大于可调节的阈值电压AGC1_Vref时,电压检测电路可输出降低增益控制信号AGC1_FLAG,在检测电压大于固定阈值电压AGC2_Vref、AGC3_Vref时分别输出相应的降低增益控制信号AGC2_FLAG、AGC3_FLAG。其中,AGC1_FLAG、AGC2_FLAG、AGC3_FLAG可配置为具有不同的优先级,例如AGC1_FLAG的优先级高于AGC2_FLAG、AGC3_FLAG的优先级,即AGC1_FLAG在所有的控制信号中的优先级最高,一旦其被触发,则AGC2_FLAG、AGC3_FLAG均无效,并且相应的计时清零,这样可以防止不同的降低增益控制信号之间出现逻辑冲突。For example, when the detection voltage is greater than the adjustable threshold voltage AGC1_Vref, the voltage detection circuit can output the gain reduction control signal AGC1_FLAG, and when the detection voltage is greater than the fixed threshold voltages AGC2_Vref and AGC3_Vref, the corresponding gain reduction control signals AGC2_FLAG and AGC3_FLAG are output respectively. Among them, AGC1_FLAG, AGC2_FLAG, and AGC3_FLAG can be configured to have different priorities, for example, the priority of AGC1_FLAG is higher than the priority of AGC2_FLAG and AGC3_FLAG, that is, AGC1_FLAG has the highest priority among all control signals. Once it is triggered, AGC2_FLAG and AGC3_FLAG are invalid, and the corresponding timing is cleared, so that logical conflicts between different gain reduction control signals can be prevented.

在一实施例中,AGC1_FLAG和AGC2_FLAG/AGC3_FLAG可分别与不同的降低增益启动时间相关联,AGC2_FLAG和AGC3_FLAG也分别与不同的降低增益启动时间相关联。例如,与AGC1_FLAG相关联的降低增益启动时间可小于与AGC2_FLAG和AGC3_FLAG相关联的降低增益启动时间,从而可在检测电压较大时快速降低增益以防止放大器发生截顶失真,而在检测电压较小时减慢降低增益速度来稳步提升输出音量。In one embodiment, AGC1_FLAG and AGC2_FLAG/AGC3_FLAG may be associated with different gain reduction start times, respectively, and AGC2_FLAG and AGC3_FLAG may also be associated with different gain reduction start times, respectively. For example, the gain reduction start time associated with AGC1_FLAG may be less than the gain reduction start time associated with AGC2_FLAG and AGC3_FLAG, so that the gain can be quickly reduced when the detection voltage is large to prevent the amplifier from truncated distortion, and the gain reduction speed can be slowed down when the detection voltage is small to steadily increase the output volume.

在一实施例中,通过将放大器的检测电压AGC_IN与其他阈值电压进行 比较,可以确定其他增益控制信号。例如,可将检测电压AGC_IN与一固定释放阈值电压RLS_Vref进行比较,并且响应于在放大器的检测电压小于该阈值电压RLS_Vref时输出提高增益控制信号RLS_FLAG。例如,可将检测电压AGC_IN与一预设的共模电平进行比较,并在检测电压等于共模电平时输出过零信号ZeroCross_FLAG。参考图3,该过零信号ZeroCross_FLAG可用于生成清零信号CLR_FLAG,该清零信号则可用于对部分降低增益控制信号(AGC2_FLAG、AGC3_FLAG)进行清零,在一实施例中,可以利用该过零信号ZeroCross_FLAG与降低增益控制信号AGC2_FLAG、AGC3_FLAG来确定增益信号以更平稳地控制放大器的增益。此外,该过零信号ZeroCross_FLAG还可用于与提高增益控制信号RLS_FLAG来确定增益信号以控制放大器的增益。In one embodiment, the detection voltage AGC_IN of the amplifier is compared with other threshold voltages. By comparison, other gain control signals can be determined. For example, the detection voltage AGC_IN can be compared with a fixed release threshold voltage RLS_Vref, and in response to the detection voltage of the amplifier being less than the threshold voltage RLS_Vref, the gain control signal RLS_FLAG is output to increase. For example, the detection voltage AGC_IN can be compared with a preset common mode level, and the zero-crossing signal ZeroCross_FLAG is output when the detection voltage is equal to the common mode level. Referring to FIG. 3 , the zero-crossing signal ZeroCross_FLAG can be used to generate a clearing signal CLR_FLAG, which can be used to clear part of the gain reduction control signal (AGC2_FLAG, AGC3_FLAG). In one embodiment, the zero-crossing signal ZeroCross_FLAG and the gain reduction control signals AGC2_FLAG and AGC3_FLAG can be used to determine the gain signal to more smoothly control the gain of the amplifier. In addition, the zero-crossing signal ZeroCross_FLAG can also be used to determine the gain signal with the gain control signal RLS_FLAG to increase the gain to control the gain of the amplifier.

在一实施例中,各个控制信号AGC1_FLAG、AGC2_FLAG、AGC3_FLAG、RLS_FLAG可配置为具有不同的优先级,例如,AGC1_FLAG在所有的控制信号中的优先级最高,一旦其被触发,则其余所有的正在计时的控制信号均无效,并且相应的启动时间计时清零。这样可以使得在例如监测到放大器的输出电压大于AGC1_Vref时,快速降低放大器的增益以避免出现截顶失真。In one embodiment, each control signal AGC1_FLAG, AGC2_FLAG, AGC3_FLAG, and RLS_FLAG can be configured to have different priorities. For example, AGC1_FLAG has the highest priority among all control signals. Once it is triggered, all other control signals being timed are invalid, and the corresponding start time timing is reset. In this way, when, for example, the output voltage of the amplifier is detected to be greater than AGC1_Vref, the gain of the amplifier can be quickly reduced to avoid truncation distortion.

虽然未示出,本实施例的增益控制方法还可包括增益信号的确定步骤,根据所述控制信号确定增益信号来控制放大器的增益。Although not shown, the gain control method of this embodiment may further include a step of determining a gain signal, wherein the gain signal is determined according to the control signal to control the gain of the amplifier.

在一实施例中,参考图2,增益控制电路130在接收到控制信号AGC1_FLAG、AGC2_FLAG、AGC3_FLAG、RLS_FLAG、ZeroCross_FLAG中的一个或多个后可根据预先设置的增益变化逻辑来确定增益信号以控制放大器的增益。In one embodiment, referring to FIG. 2 , after receiving one or more of the control signals AGC1_FLAG, AGC2_FLAG, AGC3_FLAG, RLS_FLAG, and ZeroCross_FLAG, the gain control circuit 130 may determine a gain signal according to a preset gain change logic to control the gain of the amplifier.

例如,在收到提高增益控制信号RLS_FLAG后,增益控制电路130如果判断该信号预定时间(例如10ms)内持续为高电平,则可确定提高增益,例如,增加增益0.5dB,并在等待下一个过零信号ZeroCross_FLAG或者预定时间(例如20ms)后再增加增益。For example, after receiving the gain increase control signal RLS_FLAG, if the gain control circuit 130 determines that the signal continues to be at a high level within a predetermined time (e.g., 10ms), it can determine to increase the gain, for example, increase the gain by 0.5dB, and increase the gain after waiting for the next zero crossing signal ZeroCross_FLAG or a predetermined time (e.g., 20ms).

针对不同的降低增益控制信号,也可设置相应不同的增益变化逻辑。例如,在收到降低增益控制信号AGC3_FLAG后,增益控制电路130如果判断该信号触发后计时第一启动时间(例如10ms),并在过零信号触发时确定降低增益0.5dB。在收到降低增益控制信号AGC2_FLAG后,增益控制电路130如果判断该信号触发后计时第二启动时间,该第二启动时间(例如1ms)可 小于与AGC3_FLAG相关联的第一启动时间,并在过零信号触发后确定降低增益0.5dB。而在收到降低增益控制信号AGC1_FLAG后,增益控制电路130如果判断该信号触发后计时第三启动时间,该第三启动时间可小于第二启动时间甚至可以为0,即在该信号触发后直接降低增益。在一示例中,如前面所述,AGC1_FLAG优先级可被配置为最高,若其被触发后,则增益控制电路130可确定其余所有正在计时的控制信号RLS_FLAG、AGC3_FLAG、AGC2_FLAG均为无效,并针对这些控制信号清零重新计时。Different gain change logics may also be set for different gain reduction control signals. For example, after receiving the gain reduction control signal AGC3_FLAG, if the gain control circuit 130 determines that the signal is triggered, it will time the first start time (e.g., 10ms), and when the zero crossing signal is triggered, it determines to reduce the gain by 0.5dB. After receiving the gain reduction control signal AGC2_FLAG, if the gain control circuit 130 determines that the signal is triggered, it will time the second start time, and the second start time (e.g., 1ms) may be is less than the first start-up time associated with AGC3_FLAG, and determines to reduce the gain by 0.5dB after the zero-crossing signal is triggered. After receiving the gain reduction control signal AGC1_FLAG, if the gain control circuit 130 determines that the third start-up time is timed after the signal is triggered, the third start-up time may be less than the second start-up time or even 0, that is, the gain is directly reduced after the signal is triggered. In one example, as described above, the priority of AGC1_FLAG can be configured to be the highest. If it is triggered, the gain control circuit 130 can determine that all other control signals RLS_FLAG, AGC3_FLAG, and AGC2_FLAG being timed are invalid, and reset these control signals to zero and re-time.

如前描述,本申请的自动增益控制方法可以先确定增益控制的模式信号,然后再依据不同的控制模式来对放大器进行增益控制。图6是根据本发明一实施例的依据增益控制模式来进行增益控制的方法流程图,如图6所示,增益控制方法可包括如下步骤:As described above, the automatic gain control method of the present application can first determine the mode signal of the gain control, and then perform gain control on the amplifier according to different control modes. FIG6 is a flow chart of a method for performing gain control according to a gain control mode according to an embodiment of the present invention. As shown in FIG6, the gain control method may include the following steps:

步骤510中,接收放大器的检测电压信号。In step 510, a detection voltage signal of an amplifier is received.

参考图1-2,输入的音频信号通过放大器处理后,作为检测电压信号AGC_IN输出,该输出信号可连接到电压检测电路110和切换信号生成电路140。切换信号生成电路140可根据AGC_IN的变化值生成开关切换信号以控制切换开关120将相应的阈值电压耦接至电压检测电路110,该电压检测电路110可根据AGC_IN与各阈值电压的比较来生成控制信号。1-2, the input audio signal is processed by the amplifier and output as a detection voltage signal AGC_IN, and the output signal can be connected to the voltage detection circuit 110 and the switching signal generation circuit 140. The switching signal generation circuit 140 can generate a switch switching signal according to the change value of AGC_IN to control the switch 120 to couple the corresponding threshold voltage to the voltage detection circuit 110, and the voltage detection circuit 110 can generate a control signal according to the comparison between AGC_IN and each threshold voltage.

步骤520中,将与提高增益控制信号相关联的阈值电压耦接到电压检测电路。In step 520, a threshold voltage associated with the increased gain control signal is coupled to a voltage detection circuit.

参考图2-3,切换开关120的初始状态可配置为S4闭合,其余掷断开,从而将阈值电压RLS_Vref耦接到电压检测电路110。替代地,在检测到过零信号后切换信号生成电路可控制切换开关120将阈值电压RLS_Vref耦接到电压检测电路120。2-3 , the initial state of the switch 120 can be configured as S4 closed and the rest open, thereby coupling the threshold voltage RLS_Vref to the voltage detection circuit 110. Alternatively, after detecting the zero-crossing signal, the switch signal generation circuit can control the switch 120 to couple the threshold voltage RLS_Vref to the voltage detection circuit 120.

步骤530、540中,对各阈值电压进行比较,并根据比较结果确定增益控制的模式信号。In steps 530 and 540, the threshold voltages are compared, and a mode signal for gain control is determined according to the comparison result.

如前描述,第一阈值电压AGC1_Vref可与放大器的供给电压相关联,其实际值可能大于固定的第二阈值电压AGC2_Vref、第三阈值电压AGC3_Vref,也可能小于阈值电压AGC2_Vref、AGC3_Vref。在一示例中,假设AGC2_Vref大于AGC3_Vref,参照图4,模式信号生成电路可先将实际确定的AGC1_Vref与AGC2_Vref进行比较(步骤530),如果AGC1_Vref大于AGC2_Vref,可以确定控制模式MODE1(默认控制模式),相应输出 模式信号MODE1_FLAG,如果AGC1_Vref小于AGC2_Vref,则继续将AGC1_Vref与AGC3_Vref进行比较(步骤540),如果AGC1_Vref大于AGC3_Vref,可以确定控制模式MODE2并输出MODE2_FLAG,否则可以确定控制模式MODE3并输出MODE3_FLAG。As described above, the first threshold voltage AGC1_Vref may be associated with the supply voltage of the amplifier, and its actual value may be greater than the fixed second threshold voltage AGC2_Vref and the third threshold voltage AGC3_Vref, or may be less than the threshold voltages AGC2_Vref and AGC3_Vref. In an example, assuming that AGC2_Vref is greater than AGC3_Vref, referring to FIG. 4, the mode signal generating circuit may first compare the actually determined AGC1_Vref with AGC2_Vref (step 530). If AGC1_Vref is greater than AGC2_Vref, the control mode MODE1 (default control mode) may be determined, and the corresponding output Mode signal MODE1_FLAG, if AGC1_Vref is less than AGC2_Vref, then AGC1_Vref is compared with AGC3_Vref (step 540), if AGC1_Vref is greater than AGC3_Vref, control mode MODE2 can be determined and MODE2_FLAG can be output, otherwise control mode MODE3 can be determined and MODE3_FLAG can be output.

在确定增益控制模式后,增益控制装置可以相应地调整增益控制方法来对放大器进行增益控制,例如确定切换开关的切换顺序使得各阈值电压能按预设顺序(例如,升序)的方式与检测电压进行比较,从而可以根据放大器的供给电压灵活地对其进行控制以实现放大器的输出电压的平稳提升、并有效防止截顶失真,同时还可降低功耗。以下结合图7-9对各控制模式下增益控制装置的工作原理做进一步示例性的描述。After determining the gain control mode, the gain control device can adjust the gain control method accordingly to perform gain control on the amplifier, for example, determining the switching order of the switch so that each threshold voltage can be compared with the detection voltage in a preset order (for example, ascending order), so that the amplifier can be flexibly controlled according to its supply voltage to achieve a smooth increase in the output voltage of the amplifier and effectively prevent truncation distortion, while also reducing power consumption. The following further describes the working principle of the gain control device under each control mode in conjunction with FIGS. 7-9.

图7示出了在控制模式MODE1下的增益控制信号效果图。如图所示,假设放大器的检测电压AGC_IN为正弦波,当AGC_IN等于共模电压VCM时,电压检测电路可输出过零信号ZeroCross_FLAG(未示出),在AGC_IN介于RLS_VH和RLS_VL之间时(非共模电压),电压检测电路可输出高电平的RLS_FLAG信号,在接收到该控制信号后,增益控制电路130可根据预先设置的增益变化逻辑确定增益信号并输出至放大器,例如,如果判断RLS_FLAG信号预定时间(例如10ms)内持续为高电平,则可输出一个增加增益(例如,0.5dB)的增益信号并输出至放大器。Fig. 7 shows a gain control signal effect diagram under control mode MODE1. As shown in the figure, assuming that the detection voltage AGC_IN of the amplifier is a sine wave, when AGC_IN is equal to the common mode voltage VCM, the voltage detection circuit can output a zero-crossing signal ZeroCross_FLAG (not shown), and when AGC_IN is between RLS_VH and RLS_VL (non-common mode voltage), the voltage detection circuit can output a high-level RLS_FLAG signal. After receiving the control signal, the gain control circuit 130 can determine the gain signal according to the preset gain change logic and output it to the amplifier. For example, if it is determined that the RLS_FLAG signal is continuously at a high level within a predetermined time (e.g., 10ms), a gain signal with increased gain (e.g., 0.5dB) can be output and output to the amplifier.

参考图2-3,在AGC_IN超过RLS_VH或低于RLS_VL时,RLS_FLAG将转为低电平,同时,切换信号生成电路140可控制切换开关120将阈值电压AGC3_Vref(包括一对AGC3_VH和AGC3_VL)耦接到电压检测电路110。2-3 , when AGC_IN exceeds RLS_VH or is lower than RLS_VL, RLS_FLAG will turn to a low level, and at the same time, the switching signal generating circuit 140 can control the switching switch 120 to couple the threshold voltage AGC3_Vref (including a pair of AGC3_VH and AGC3_VL) to the voltage detecting circuit 110 .

电压检测电路110可将AGC_IN与AGC3_VH和AGC3_VL进行比较,若其小于AGC3_VH或大于AGC3_VL,则所有控制信号均为低电平,增益控制电路130可在ZeroCross_FLAG触发后输出增加增益的增益信号并输出至放大器。若AGC_IN超过AGC3_VH或低于AGC3_VL,则触发器220收到正脉冲,输出高电平的AGC3_FLAG信号。同时,切换信号生成电路140可控制切换开关120将阈值电压AGC2_Vref(包括一对AGC2_VH和AGC2_VL)耦接到电压检测电路110。在一实施例中,增益控制电路130在接收到AGC3_FLAG信号后进行计时,如果该信号计时达到预定时间(例如10ms),可在过零信号触发时输出一个降低增益(例如,0.5dB)的增益信号并输出至放大器。 The voltage detection circuit 110 can compare AGC_IN with AGC3_VH and AGC3_VL. If it is less than AGC3_VH or greater than AGC3_VL, all control signals are low level, and the gain control circuit 130 can output a gain signal with increased gain after ZeroCross_FLAG is triggered and output it to the amplifier. If AGC_IN exceeds AGC3_VH or is lower than AGC3_VL, the trigger 220 receives a positive pulse and outputs a high-level AGC3_FLAG signal. At the same time, the switching signal generation circuit 140 can control the switching switch 120 to couple the threshold voltage AGC2_Vref (including a pair of AGC2_VH and AGC2_VL) to the voltage detection circuit 110. In one embodiment, the gain control circuit 130 performs timing after receiving the AGC3_FLAG signal. If the signal timing reaches a predetermined time (e.g., 10ms), a gain signal with reduced gain (e.g., 0.5dB) can be output and output to the amplifier when the zero-crossing signal is triggered.

在切换开关120切换后,电压检测电路110可将AGC_IN与AGC2_VH和AGC2_VL进行比较,若其小于AGC2_VH或大于AGC2_VL,则仅AGC3_FLAG为高电平,若AGC_IN超过AGC2_VH或低于AGC2_VL,则触发器220、触发器222再次收到正脉冲,由此输出高电平的AGC2_FLAG。同时,切换信号生成电路140可控制切换开关120将阈值电压AGC1_Vref(包括一对AGC1_VH和AGC1_VL)耦接到电压检测电路110。在一实施例中,增益控制电路130在接收到AGC2_FLAG信号后可对AGC1_FLAG的计时清零,并针对AGC2_FLAG信号进行计时,如果该信号计时达到预定时间(例如500μs),可在过零信号触发时输出一个降低增益0.5dB的增益信号并输出至放大器。After the switch 120 is switched, the voltage detection circuit 110 can compare AGC_IN with AGC2_VH and AGC2_VL. If it is less than AGC2_VH or greater than AGC2_VL, only AGC3_FLAG is at a high level. If AGC_IN exceeds AGC2_VH or is lower than AGC2_VL, the trigger 220 and the trigger 222 receive a positive pulse again, thereby outputting a high-level AGC2_FLAG. At the same time, the switching signal generation circuit 140 can control the switch 120 to couple the threshold voltage AGC1_Vref (including a pair of AGC1_VH and AGC1_VL) to the voltage detection circuit 110. In one embodiment, the gain control circuit 130 can clear the timing of AGC1_FLAG after receiving the AGC2_FLAG signal, and time the AGC2_FLAG signal. If the signal timing reaches a predetermined time (e.g., 500μs), a gain signal with a gain reduction of 0.5dB can be output when the zero-crossing signal is triggered and output to the amplifier.

在切换开关120切换后,电压检测电路110可将AGC_IN与AGC1_VH和AGC1_VL进行比较,若其小于AGC1_VH或大于AGC1_VL,则仅AGC2_FLAG、AGC3_FLAG为高电平,若AGC_IN超过AGC1_VH或低于AGC1_VL,则与门224的两个输入端都接收高电平信号,由此输出高电平的AGC1_FLAG。在一实施例中,响应于收到AGC1_FLAG信号,增益控制电路130可立即生成降低增益0.5dB的增益信号以直接控制放大器进行降低增益以防止发生截顶失真,同时由于AGC1_FLAG的优先级最高,其余控制信号AGC2_FLAG、AGC3_FLAG均无效,其相应的计时被清零。此外,响应于第二次收到AGC1_FLAG信号,增益控制电路130可进行计时,如果该信号计时达到预定时间(例如50μs),可再输出一个降低增益0.5dB的增益信号并输出至放大器,以提高放大器输出电压的平稳性。After the switch 120 is switched, the voltage detection circuit 110 can compare AGC_IN with AGC1_VH and AGC1_VL. If it is less than AGC1_VH or greater than AGC1_VL, only AGC2_FLAG and AGC3_FLAG are high level. If AGC_IN exceeds AGC1_VH or is lower than AGC1_VL, both input terminals of the AND gate 224 receive high level signals, thereby outputting high level AGC1_FLAG. In one embodiment, in response to receiving the AGC1_FLAG signal, the gain control circuit 130 can immediately generate a gain signal that reduces the gain by 0.5dB to directly control the amplifier to reduce the gain to prevent truncation distortion. At the same time, since AGC1_FLAG has the highest priority, the remaining control signals AGC2_FLAG and AGC3_FLAG are invalid, and their corresponding timings are cleared. In addition, in response to receiving the AGC1_FLAG signal for the second time, the gain control circuit 130 may perform timing. If the signal timing reaches a predetermined time (eg, 50 μs), a gain signal with a gain reduced by 0.5 dB may be output to the amplifier to improve the stability of the amplifier output voltage.

在一实施例中,切换开关120可保持将阈值电压AGC1_Vref耦接到电压检测电路110,在检测电压AGC_IN低于AGC1_VH或高于AGC1_VL时,AGC1_FLAG将转为低电平,AGC2_FLAG、AGC3_FLAG也将在AGC_IN发生过零时跳转为低电平。In one embodiment, the switch 120 can keep coupling the threshold voltage AGC1_Vref to the voltage detection circuit 110. When the detection voltage AGC_IN is lower than AGC1_VH or higher than AGC1_VL, AGC1_FLAG will turn to a low level, and AGC2_FLAG and AGC3_FLAG will also jump to a low level when AGC_IN crosses zero.

图8示出了在控制模式MODE2下的增益控制信号效果图。如图8所示,该模式下,AGC1_Vref介于AGC2_Vref和AGC3_Vref之间。与图7相似,在AGC_IN介于RLS_VH和RLS_VL之间时,电压检测电路可输出高电平的RLS_FLAG信号。增益控制电路130在判断RLS_FLAG信号预定时间(例如10ms)内持续为高电平时,输出一个增加增益0.5dB的增益信号并输出至放大器。 FIG8 shows a gain control signal effect diagram under control mode MODE2. As shown in FIG8, in this mode, AGC1_Vref is between AGC2_Vref and AGC3_Vref. Similar to FIG7, when AGC_IN is between RLS_VH and RLS_VL, the voltage detection circuit can output a high-level RLS_FLAG signal. When the gain control circuit 130 determines that the RLS_FLAG signal is continuously at a high level within a predetermined time (e.g., 10ms), it outputs a gain signal with a gain increase of 0.5dB and outputs it to the amplifier.

在AGC_IN超过RLS_VH或低于RLS_VL时,RLS_FLAG将转为低电平,同时,切换信号生成电路140可控制切换开关120将阈值电压AGC3_Vref耦接到电压检测电路110。When AGC_IN exceeds RLS_VH or is lower than RLS_VL, RLS_FLAG will turn to a low level. Meanwhile, the switching signal generating circuit 140 can control the switching switch 120 to couple the threshold voltage AGC3_Vref to the voltage detecting circuit 110 .

电压检测电路110可将AGC_IN与AGC3_VH和AGC3_VL进行比较,若其小于AGC3_VH或大于AGC3_VL,则所有控制信号均为低电平,增益控制电路130可在ZeroCross_FLAG触发后输出增加增益的增益信号并输出至放大器。若AGC_IN超过AGC3_VH或低于AGC3_VL,则触发器220收到正脉冲,输出高电平的AGC3_FLAG信号。同时,切换信号生成电路140可控制切换开关120将阈值电压AGC1_Vref耦接到电压检测电路110。在一实施例中,增益控制电路130在接收到AGC3_FLAG信号后进行计时,如果该信号计时达到预定时间(例如10ms),可在过零信号触发时输出一个降低增益(例如,0.5dB)的增益信号并输出至放大器。The voltage detection circuit 110 can compare AGC_IN with AGC3_VH and AGC3_VL. If it is less than AGC3_VH or greater than AGC3_VL, all control signals are low level, and the gain control circuit 130 can output a gain signal with increased gain after ZeroCross_FLAG is triggered and output it to the amplifier. If AGC_IN exceeds AGC3_VH or is lower than AGC3_VL, the trigger 220 receives a positive pulse and outputs a high-level AGC3_FLAG signal. At the same time, the switching signal generation circuit 140 can control the switching switch 120 to couple the threshold voltage AGC1_Vref to the voltage detection circuit 110. In one embodiment, the gain control circuit 130 performs timing after receiving the AGC3_FLAG signal. If the signal timing reaches a predetermined time (e.g., 10ms), a gain signal with reduced gain (e.g., 0.5dB) can be output and output to the amplifier when the zero-crossing signal is triggered.

在切换开关120切换后,电压检测电路110可将AGC_IN与AGC1_VH和AGC1_VL进行比较,若其小于AGC1_VH或大于AGC1_VL,则仅AGC3_FLAG为高电平,若AGC_IN超过AGC1_VH或低于AGC1_VL,则触发器222再次被触发,同时与门224的两个输入端都接收高电平信号,控制信号AGC1_FLAG也转变为高电平。在一实施例中,响应于收到AGC1_FLAG信号,增益控制电路130可立即生成降低增益0.5dB的增益信号以直接控制放大器进行降低增益以防止发生截顶失真,同时由于AGC1_FLAG的优先级最高,其余控制信号AGC2_FLAG、AGC3_FLAG均无效,其相应的计时被清零。此外,响应于第二次收到AGC1_FLAG信号,增益控制电路130可进行计时,如果该信号计时达到预定时间(例如50μs),可再输出一个降低增益0.5dB的增益信号并输出至放大器,以提高放大器输出电压的平稳性。After the switch 120 is switched, the voltage detection circuit 110 can compare AGC_IN with AGC1_VH and AGC1_VL. If it is less than AGC1_VH or greater than AGC1_VL, only AGC3_FLAG is at a high level. If AGC_IN exceeds AGC1_VH or is lower than AGC1_VL, the trigger 222 is triggered again, and both input terminals of the AND gate 224 receive high-level signals, and the control signal AGC1_FLAG is also turned to a high level. In one embodiment, in response to receiving the AGC1_FLAG signal, the gain control circuit 130 can immediately generate a gain signal that reduces the gain by 0.5dB to directly control the amplifier to reduce the gain to prevent truncation distortion. At the same time, since AGC1_FLAG has the highest priority, the remaining control signals AGC2_FLAG and AGC3_FLAG are invalid, and their corresponding timings are cleared. In addition, in response to receiving the AGC1_FLAG signal for the second time, the gain control circuit 130 may perform timing. If the signal timing reaches a predetermined time (eg, 50 μs), a gain signal with a gain reduced by 0.5 dB may be output to the amplifier to improve the stability of the amplifier output voltage.

可以看出,一般而言,在控制模式MODE2下,电压检测电路110只需将检测电压AGC_IN与AGC3_Vref和AGC1_Vref进行比较来生成控制信号,从而可以保证放大器在低的供给电压下仍能对放大器的输出电压进行平稳提升,并有效防止截顶失真的发生,同时还可降低电路功耗。It can be seen that, generally speaking, under the control mode MODE2, the voltage detection circuit 110 only needs to compare the detection voltage AGC_IN with AGC3_Vref and AGC1_Vref to generate a control signal, thereby ensuring that the amplifier can still smoothly increase the output voltage of the amplifier under a low supply voltage, and effectively prevent the occurrence of truncation distortion, while also reducing circuit power consumption.

图9示出了在控制模式MODE3下的增益控制信号效果图。如图9所示,该模式下,AGC1_Vref小于AGC2_Vref和AGC3_Vref。与图7-8相似,在AGC_IN介于RLS_VH和RLS_VL之间时,电压检测电路可输出高电平的 RLS_FLAG信号。增益控制电路130在判断RLS_FLAG信号预定时间(例如10ms)内持续为高电平时,输出一个增加增益0.5dB的增益信号并输出至放大器。Figure 9 shows the gain control signal effect diagram under control mode MODE3. As shown in Figure 9, in this mode, AGC1_Vref is less than AGC2_Vref and AGC3_Vref. Similar to Figure 7-8, when AGC_IN is between RLS_VH and RLS_VL, the voltage detection circuit can output a high level. When the gain control circuit 130 determines that the RLS_FLAG signal is continuously at a high level for a predetermined time (eg, 10 ms), it outputs a gain signal with a gain increase of 0.5 dB to the amplifier.

在AGC_IN超过RLS_VH或低于RLS_VL时,RLS_FLAG将转为低电平,同时,切换信号生成电路140可控制切换开关120将阈值电压AGC1_Vref耦接到电压检测电路110。When AGC_IN exceeds RLS_VH or is lower than RLS_VL, RLS_FLAG will turn to a low level. Meanwhile, the switching signal generating circuit 140 can control the switching switch 120 to couple the threshold voltage AGC1_Vref to the voltage detecting circuit 110 .

在切换开关120切换后,电压检测电路110可将AGC_IN与AGC1_VH和AGC1_VL进行比较,若其小于AGC1_VH或大于AGC1_VL,则所有控制信号均为低电平,增益控制电路130可在ZeroCross_FLAG触发后输出增加增益的增益信号并输出至放大器。若AGC_IN超过AGC1_VH或低于AGC1_VL,则触发器220收到正脉冲,输出高电平的AGC3_FLAG信号。同时,与门224的两个输入端都接收高电平信号,控制信号AGC1_FLAG也转变为高电平。在一实施例中,如前面描述,响应于收到AGC1_FLAG信号,增益控制电路130可立即生成增益信号以直接控制放大器进行降低增益以防止发生截顶失真,同时由于AGC1_FLAG的优先级最高,控制信号AGC3_FLAG无效,其并不开始相应的计时。此外,响应于第二次收到AGC1_FLAG信号,增益控制电路130可进行计时,如果该信号计时达到预定时间(例如50μs),可再输出一个降低增益0.5dB的增益信号并输出至放大器,以提高放大器输出电压的平稳性。After the switch 120 is switched, the voltage detection circuit 110 can compare AGC_IN with AGC1_VH and AGC1_VL. If it is less than AGC1_VH or greater than AGC1_VL, all control signals are low level, and the gain control circuit 130 can output a gain signal with increased gain after ZeroCross_FLAG is triggered and output it to the amplifier. If AGC_IN exceeds AGC1_VH or is lower than AGC1_VL, the trigger 220 receives a positive pulse and outputs a high level AGC3_FLAG signal. At the same time, both input ends of the AND gate 224 receive high level signals, and the control signal AGC1_FLAG is also converted to a high level. In one embodiment, as described above, in response to receiving the AGC1_FLAG signal, the gain control circuit 130 can immediately generate a gain signal to directly control the amplifier to reduce the gain to prevent truncation distortion. At the same time, since AGC1_FLAG has the highest priority, the control signal AGC3_FLAG is invalid and does not start the corresponding timing. In addition, in response to receiving the AGC1_FLAG signal for the second time, the gain control circuit 130 may perform timing. If the signal timing reaches a predetermined time (eg, 50 μs), a gain signal with a gain reduced by 0.5 dB may be output to the amplifier to improve the stability of the amplifier output voltage.

可以看出,一般而言,在控制模式MODE3下,电压检测电路110只需将检测电压AGC_IN与AGC1_Vref进行比较,因此可以保证放大器在低的供给电压下仍能对放大器的输出电压进行平稳提升,并有效防止截顶失真的发生,同时还可降低电路功耗。It can be seen that, generally speaking, under the control mode MODE3, the voltage detection circuit 110 only needs to compare the detection voltage AGC_IN with AGC1_Vref, thereby ensuring that the amplifier can still smoothly increase the output voltage of the amplifier under a low supply voltage, effectively preventing the occurrence of truncation distortion, and reducing circuit power consumption.

本发明还提供了一种音频设备,该电子设备可以为包括功率放大器的播放设备,例如扬声器,其包括以上所述的增益控制装置,增益控制装置可以与扬声器耦接,从而可根据如上描述的增益控制方法对放大器的增益进行控制。The present invention also provides an audio device, which electronic device can be a playback device including a power amplifier, such as a speaker, which includes the gain control device described above, and the gain control device can be coupled to the speaker so that the gain of the amplifier can be controlled according to the gain control method described above.

以上结合具体实施例描述了本申请的基本原理,但是,需要指出的是,在本申请中提及的优点、优势、效果等仅是示例而非限制,不能认为这些优点、优势、效果等是本申请的各个实施例必须具备的。另外,上述公开的具体细节仅是为了示例的作用和便于理解的作用,而非限制,上述细节并不限 制本申请为必须采用上述具体的细节来实现。The basic principles of the present application are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present application are only examples and not limitations. It cannot be considered that these advantages, strengths, effects, etc. must be possessed by each embodiment of the present application. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limiting. The above details are not limiting. The above specific details are necessary to implement this application.

本申请中涉及的器件、装置、设备、系统的方框图仅作为例示性的例子并且不意图要求或暗示必须按照方框图示出的方式进行连接、布置、配置。如本领域技术人员将认识到的,可以按任意方式连接、布置、配置这些器件、装置、设备、系统。诸如“包括”、“包含”、“具有”等等的词语是开放性词汇,指“包括但不限于”,且可与其互换使用。如本文中通常使用的,词语“耦接”是指两个或更多个元件可直接连接或通过一个或多个中间元件连接。同样地,如本文中通常使用的,词语“连接”是指两个或多个元件可直接连接或通过一个或多个中间元件连接。这里所使用的词汇“或”和“和”指词汇“和/或”,且可与其互换使用,除非上下文明确指示不是如此。这里所使用的词汇“诸如”指词组“诸如但不限于”,且可与其互换使用。The block diagrams of the devices, devices, equipment, and systems involved in this application are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagram. As will be appreciated by those skilled in the art, these devices, devices, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, referring to "including but not limited to", and can be used interchangeably with them. As commonly used herein, the word "coupled" refers to two or more elements that can be directly connected or connected through one or more intermediate elements. Similarly, as commonly used herein, the word "connected" refers to two or more elements that can be directly connected or connected through one or more intermediate elements. The words "or" and "and" used here refer to the words "and/or", and can be used interchangeably with them, unless the context clearly indicates otherwise. The words "such as" used here refer to the phrase "such as but not limited to", and can be used interchangeably with them.

还需要指出的是,在本申请的装置、设备和方法中,各部件或各步骤是可以分解和/或重新组合的。这些分解和/或重新组合应视为本申请的等效方案。It should also be noted that in the apparatus, device and method of the present application, each component or each step can be decomposed and/or recombined. Such decomposition and/or recombination should be regarded as equivalent solutions of the present application.

为了例示和描述的目的已经给出了以上描述。此外,此描述不意图将本申请的实施例限制到在此公开的形式。尽管以上已经讨论了多个示例方面和实施例,但是本领域技术人员将认识到其某些变型、修改、改变、添加和子组合。 The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present application to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.

Claims (20)

一种增益控制装置,包括:A gain control device, comprising: 电压检测电路,配置为接收放大器的检测电压并将所述检测电压按预设顺序与多个阈值电压分别进行比较,并且根据比较结果输出控制信号;A voltage detection circuit is configured to receive a detection voltage of the amplifier and compare the detection voltage with a plurality of threshold voltages in a preset order, and output a control signal according to the comparison result; 切换开关,按所述预设顺序将所述多个阈值电压分别耦接到所述电压检测电路以与所述检测电压进行比较;以及A switching switch is used to couple the plurality of threshold voltages to the voltage detection circuit in the preset order to compare with the detection voltage; and 增益控制电路,配置为基于所述电压检测电路输出的控制信号输出增益信号至所述放大器。The gain control circuit is configured to output a gain signal to the amplifier based on a control signal output by the voltage detection circuit. 根据权利要求1所述的增益控制装置,还包括:模式信号生成电路,其配置为基于所述多个阈值电压之间的大小关系生成模式信号,所述模式信号与将所述多个阈值电压分别与所述检测电压进行比较的所述预设顺序相关联。The gain control device according to claim 1 further includes: a mode signal generating circuit, which is configured to generate a mode signal based on the magnitude relationship between the multiple threshold voltages, and the mode signal is associated with the preset order of comparing the multiple threshold voltages with the detection voltage respectively. 根据权利要求2所述的增益控制装置,其中,所述多个阈值电压包括第一阈值电压和固定的至少一级阈值电压,所述第一阈值电压大小与放大器的供给电压大小相关联,并且,所述模式信号基于所述第一阈值电压与所述固定的至少一级阈值电压进行比较的比较结果而确定。The gain control device according to claim 2, wherein the multiple threshold voltages include a first threshold voltage and at least one fixed threshold voltage, the first threshold voltage is associated with the supply voltage of the amplifier, and the mode signal is determined based on a comparison result of the first threshold voltage and the at least one fixed threshold voltage. 根据权利要求1所述的增益控制装置,其中,所述电压检测电路包括:The gain control device according to claim 1, wherein the voltage detection circuit comprises: 多个比较器,每个比较器的一个输入端耦接到所述放大器的检测电压,另一个输入端耦接到所述多个阈值电压中的一个阈值电压。A plurality of comparators are provided, wherein one input terminal of each comparator is coupled to the detection voltage of the amplifier, and the other input terminal of each comparator is coupled to one of the plurality of threshold voltages. 根据权利要求4所述的增益控制装置,其中,所述控制信号包括提高增益控制信号、降低增益控制信号和过零信号。The gain control device according to claim 4, wherein the control signal comprises a gain increase control signal, a gain decrease control signal and a zero-crossing signal. 根据权利要求5所述的增益控制装置,其中,所述多个比较器包括第一比较器,所述第一比较器的正向输入端与所述放大器的检测电压耦接,反向输入端与共模电平耦接,并且,所述过零信号基于所述第一比较器的输出而确定。 The gain control device according to claim 5, wherein the plurality of comparators include a first comparator, a positive input terminal of the first comparator is coupled to the detection voltage of the amplifier, a negative input terminal of the first comparator is coupled to a common mode level, and the zero-crossing signal is determined based on an output of the first comparator. 根据权利要求5所述的增益控制装置,其中,所述多个比较器包括第二比较器,所述第二比较器的正向输入端和反向输入端经由所述切换开关分别与所述多个阈值电压中的一个阈值电压和所述放大器的检测电压耦接,并且,所述提高增益控制信号至少基于所述第二比较器的输出而确定。The gain control device according to claim 5, wherein the plurality of comparators include a second comparator, a positive input terminal and a negative input terminal of the second comparator are respectively coupled to one of the plurality of threshold voltages and a detection voltage of the amplifier via the switching switch, and the increased gain control signal is determined based on at least an output of the second comparator. 根据权利要求5所述的增益控制装置,其中,所述多个比较器包括第三比较器和第四比较器,所述第三比较器的反向输入端与所述放大器的检测电压耦接,另一端经由所述切换开关与所述多个阈值电压中的一个阈值电压耦接,所述第四比较器的正向输入端与所述放大器的检测电压耦接,另一端经由所述切换开关与所述多个阈值电压中的一个阈值电压耦接,并且,所述降低增益控制信号至少基于所述第三比较器和所述第四比较器的输出而确定。The gain control device according to claim 5, wherein the plurality of comparators include a third comparator and a fourth comparator, the inverting input terminal of the third comparator is coupled to the detection voltage of the amplifier, and the other terminal is coupled to one of the plurality of threshold voltages via the switching switch, the positive input terminal of the fourth comparator is coupled to the detection voltage of the amplifier, and the other terminal is coupled to one of the plurality of threshold voltages via the switching switch, and the gain reduction control signal is determined based on at least the outputs of the third comparator and the fourth comparator. 根据权利要求8所述的增益控制装置,其中,所述电压检测电路还包括:The gain control device according to claim 8, wherein the voltage detection circuit further comprises: 第一降低增益控制信号生成电路,其包括串联的N个触发器,每个触发器的C端耦接到所述第三比较器和第四比较器的输出端,N≥2。The first gain reduction control signal generating circuit comprises N flip-flops connected in series, wherein the C terminal of each flip-flop is coupled to the output terminals of the third comparator and the fourth comparator, and N≥2. 根据权利要求9所述的增益控制装置,其中,所述过零信号还配置为对所述N个触发器的输出进行清零。The gain control device according to claim 9, wherein the zero-crossing signal is further configured to clear the outputs of the N flip-flops. 根据权利要求9所述的增益控制装置,其中,所述电压检测电路还包括:The gain control device according to claim 9, wherein the voltage detection circuit further comprises: 第二降低增益控制信号生成电路,其包括与门运算单元,所述与门运算单元的第一输入端与所述第一降低增益控制信号生成电路耦接,所述与门运算单元的第二输入端与所述第三比较器和第四比较器的输出耦接。The second gain reduction control signal generating circuit comprises an AND gate operation unit, wherein a first input end of the AND gate operation unit is coupled to the first gain reduction control signal generating circuit, and a second input end of the AND gate operation unit is coupled to the outputs of the third comparator and the fourth comparator. 根据权利要求1所述的增益控制装置,所述增益控制装置还包括:切换信号生成电路,其配置为基于所述放大器的检测电压与所述多个阈值电压比较的结果生成所述切换开关的开关切换信号。 The gain control device according to claim 1, further comprising: a switching signal generating circuit configured to generate a switch switching signal of the switching switch based on a result of comparing the detection voltage of the amplifier with the plurality of threshold voltages. 根据权利要求3所述的增益控制装置,其中,所述模式信号生成电路包括:The gain control device according to claim 3, wherein the mode signal generating circuit comprises: 第五比较器,其正向输入端和反向输入端经由模式切换开关分别与所述第一阈值电压和所述固定的至少一级阈值电压耦接;a fifth comparator, wherein a positive input terminal and a negative input terminal of the fifth comparator are respectively coupled to the first threshold voltage and the fixed at least one level threshold voltage via a mode switching switch; 第二触发器,其C端耦接到所述第五比较器的输出端;A second trigger, a C terminal of which is coupled to the output terminal of the fifth comparator; 第三触发器,其C端经由反相器耦接到所述第五比较器的输出端,其D端连接到所述第二触发器的Q端;A third flip-flop, a C terminal of which is coupled to the output terminal of the fifth comparator via an inverter, and a D terminal of which is connected to the Q terminal of the second flip-flop; 其中,所述模式信号基于所述第二触发器和第三触发器的Q端输出而确定。The mode signal is determined based on the Q-end outputs of the second flip-flop and the third flip-flop. 一种增益控制方法,包括:A gain control method, comprising: 确定多个阈值电压,所述多个阈值电压包括第一阈值电压和固定的至少一级阈值电压,其中,所述第一阈值电压大小与放大器的供给电压大小相关联;Determine a plurality of threshold voltages, the plurality of threshold voltages comprising a first threshold voltage and at least one fixed threshold voltage, wherein the first threshold voltage is associated with a supply voltage of the amplifier; 将所述第一阈值电压与所述固定的至少一级阈值电压进行比较,根据比较结果确定增益控制的模式信号;Comparing the first threshold voltage with the fixed at least one level threshold voltage, and determining a mode signal of gain control according to the comparison result; 将放大器的检测电压与所述多个阈值电压按预设顺序分别进行比较,并根据比较结果输出控制信号,所述模式信号与将所述多个阈值电压分别与所述检测电压进行比较的预设顺序相关联;Comparing the detection voltage of the amplifier with the plurality of threshold voltages in a preset order, and outputting a control signal according to the comparison result, wherein the mode signal is associated with the preset order in which the plurality of threshold voltages are compared with the detection voltage; 其中,在所述放大器的检测电压大于所述第一阈值电压时输出第一降低增益控制信号;当存在至少一级阈值电压小于所述第一阈值电压,且在所述放大器的检测电压大于所述固定的至少一级阈值电压时输出另一降低增益控制信号,所述第一降低增益控制信号配置为具有高于所述另一降低增益控制信号的优先级。Wherein, a first gain reduction control signal is output when the detection voltage of the amplifier is greater than the first threshold voltage; another gain reduction control signal is output when there is at least one threshold voltage less than the first threshold voltage and the detection voltage of the amplifier is greater than the fixed at least one threshold voltage, and the first gain reduction control signal is configured to have a higher priority than the other gain reduction control signal. 根据权利要求14所述的增益控制方法,其中,所述固定的至少一级阈值电压至少包括第二阈值电压和第三阈值电压,并且,将所述第一阈值电压与所述固定的至少一级阈值电压进行比较,根据比较结果确定增益控制的模式信号包括:The gain control method according to claim 14, wherein the fixed at least one threshold voltage includes at least a second threshold voltage and a third threshold voltage, and comparing the first threshold voltage with the fixed at least one threshold voltage, and determining the mode signal of the gain control according to the comparison result comprises: 当所述第一阈值电压大于所述第二阈值电压和第三阈值电压时,确定所 述模式信号为第一模式信号;When the first threshold voltage is greater than the second threshold voltage and the third threshold voltage, it is determined that The mode signal is a first mode signal; 当所述第一阈值电压介于所述第二阈值电压和第三阈值电压之间时,确定所述模式信号为第二模式信号;When the first threshold voltage is between the second threshold voltage and the third threshold voltage, determining that the mode signal is a second mode signal; 当所述第一阈值电压小于所述第二阈值电压和第三阈值电压时,确定所述模式信号为第三模式信号。When the first threshold voltage is less than the second threshold voltage and the third threshold voltage, the mode signal is determined to be a third mode signal. 根据权利要求15所述的增益控制方法,其中,所述将放大器的检测电压与所述多个阈值电压按预设顺序分别进行比较,并根据比较结果输出控制信号包括:The gain control method according to claim 15, wherein the step of comparing the detection voltage of the amplifier with the plurality of threshold voltages in a preset order and outputting a control signal according to the comparison result comprises: 在第一模式信号下,当所述放大器的检测电压大于所述第三阈值电压时输出第三降低增益控制信号,当所述放大器的检测电压大于所述第二阈值电压时输出第二降低增益控制信号,当所述放大器的检测电压大于所述第一阈值电压时输出所述第一降低增益控制信号,In the first mode signal, when the detection voltage of the amplifier is greater than the third threshold voltage, a third gain reduction control signal is output; when the detection voltage of the amplifier is greater than the second threshold voltage, a second gain reduction control signal is output; when the detection voltage of the amplifier is greater than the first threshold voltage, the first gain reduction control signal is output; 在第二模式信号下,当所述放大器的检测电压大于所述第三阈值电压时输出所述第三降低增益控制信号,当所述放大器的检测电压大于所述第一阈值电压时输出所述第一降低增益控制信号,In the second mode signal, when the detection voltage of the amplifier is greater than the third threshold voltage, the third gain reduction control signal is output, and when the detection voltage of the amplifier is greater than the first threshold voltage, the first gain reduction control signal is output, 在第三模式信号下,当所述放大器的检测电压大于所述第一阈值电压时输出所述第一降低增益控制信号,In the third mode signal, when the detection voltage of the amplifier is greater than the first threshold voltage, the first gain reduction control signal is output, 其中,所述第一降低增益控制信号、第二降低增益控制信号、第三降低增益控制信号与不同的降低增益启动时间相关联。The first gain reduction control signal, the second gain reduction control signal, and the third gain reduction control signal are associated with different gain reduction start times. 根据权利要求14所述的增益控制方法,所述方法还包括:The gain control method according to claim 14, further comprising: 将所述放大器的检测电压与固定的第四阈值电压进行比较,并且响应于在所述放大器的检测电压小于所述第四阈值电压时输出提高增益控制信号,其中,所述第一降低增益控制信号配置为具有高于所述提高增益控制信号的优先级。The detection voltage of the amplifier is compared with a fixed fourth threshold voltage, and an increase gain control signal is output in response when the detection voltage of the amplifier is less than the fourth threshold voltage, wherein the first decrease gain control signal is configured to have a higher priority than the increase gain control signal. 一种音频设备,包括增益控制装置以及与所述增益控制装置耦接的扬声器,其中,所述增益控制装置包括:An audio device comprises a gain control device and a speaker coupled to the gain control device, wherein the gain control device comprises: 电压检测电路,配置为接收放大器的检测电压并将所述检测电压按预设顺序与多个阈值电压分别进行比较,并且根据比较结果输出控制信号; A voltage detection circuit is configured to receive a detection voltage of the amplifier and compare the detection voltage with a plurality of threshold voltages in a preset order, and output a control signal according to the comparison result; 切换开关,按所述预设顺序将所述多个阈值电压分别耦接到所述电压检测电路以与所述检测电压进行比较;以及A switching switch is used to couple the plurality of threshold voltages to the voltage detection circuit in the preset order to compare with the detection voltage; and 增益控制电路,配置为基于所述电压检测电路输出的控制信号输出增益信号至所述放大器。The gain control circuit is configured to output a gain signal to the amplifier based on a control signal output by the voltage detection circuit. 根据权利要求18所述的音频设备,其中,所述增益控制装置还包括:模式信号生成电路,其配置为基于所述多个阈值电压之间的大小关系生成模式信号,所述模式信号与将所述多个阈值电压分别与所述检测电压进行比较的所述预设顺序相关联。The audio device according to claim 18, wherein the gain control device further comprises: a mode signal generating circuit, which is configured to generate a mode signal based on the magnitude relationship between the multiple threshold voltages, and the mode signal is associated with the preset order of comparing the multiple threshold voltages with the detection voltage respectively. 根据权利要求18所述的音频设备,其中,所述增益控制装置还包括:切换信号生成电路,其配置为基于所述放大器的检测电压与所述多个阈值电压比较的结果生成所述切换开关的开关切换信号。 The audio device according to claim 18, wherein the gain control device further comprises: a switching signal generating circuit configured to generate a switch switching signal of the switching switch based on a result of comparing the detection voltage of the amplifier with the plurality of threshold voltages.
PCT/CN2023/124936 2022-11-07 2023-10-17 Gain control apparatus and method WO2024099038A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211386738.7A CN115664363B (en) 2022-11-07 2022-11-07 Gain control device and method
CN202211386738.7 2022-11-07

Publications (1)

Publication Number Publication Date
WO2024099038A1 true WO2024099038A1 (en) 2024-05-16

Family

ID=85016513

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/124936 WO2024099038A1 (en) 2022-11-07 2023-10-17 Gain control apparatus and method

Country Status (2)

Country Link
CN (1) CN115664363B (en)
WO (1) WO2024099038A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115664363B (en) * 2022-11-07 2024-02-02 武汉市聚芯微电子有限责任公司 Gain control device and method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6100680A (en) * 1996-01-17 2000-08-08 Allegro Microsystems, Inc. Detecting the passing of magnetic articles using a transducer-signal detector having a switchable dual-mode threshold
CN104485909A (en) * 2014-12-31 2015-04-01 上海艾为电子技术股份有限公司 Gain control method and device
CN104485910A (en) * 2014-12-31 2015-04-01 上海艾为电子技术股份有限公司 Gain control method and device
CN104767498A (en) * 2015-04-30 2015-07-08 上海艾为电子技术股份有限公司 Gain control method and device
CN115664363A (en) * 2022-11-07 2023-01-31 武汉市聚芯微电子有限责任公司 Gain control device and method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9264280B1 (en) * 2015-01-23 2016-02-16 Freescale Semiconductor, Inc. Automatic received gain control

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6100680A (en) * 1996-01-17 2000-08-08 Allegro Microsystems, Inc. Detecting the passing of magnetic articles using a transducer-signal detector having a switchable dual-mode threshold
CN104485909A (en) * 2014-12-31 2015-04-01 上海艾为电子技术股份有限公司 Gain control method and device
CN104485910A (en) * 2014-12-31 2015-04-01 上海艾为电子技术股份有限公司 Gain control method and device
CN104767498A (en) * 2015-04-30 2015-07-08 上海艾为电子技术股份有限公司 Gain control method and device
CN115664363A (en) * 2022-11-07 2023-01-31 武汉市聚芯微电子有限责任公司 Gain control device and method

Also Published As

Publication number Publication date
CN115664363B (en) 2024-02-02
CN115664363A (en) 2023-01-31

Similar Documents

Publication Publication Date Title
US7595692B2 (en) Automatic gain control circuit
US11552546B2 (en) Multi-phase power supply dynamic response control circuit and control method
WO2024099038A1 (en) Gain control apparatus and method
US20110298527A1 (en) Real time dynamic optimization of deadtime
KR102005337B1 (en) Voltage converter
CN106656085B (en) A kind of gain control
CN109167588B (en) Fully differential Class D clamping recovery circuit
US8872561B2 (en) Systems and methods for edge control based on detecting current direction in a switched output stage
JP4513832B2 (en) Class D amplifier circuit
CN113783450A (en) A control system and method suitable for ANPC topology converter
US7015759B2 (en) AGC circuit
WO2005078969A1 (en) Automatic bit rate control circuit
CN115459720A (en) Audio power amplifier circuit and duty ratio modulation circuit and noise suppression circuit thereof
TWI713309B (en) Analog output circuit
TWI665866B (en) Modulation selecting circuit of audio amplifier
JP2005051609A (en) Signal output circuit
JP2005051607A (en) Voltage generation circuit
US10498303B2 (en) Signal level detection and overrange signal limiter and clamp for electronic circuits
JP2004056660A (en) Audio signal noise eliminator
TWI878038B (en) Voltage conversion device, power supply system and interference suppression method
JP7463952B2 (en) Overcurrent detection circuit and switching power supply circuit
CN115632541A (en) Self-adaptive no-signal time control circuit
TW202239144A (en) Direct current offset protection circuit and method
JP2025068482A (en) Semiconductor switching element drive circuit
CN117491765A (en) Direct current detection circuit and electronic equipment suitable for class D amplifier

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23887730

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE