CN-121984464-A - Smooth digital gain control device and method
Abstract
The invention relates to a smooth digital gain control device and method, wherein the device comprises an analog switch gain adjusting module, a digital gain adjusting module, a zero crossing detecting module, a gradual gradually-out control module, a central control unit and an audio signal input/output interface. According to the invention, by combining an analog switch and digital gain adjustment, gain adjustment with a wide range of 0-66 dB and high accuracy of 0.1dB is realized, a zero detection and gradual fading mechanism is newly added, noise caused by gain change is eliminated, and the stability and tone quality of audio signal processing are improved.
Inventors
- HUANG JIANHENG
Assignees
- 东莞市美派电子科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20251216
Claims (8)
- 1. A smooth digital gain control device is characterized by comprising an analog switch gain adjusting module, a digital gain adjusting module, a zero crossing detecting module, a progressive gradually-out control module, a central control unit and an audio signal input/output interface, The analog switch gain adjusting module is used for realizing analog coarse adjustment, a plurality of groups of precise analog switches and a voltage dividing resistor network are arranged in the analog switch gain adjusting module, the central control unit sends control signals to the analog switches of the gain adjusting module through I/O pins, and the gain coarse adjustment of 0-66 dB is realized by selecting different resistor combination paths; The digital gain adjusting module is used for realizing digital fine adjustment, adopting FPGA to carry out gain fine adjustment of 0-6 dB on the digital audio signal, and adjusting the stepping precision to be 0.1dB; The zero-crossing detection module is used for detecting each digital audio sample in real time by the FPGA, and outputting a zero-crossing signal when detecting that the digital audio sample value is 0 or the sign bit is changed; The progressive-gradually-out control module is used for realizing progressive control of gain change through an FPGA (field programmable gate array) by an algorithm, splitting the total gain change amount into a plurality of tiny gain steps when the current gain value is required to be adjusted to a target gain value, and controlling the execution interval of each tiny step to ensure smooth transition of the gain change; the central control unit adopts a field programmable gate array to realize the functions of a zero-crossing detection module, a gradual-fading control module and a digital gain adjustment module, and controls the analog switch gain adjustment module through IO; The audio signal input/output interface is used as a transmission channel of the audio signal, the audio signal input interface receives an external audio signal and transmits the external audio signal to the analog switch gain adjustment module for analog coarse adjustment, and then the audio signal after digital fine adjustment is transmitted to the FPGA through the ADC and is transmitted to the subsequent audio processing unit through the audio signal output interface.
- 2. The device of claim 1, wherein the analog switch gain adjusting module comprises an operational amplifier U53A, an operational amplifier U53B, an operational amplifier U51A and an operational amplifier U51D, a signal input end CH 3_IN_P is connected with 3 pins of the operational amplifier U53A, 2 pins of the operational amplifier U53A are connected with 1 pin of the operational amplifier U53A through a capacitor C241, 1 pin of the operational amplifier U53A is sequentially connected with a resistor R411 to a resistor R414, 2 pins of the operational amplifier U53A are used as signal ends CH 3_PI_RES_IN, and the tail ends of the resistors R411 to R414 and CH 3_PI_RES_IN form signal amplification respectively 1.01 times/0.10 dB,6.33 times/16.03 dB,39.45 times/31.92 dB,252.82 times/48.05 dB; The signal input end CH3_IN_N is connected with the 5 pin of the operational amplifier U53B, the 6 pin of the operational amplifier U53B is connected with the 7 pin of the operational amplifier U53B through a capacitor C246, the 7 pin of the operational amplifier U53B is sequentially connected with a resistor R431 to a resistor R434, the 6 pin of the operational amplifier U53B is used as a signal end CH3_NI_RES_IN, the tail ends of the resistor R431 to the resistor R434 and the CH 3_NI_RES_IN form signal amplification, and the signal amplification is respectively 1.01 times/0.10 dB,6.33 times/16.03 dB,39.45 times/31.92 dB and 252.82 times/48.05 dB; the tail end of the resistor R434 is connected with the tail end of the resistor R414 through a polar capacitor E53 and a resistor R426 in sequence; The 1 pin of the operational amplifier U53A is also sequentially connected with a resistor R447-R451, the tail end of the resistor R451 is connected with the 14 pin of the operational amplifier U51D, the 14 pin of the operational amplifier U51D is connected with the 12 pin of the operational amplifier U51D through a capacitor C258, and the 12 pin of the operational amplifier U51D and the tail end of the resistor R447-R450 form signal amplification which is respectively 4.01 times/12.06 dB,2.52 times/8.03 dB,1.59 times/4.02 dB and 1.00 times/0.04 dB; The 7 pins of the operational amplifier U53B are also sequentially connected with a resistor R438-R442, the tail end of the resistor R442 is connected with the 15 pin of the operational amplifier U51A, the 15 pin of the operational amplifier U51A is connected with the 1 pin of the operational amplifier U51A through a capacitor C251, and the 1 pin of the operational amplifier U51A and the tail end of the resistor R438-R441 form signal amplification which is respectively 4.01 times/12.06 dB,2.52 times/8.03 dB,1.59 times/4.02 dB and 1.00 times/0.04 dB; The 2 pin of the operational amplifier U51A and the 11 pin of the operational amplifier U51D are connected with GND, and the 15 pin of the operational amplifier U51A and the 14 pin of the operational amplifier U51D are used as signal output ends.
- 3. The device of claim 2, wherein resistors R416 and R424 are connected between the 3 pins of the operational amplifier U53A and the 5 pins of the operational amplifier U53B, and the resistor R416 and R424 are connected with GND.
- 4. A smooth digital gain control device according to claim 3, wherein when the FPGA receives an external gain adjustment command, calculating an analog coarse shift position plus digital fine shift value corresponding to a target gain, after receiving a zero-crossing trigger signal of a zero-crossing detection module, controlling a gradual-fading-out control module to execute a gain adjustment action, and controlling an analog switch gain adjustment module through IO according to a current actual gain value.
- 5. The device of claim 4, wherein each step of the analog switch gain adjustment module is fixed to 6dB, and the specific gear comprises 0dB, 6dB, 12dB, 66dB, and 12 coarse adjustment gears; the digital gain adjustment module supports 60 fine adjustment gears of 0.1dB, 0.2dB, and.
- 6. A smooth digital gain control as set forth in claim 2 wherein the step value of the gain step in the progressive fade-out control module is equal to the fine step of the digital gain adjustment module, i.e., 0.1dB.
- 7. A smooth digital gain control method using the device of any one of claims 1-6 is characterized in that the method comprises the following steps S1, triggering a gain adjustment instruction, namely sending a target gain value instruction by a user through a key, a knob or upper computer software of audio equipment, wherein the instruction is received by a central control unit; s2, decomposing the target gain into an analog coarse gain and a digital fine gain by the central control unit according to a preset algorithm, wherein the analog coarse gain is an integer multiple of 6dB, and the value range is 0-66 dB; s3, waiting for zero-crossing detection, wherein the central control unit sends a detection enabling signal to the zero-crossing detection module, the zero-crossing detection module starts to detect an input audio signal in real time, and when the audio signal is detected to be at a zero-crossing point, a zero-crossing trigger signal is fed back to the gradual-gradually-out control module; S4, calculating a next gain value after the gradual fade-out control module receives the zero-crossing trigger signal; s5, performing gain adjustment, namely controlling an analog switch gain adjustment module through IO according to the next gain value output by the progressive-fading control module, switching the analog switch gain adjustment module to the decomposed analog coarse gain gear to finish coarse adjustment, and sending a digital fine adjustment instruction to a digital gain adjustment module to adjust digital gain.
- 8. The method of claim 7, wherein S2, the analog coarse gain is determined to be 24dB and the digital fine gain is calculated to be 1.3dB when the target gain is 25.3 dB.
Description
Smooth digital gain control device and method Technical Field The present application belongs to the technical field of audio signal processing, and more particularly, to a smooth digital gain control device and a smooth digital gain control method applied to audio equipment. The method can be widely used for various scenes needing to accurately adjust the gain of the audio signal, such as a sound system, an audio amplifier, recording equipment, a communication terminal and the like, realizes flexible and high-precision control of the amplitude of the audio signal, and meets the audio output requirements under different scenes. Background In the audio field, gain control is a core technology for adjusting the amplitude of an audio signal, and directly affects the tone quality, loudness and stability of audio output. Currently, the main gain control methods in the market mainly comprise two types, namely coarse gain control realized by an analog switch, usually limited gain adjustment range and larger stepping value, which is difficult to meet the requirement of high-precision adjustment, and fine gain control realized by a digital circuit, which can realize small stepping adjustment, but has a narrower overall gain range, and cannot cover audio adjustment scenes with a large dynamic range. Meanwhile, the existing gain control method generally lacks a zero-crossing detection and gradual fading mechanism. In practical application, when the gain value needs to be changed, the gain adjustment action is often directly executed at any phase point of the audio signal, so that the original waveform of the audio signal is easily damaged, and abnormal conditions such as abrupt change and distortion occur to the waveform, so that obvious noise (such as plosive sound and current sound) is generated, the hearing experience of a user is seriously affected, and the problem is more remarkable especially in professional audio equipment (such as recording studio equipment and high-end sound equipment) with higher sound quality requirements. Aiming at the problems that the gain range and the adjustment precision are difficult to be compatible and the gain adjustment is easy to generate noise in the existing gain control method, the invention provides a smooth digital gain control method, which realizes gain adjustment with wide range of 0-66 dB and high precision of 0.1dB by combining an analog switch and digital gain adjustment, and newly adds a zero crossing detection and gradual fading mechanism, thereby eliminating noise caused by gain change and improving the stability and tone quality of audio signal processing. Disclosure of Invention The invention aims to solve the technical problem of providing a smooth digital gain control device and a smooth digital gain control method, which realize gain adjustment with wide range and high precision, eliminate noise caused by gain change and improve the stability and the tone quality of audio signal processing. In order to solve the problems, the invention adopts the following technical scheme: a method of smooth digital gain control, comprises an analog switch gain adjusting module, a digital gain adjusting module, a zero crossing detecting module, a gradual gradually-out control module, a central control unit and an audio signal input/output interface, The analog switch gain adjusting module is used for realizing analog coarse adjustment, a plurality of groups of precise analog switches (such as CMOS analog switch chips) and a voltage dividing resistor network are arranged in the analog switch gain adjusting module, the central control unit sends control signals to the analog switches of the gain adjusting module through I/O pins, gain coarse adjustment of 0-66 dB is realized by selecting different resistor combination paths, each step of step is fixed to be 6dB, and specific gears comprise 0dB, 6dB, 12dB and 66dB, and the total number of the coarse adjustment gears is 12; The digital gain adjusting module is used for realizing digital fine adjustment, adopting FPGA to carry out gain fine adjustment of 0-6 dB on the digital audio signal, adjusting the stepping precision to be 0.1dB, and supporting 60 fine adjustment gears of 0.1dB, 0.2dB and 6.0 dB; The zero-crossing detection module is used for detecting each digital audio sample in real time by the FPGA, and outputting a zero-crossing signal when detecting that the digital audio sample value is 0 or the sign bit is changed; the progressive-gradually-out control module is used for realizing progressive control of gain change through an FPGA (field programmable gate array) by an algorithm, splitting the total gain change into a plurality of tiny gain steps (the step value is consistent with the fine adjustment step of the digital gain adjustment module, namely 0.1 dB) when the current gain value is required to be adjusted to a target gain value, and controlling the execution interval of each tiny step to ensure smooth transition