Smooth digital gain control device and method
By combining analog switching with digital gain adjustment, high-precision gain adjustment over a wide range is achieved. Noise is eliminated through zero-crossing detection and gradual-out mechanisms, solving the problem of difficulty in balancing gain adjustment range and precision in existing technologies, and improving the stability and sound quality of audio signals.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DONGGUAN MEIPAI ELECTRONIC TECH CO LTD
- Filing Date
- 2025-12-16
- Publication Date
- 2026-05-05
AI Technical Summary
Existing gain control methods struggle to balance wide range and high precision adjustment, and gain adjustment is prone to noise issues, affecting the stability and sound quality of audio signals.
By combining analog switching with digital gain adjustment, a wide range of gain adjustment from 0 to 66 dB is achieved through analog coarse adjustment and digital fine adjustment. Zero-crossing detection and gradual-out mechanisms are introduced to ensure smooth transition of gain changes.
It achieves high-precision gain adjustment of 0.1dB, eliminates noise caused by gain changes, improves the stability and sound quality of audio signals, and is suitable for various audio device scenarios.
Smart Images

Figure CN121984464A_ABST
Abstract
Description
Technical Field
[0001] This patent application belongs to the field of audio signal processing technology, and more specifically, relates to a smooth digital gain control device and method for use in audio equipment. It can be widely used in various scenarios requiring precise adjustment of audio signal gain, such as audio systems, audio amplifiers, recording equipment, and communication terminals, to achieve flexible and high-precision control of audio signal amplitude and meet the audio output needs of different scenarios. Background Technology
[0002] In the audio field, gain control is a core technology for adjusting the amplitude of audio signals, directly affecting the sound quality, loudness, and stability of audio output. Currently, the mainstream gain control methods on the market are mainly divided into two categories: one is coarse gain control implemented through analog switches, which usually has a limited gain adjustment range and large step values, making it difficult to meet the needs of high-precision adjustment; the other is fine gain control implemented through digital circuits, which can achieve small step adjustments, but the overall gain range is narrow and cannot cover audio adjustment scenarios with a large dynamic range.
[0003] Meanwhile, existing gain control methods generally lack zero-crossing detection and gradual-in / gradual-out mechanisms. In practical applications, when it is necessary to change the gain value, the gain adjustment action is often performed directly at any phase point of the audio signal, which can easily destroy the original waveform of the audio signal, causing abnormalities such as abrupt changes and distortion, and thus generating obvious noise (such as popping sounds, current sounds, etc.), which seriously affects the user's listening experience. This problem is even more prominent in professional audio equipment with high sound quality requirements (such as recording studio equipment and high-end audio systems).
[0004] To address the problems of "difficulty in balancing gain range and adjustment accuracy" and "noise generation during gain adjustment" in existing gain control methods, this invention provides a smooth digital gain control method. By combining analog switches and digital gain adjustment, it achieves a wide gain adjustment range of 0~66dB and a high precision of 0.1dB. Furthermore, it adds zero-crossing detection and a gradual fade-in / fade-out mechanism to eliminate noise caused by gain changes and improve the stability and sound quality of audio signal processing. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a smooth digital gain control device and method, which can realize wide-range and high-precision gain adjustment, eliminate noise caused by gain changes, and improve the stability and sound quality of audio signal processing.
[0006] To solve the above problems, the technical solution adopted by the present invention is as follows: A smooth digital gain control method includes an analog switching gain adjustment module, a digital gain adjustment module, a zero-crossing detection module, a gradual-in / gradual-out control module, a central control unit, and an audio signal input / output interface. Analog switch gain adjustment module: used to achieve analog coarse adjustment. It has multiple sets of precision analog switches (such as CMOS analog switch chips) and voltage divider resistor network. The central control unit sends control signals to the analog switches of the gain adjustment module through I / O pins. By selecting different resistor combination paths, the gain coarse adjustment from 0 to 66dB can be achieved, and each step is fixed at 6dB. The specific ranges include 0dB, 6dB, 12dB, ..., 66dB, a total of 12 coarse adjustment ranges. Digital gain adjustment module: used to achieve fine digital adjustment, using FPGA to fine adjust the gain of digital audio signals from 0 to 6dB, with an adjustment step accuracy of up to 0.1dB, supporting 60 fine adjustment levels from 0.1dB to 6.0dB; Zero-crossing detection module: The FPGA checks each digital audio sample in real time. When a digital audio sample value of 0 or a change in sign bit is detected, a zero-crossing signal is output. The progressive gain control module: The FPGA implements progressive gain control through algorithms. When it is necessary to adjust from the current gain value to the target gain value, the progressive gain control module will break down the total gain change into multiple small gain steps (the step value is consistent with the fine-tuning step of the digital gain adjustment module, i.e., 0.1dB), and control the execution interval of each small step to ensure a smooth transition of gain change. Central control unit: It adopts a field-programmable gate array (FPGA) to implement the functions of zero-crossing detection module, gradual-in and gradual-out control module, and digital gain adjustment module, and controls the analog switch gain adjustment module through I / O; Audio signal input / output interface: As the transmission channel for audio signals, the audio signal input interface receives external audio signals and transmits them to the analog switch gain adjustment module for analog coarse adjustment. Then, the audio signal is transmitted to the FPGA for digital fine adjustment via the ADC. Finally, the audio signal is transmitted to the subsequent audio processing unit (such as amplifier, speaker, etc.) via the audio signal output interface.
[0007] Furthermore, the analog switch gain adjustment module includes operational amplifiers U53A, U53B, U51A, and U51D. The signal input terminal CH3_IN_P is connected to pin 3 of operational amplifier U53A. Pin 2 of operational amplifier U53A is connected to pin 1 of operational amplifier U53A through capacitor C241. Pin 1 of operational amplifier U53A is connected to resistors R411 to R414 in sequence. Pin 2 of operational amplifier U53A serves as the signal terminal CH3_PI_RES_IN. The ends of resistors R411 to R414, together with CH3_PI_RES_IN, constitute signal amplification, respectively: 1.01 times / 0.10dB, 6.33 times / 16.03dB, 39.45 times / 31.92dB, and 252.82 times / 48.05dB. The signal input terminal CH3_IN_N is connected to pin 5 of operational amplifier U53B. Pin 6 of operational amplifier U53B is connected to pin 7 of operational amplifier U53B through capacitor C246. Pin 7 of operational amplifier U53B is connected to resistors R431 to R434 in sequence. Pin 6 of operational amplifier U53B serves as the signal terminal CH3_NI_RES_IN. The ends of resistors R431 to R434, together with CH3_NI_RES_IN, amplify the signal by 1.01 times / 0.10dB, 6.33 times / 16.03dB, 39.45 times / 31.92dB, and 252.82 times / 48.05dB, respectively. The end of resistor R434 is connected to the end of resistor R414 in sequence through polarized capacitor E53 and resistor R426. Pin 1 of operational amplifier U53A is connected in sequence to resistors R447 to R451. The end of resistor R451 is connected to pin 14 of operational amplifier U51D. Pin 14 of operational amplifier U51D is connected to pin 12 of operational amplifier U51D through capacitor C258. Pin 12 of operational amplifier U51D, together with the ends of resistors R447 to R450, constitutes signal amplification, which are 4.01 times / 12.06dB, 2.52 times / 8.03dB, 1.59 times / 4.02dB, and 1.00 times / 0.04dB, respectively. Pin 7 of operational amplifier U53B is connected in sequence to resistors R438 to R442. The end of resistor R442 is connected to pin 15 of operational amplifier U51A. Pin 15 of operational amplifier U51A is connected to pin 1 of operational amplifier U51A through capacitor C251. Pin 1 of operational amplifier U51A and the ends of resistors R438 to R441 all constitute signal amplification, which are 4.01 times / 12.06dB, 2.52 times / 8.03dB, 1.59 times / 4.02dB, and 1.00 times / 0.04dB, respectively. Pin 2 of operational amplifier U51A and pin 11 of operational amplifier U51D are both connected to GND, and pin 15 of operational amplifier U51A and pin 14 of operational amplifier U51D are both used as signal output terminals.
[0008] Furthermore, resistors R416 and R424 are connected between pin 3 of operational amplifier U53A and pin 5 of operational amplifier U53B, and GND is connected between resistors R416 and R424.
[0009] Furthermore, when the FPGA receives an external gain adjustment command (such as a command sent by the user via a device button or a host computer), it calculates the "analog coarse adjustment level + digital fine adjustment value" corresponding to the target gain. After receiving the zero-crossing trigger signal from the zero-crossing detection module, it controls the gradual-in and gradual-out control module to perform the gain adjustment action, and controls the analog switch gain adjustment module via IO according to the current actual gain value.
[0010] Furthermore, the step size of the analog switch gain adjustment module is fixed at 6dB, with specific levels including 0dB, 6dB, 12dB, ..., 66dB, for a total of 12 coarse adjustment levels; The digital gain adjustment module supports 60 fine-tuning levels: 0.1dB, 0.2dB, ..., 6.0dB.
[0011] Furthermore, the gain step value in the gradual-in / gradual-out control module is consistent with the fine-tuning step of the digital gain adjustment module, which is 0.1dB.
[0012] A smooth digital gain control method, utilizing the aforementioned device, is described in the following steps: S1. Gain adjustment command trigger: The user sends a target gain value command (range 0~66dB) through the buttons, knobs or host computer software of the audio device, and the command is received by the central control unit. S2. Target Gain Decomposition: The central control unit decomposes the target gain value into "analog coarse adjustment gain" and "digital fine adjustment gain" according to the preset algorithm. The analog coarse adjustment gain is an integer multiple of 6dB, with a value range of 0~66dB. For example, when the target gain is 25.3dB, the analog coarse adjustment gain is determined to be 24dB, and the digital fine adjustment gain is calculated to be 1.3dB. S3, Zero Crossing Detection Waiting: The central control unit sends a detection enable signal to the zero crossing detection module. The zero crossing detection module starts to detect the input audio signal in real time. When the audio signal is detected to be at the zero crossing point, it feeds back the zero crossing trigger signal to the gradual exit control module. S4. Calculate the next gain value: After the gradual-out control module receives the zero-crossing trigger signal, it calculates the next gain value. For example, if the current gain value is 25.3dB and the target gain value is 30.0dB, then the next gain value should be 25.4dB. The next gain value is updated for each zero-crossing signal, increasing / decreasing by 0.1dB each time, until it matches the target gain value. S5. Gain Adjustment Execution: Based on the next gain value output by the progressive-to-exit control module, control the analog switch gain adjustment module via IO to switch it to the decomposed analog coarse adjustment gain level (if the next gain value is 25.4, then the analog gain should be 24dB), completing the coarse adjustment action; send a digital fine adjustment command to the digital gain adjustment module to adjust the digital gain (if the next gain value is 25.4, then the digital gain should be 1.4dB).
[0013] Furthermore, in S2, when the target gain is 25.3dB, the analog coarse adjustment gain is determined to be 24dB, and the digital fine adjustment gain is calculated to be 1.3dB.
[0014] Due to the adoption of the above technical solution, the beneficial effects achieved by this invention are: This invention solves the problem of "difficulty in balancing gain range and precision": In existing technologies, analog switch adjustment can only achieve coarse adjustment, and digital adjustment can only achieve fine adjustment within a narrow range. This invention achieves high-precision adjustment of 0.1dB within a wide range of 0~66dB through a "coarse adjustment + fine adjustment" collaborative scheme, which can meet the needs of various scenarios from weak audio signal amplification (such as microphone signals) to strong signal attenuation (such as high-fidelity audio output), and has a wider range of applications. Eliminating noise generated by gain adjustment: Existing technologies lack zero-crossing detection and gradual fade-out, making gain changes prone to waveform abrupt changes and noise generation. This invention employs "zero-crossing trigger + gradual adjustment": zero-crossing trigger ensures that gain changes are performed at the zero-crossing point where the audio signal amplitude is lowest, avoiding abrupt signal phase changes; gradual adjustment breaks down gain changes into tiny steps, allowing for a smooth transition of signal amplitude, fundamentally solving the waveform abnormality problem, significantly reducing noise, and greatly improving the listening experience; High stability and reliability: The synchronous control algorithm of the central control unit can accurately coordinate the working sequence of each module, avoiding the conflict between analog coarse adjustment and digital fine adjustment. Attached Figure Description
[0015] Figure 1 This is a schematic diagram of waveform abrupt changes without the addition of zero detection and gradual fade-in / fade-out mechanisms.
[0016] Figure 2 This is a schematic diagram of the waveform abrupt change in the present invention. Figure 1 .
[0017] Figure 3 This is a schematic diagram of the waveform abrupt change in the present invention. Figure 2 .
[0018] Figure 4 This is a system block diagram of the present invention.
[0019] Figure 5 This is a circuit diagram of the analog switch gain adjustment module in this invention.
[0020] Figure 6 This is a diagram illustrating the operational amplifier gain state of the analog switch gain adjustment module in this invention.
[0021] Figure 7 This is a partial code interface diagram of the digital gain adjustment module in this invention.
[0022] Figure 8 This is a partial code interface diagram of the zero-crossing detection module in this invention.
[0023] Figure 9 This is a partial code interface diagram of the gradual-in / gradual-out module in this invention.
[0024] Figure 10 The circuit for the audio signal input / output interface in this invention. Figure 1 .
[0025] Figure 11 The circuit for the audio signal input / output interface in this invention. Figure 2 . Detailed Implementation
[0026] The present invention will be further described in detail below with reference to the embodiments.
[0027] A smooth digital gain control method, such as Figure 4 It includes an analog switching gain adjustment module, a digital gain adjustment module, a zero-crossing detection module, a gradual-out control module, a central control unit, and an audio signal input / output interface. Analog switch gain adjustment module: used to achieve analog coarse adjustment. It has multiple sets of precision analog switches (such as CMOS analog switch chips) and voltage divider resistor network. The central control unit sends control signals to the analog switches of the gain adjustment module through I / O pins. By selecting different resistor combination paths, the gain coarse adjustment from 0 to 66dB can be achieved, and each step is fixed at 6dB. The specific ranges include 0dB, 6dB, 12dB, ..., 66dB, a total of 12 coarse adjustment ranges. Digital gain adjustment module: used to achieve fine digital adjustment, using FPGA to fine adjust the gain of digital audio signals from 0 to 6dB, with an adjustment step accuracy of up to 0.1dB, supporting 60 fine adjustment levels from 0.1dB to 6.0dB; Zero-crossing detection module: The FPGA checks each digital audio sample in real time. When a digital audio sample value of 0 or a change in sign bit is detected, a zero-crossing signal is output. The progressive gain control module: The FPGA implements progressive gain control through algorithms. When it is necessary to adjust from the current gain value to the target gain value, the progressive gain control module will break down the total gain change into multiple small gain steps (the step value is consistent with the fine-tuning step of the digital gain adjustment module, i.e., 0.1dB), and control the execution interval of each small step to ensure a smooth transition of gain change. Central control unit: It adopts a field-programmable gate array (FPGA) to implement the functions of zero-crossing detection module, gradual-in and gradual-out control module, and digital gain adjustment module, and controls the analog switch gain adjustment module through I / O; Audio signal input / output interface: As the transmission channel for audio signals, the audio signal input interface receives external audio signals and transmits them to the analog switch gain adjustment module for analog coarse adjustment. Then, the audio signal is transmitted to the FPGA for digital fine adjustment via the ADC. Finally, the audio signal is transmitted to the subsequent audio processing unit (such as amplifier, speaker, etc.) via the audio signal output interface.
[0028] like Figure 5 The analog switch gain adjustment module includes operational amplifiers U53A, U53B, U51A, and U51D. The signal input terminal CH3_IN_P (positive phase level signal input) is connected to pin 3 of operational amplifier U53A. Pin 2 of operational amplifier U53A is connected to pin 1 via capacitor C241. Pin 1 of operational amplifier U53A is connected sequentially to resistors R411 to R414. Pin 2 of operational amplifier U53A serves as the signal terminal CH3_PI_RES_IN (MCU control level). The ends of resistors R411 to R414 are connected to CH3... _PI_RES_IN all contribute to signal amplification, with the following values: 1.01x / 0.10dB, 6.33x / 16.03dB, 39.45x / 31.92dB, and 252.82x / 48.05dB, respectively; the corresponding gains are 0dB, 16dB, 32dB, and 48dB.
[0029] The signal input terminal CH3_IN_N (the negative phase level signal of the signal input) is connected to pin 5 of operational amplifier U53B. Pin 6 of operational amplifier U53B is connected to pin 7 of operational amplifier U53B through capacitor C246. Pin 7 of operational amplifier U53B is connected to resistors R431 to R434 in sequence. Pin 6 of operational amplifier U53B serves as the signal terminal CH3_NI_RES_IN (the control level of the MCU). The ends of resistors R431 to R434, together with CH3_NI_RES_IN, amplify the signal to 1.01 times / 0.10dB, 6.33 times / 16.03dB, 39.45 times / 31.92dB, and 252.82 times / 48.05dB, respectively, resulting in gains of 0dB, 16dB, 32dB, and 48dB.
[0030] The end of resistor R434 is connected to the end of resistor R414 in sequence through polarized capacitor E53 and resistor R426. Pin 1 of operational amplifier U53A (CH3_IN_1_P, the positive phase level signal of the MCU) is also connected to resistors R447 to R451 in sequence. The end of resistor R451 is connected to pin 14 of operational amplifier U51D. Pin 14 of operational amplifier U51D is connected to pin 12 of operational amplifier U51D through capacitor C258. Pin 12 of operational amplifier U51D, together with the ends of resistors R447 to R450, amplifies the signal by 4.01 times / 12.06dB, 2.52 times / 8.03dB, 1.59 times / 4.02dB, and 1.00 times / 0.04dB, respectively, resulting in gains of 12dB, 8dB, 4dB, and 0dB.
[0031] Pin 7 of operational amplifier U53B (CH3 _IN_1_N, the negative phase level signal of the MCU) is also connected to resistors R438 to R442 in sequence. The end of resistor R442 is connected to pin 15 of operational amplifier U51A. Pin 15 of operational amplifier U51A is connected to pin 1 of operational amplifier U51A through capacitor C251. Pin 1 of operational amplifier U51A and the ends of resistors R438 to R441 all constitute signal amplification, which are 4.01 times / 12.06dB, 2.52 times / 8.03dB, 1.59 times / 4.02dB, and 1.00 times / 0.04dB respectively; the corresponding gains are 12dB, 8dB, 4dB, and 0dB.
[0032] Pin 2 of operational amplifier U51A and pin 11 of operational amplifier U51D are both connected to GND. Pin 15 of operational amplifier U51A and pin 14 of operational amplifier U51D are both used as signal output terminals MICPREOUT_P_3 and MICPREOUT_M_3, which are the final outputs after analog signal gain. They will then be connected to an ADC chip for analog-to-digital conversion. After the ADC analog-to-digital conversion, the signal is transmitted to the FPGA through the I2S interface.
[0033] Resistors R416 and R424 are connected between pin 3 of operational amplifier U53A and pin 5 of operational amplifier U53B. Resistors R416 and R424 are connected to GND.
[0034] When the FPGA receives an external gain adjustment command (such as a command sent by the user via a device button or a host computer), it calculates the "analog coarse adjustment level + digital fine adjustment value" corresponding to the target gain. After receiving the zero-crossing trigger signal from the zero-crossing detection module, it controls the gradual-in and gradual-out control module to perform the gain adjustment action, and controls the analog switch gain adjustment module through IO according to the current actual gain value.
[0035] The step size of the analog switch gain adjustment module is fixed at 6dB, with specific levels including 0dB, 6dB, 12dB, ..., 66dB, for a total of 12 coarse adjustment levels; The digital gain adjustment module supports 60 fine-tuning levels: 0.1dB, 0.2dB, ..., 6.0dB.
[0036] The gain step value in the gradual-in / gradual-out control module is consistent with the fine-tuning step of the digital gain adjustment module, which is 0.1dB.
[0037] Meanwhile, this invention also discloses a smooth digital gain control method, utilizing the aforementioned device, the specific process of which is as follows: S1. Gain adjustment command trigger: The user sends a target gain value command (range 0~66dB) through the buttons, knobs or host computer software of the audio device, and the command is received by the central control unit. S2. Target Gain Decomposition: The central control unit decomposes the target gain value into "analog coarse adjustment gain" and "digital fine adjustment gain" according to a preset algorithm. The analog coarse adjustment gain is an integer multiple of 6dB, with a value range of 0~66dB (e.g., when the target gain is 25.3dB, the analog coarse adjustment gain is determined to be 24dB, and the digital fine adjustment gain is calculated to be 1.3dB). S3, Zero Crossing Detection Waiting: The central control unit sends a detection enable signal to the zero crossing detection module. The zero crossing detection module starts to detect the input audio signal in real time. When the audio signal is detected to be at the zero crossing point, it feeds back the zero crossing trigger signal to the gradual exit control module. S4. Calculate the next gain value: When the gradual-in and gradual-out control module receives the zero-crossing trigger signal, it calculates the next gain value (e.g., if the current gain value is 25.3dB and the target gain value is 30.0dB, then the next gain value should be 25.4dB. The next gain value is updated for each zero-crossing signal, increasing / decreasing by 0.1dB each time, until it matches the target gain value). S5. Gain Adjustment Execution: Based on the next gain value output by the progressive-to-exit control module, control the analog switch gain adjustment module via IO to switch it to the decomposed analog coarse adjustment gain level (if the next gain value is 25.4, then the analog gain should be 24dB), completing the coarse adjustment action; send a digital fine adjustment command to the digital gain adjustment module to adjust the digital gain (if the next gain value is 25.4, then the digital gain should be 1.4dB).
[0038] In S2, when the target gain is 25.3dB, the analog coarse adjustment gain is determined to be 24dB, and the digital fine adjustment gain is calculated to be 1.3dB.
[0039] Regarding selection or design: The central control unit uses an Anlubit FPGA, model PH1A60GEG324. The digital gain adjustment module, zero-crossing detection module, and gradual-out module are all implemented internally within the FPGA. Figures 7-9 This is a partial code implementation for the corresponding module. Audio signal input / output interface: see... Figures 10-11 .
[0040] Figure 5 In this module, the analog switch gain adjustment module needs to be integrated with a feedback loop located close to the chip. This feedback loop uses the SGM4519 chip. The specific SGM4519 gain is as follows: Figure 6 .
[0041] Regarding FPGA, FPGA (Field-Programmable Gate Array) is a product of further development based on programmable devices such as PAL, GAL, and CPLD. It emerged as a semi-custom circuit in the field of Application-Specific Integrated Circuits (ASIC), solving the shortcomings of custom circuits while overcoming the limitation of the limited gate count of original programmable devices.
[0042] Figure 1 This diagram illustrates a waveform abrupt change when the gain is adjusted, without the addition of zero-crossing detection and gradual fade-in / fade-out mechanisms. Figure 2 , Figure 3 This diagram illustrates that after adding zero-crossing detection and a gradual fade-in / fade-out mechanism, the sine wave only changes in amplitude without any abrupt waveform changes.
[0043] exist Figure 4 As can be seen, analog audio input signals from microphones and other devices are input to the analog switch gain adjustment module, where they are converted into digital signals by an ADC. The resulting raw digital signal is then output digitally via the audio signal output interface after passing through the digital gain adjustment module. This digital output is then transmitted via USB AUDIO to the USB interface of a computer or iPad, or via an I2S, ADAT, or S / PDIF DAC to transmit the analog signal back to the headphones. Simultaneously, after passing through the zero-detection module and the gradual-out control module, the signal is fed back to the analog switch gain adjustment module via analog switch control I / O. During this process, the gain value is controlled via an encoder / button / host computer to control the gradual-out control module.
[0044] As can be seen, the coordinated adjustment scheme of analog switch and digital gain achieves coarse adjustment in steps of 0~66dB and 6dB through analog switch, and fine adjustment in steps of 0~6dB and 0.1dB through digital gain adjustment. The two work together to overcome the limitations of a single adjustment method and achieve the dual requirements of a wide gain range of 0~66dB and high precision of 0.1dB. The combined control mechanism of zero-crossing detection and gradual-out: Before gain adjustment, the zero-crossing point of the audio signal is captured by the zero-crossing detection module to ensure that the gain change action is initiated at the zero-crossing point; at the same time, the gradual-out module breaks down the total gain change into small steps of 0.1dB and executes them step by step to avoid sudden gain changes. Gain decomposition and synchronization control algorithm of the central control unit: The algorithm built into the central control unit can automatically decompose any target gain value (0~66dB) into "analog coarse adjustment range + digital fine adjustment value", and synchronously control the working sequence of analog switches, digital gain modules and zero-crossing / progressive modules to ensure coordinated operation of each module and improve the accuracy and efficiency of gain adjustment.
Claims
1. A smooth digital gain control device, characterized in that: Includes an analog switching gain adjustment module, a digital gain adjustment module, a zero-crossing detection module, a gradual-out control module, a central control unit, and audio signal input / output interfaces. Analog switch gain adjustment module: used to achieve analog coarse adjustment. It has multiple sets of precision analog switches and voltage divider resistor network. The central control unit sends control signals to the analog switches of the gain adjustment module through I / O pins. By selecting different resistor combination paths, the gain coarse adjustment of 0~66dB can be achieved. Digital gain adjustment module: used to achieve fine digital adjustment, using FPGA to finely adjust the gain of digital audio signals from 0 to 6dB, with an adjustment step accuracy of up to 0.1dB; Zero-crossing detection module: The FPGA checks each digital audio sample in real time. When a digital audio sample value of 0 or a change in sign bit is detected, a zero-crossing signal is output. The progressive gain control module: The FPGA implements progressive control of gain change through algorithms. When it is necessary to adjust from the current gain value to the target gain value, the progressive gain control module will break down the total gain change into multiple small gain steps and control the execution interval of each small step to ensure a smooth transition of gain change. Central control unit: Employs a field-programmable gate array to implement the functions of zero-crossing detection module, gradual-in / gradual-out control module, and digital gain adjustment module, and controls the analog switch gain adjustment module through I / O; Audio signal input / output interface: As the transmission channel for audio signals, the audio signal input interface receives external audio signals and transmits them to the analog switch gain adjustment module for analog coarse adjustment. Then, the audio signal is transmitted to the FPGA for digital fine adjustment via the ADC, and finally transmitted to the subsequent audio processing unit via the audio signal output interface.
2. The smooth digital gain control device according to claim 1, characterized in that: The analog switch gain adjustment module includes operational amplifiers U53A, U53B, U51A, and U51D. The signal input terminal CH3_IN_P is connected to pin 3 of operational amplifier U53A. Pin 2 of operational amplifier U53A is connected to pin 1 of operational amplifier U53A via capacitor C241. Pin 1 of operational amplifier U53A is connected sequentially to resistors R411 to R414. Pin 2 of operational amplifier U53A serves as the signal terminal CH3_PI_RES_IN. The ends of resistors R411 to R414, along with CH3_PI_RES_IN, amplify the signal to: 1.01 times / 0.10dB, 6.33 times / 16.03dB, 39.45 times / 31.92dB, and 252.82 times / 48.05dB, respectively. The signal input terminal CH3_IN_N is connected to pin 5 of operational amplifier U53B. Pin 6 of operational amplifier U53B is connected to pin 7 of operational amplifier U53B through capacitor C246. Pin 7 of operational amplifier U53B is connected to resistors R431 to R434 in sequence. Pin 6 of operational amplifier U53B serves as the signal terminal CH3_NI_RES_IN. The ends of resistors R431 to R434, together with CH3_NI_RES_IN, amplify the signal by 1.01 times / 0.10dB, 6.33 times / 16.03dB, 39.45 times / 31.92dB, and 252.82 times / 48.05dB, respectively. The end of resistor R434 is connected to the end of resistor R414 in sequence through polarized capacitor E53 and resistor R426. Pin 1 of operational amplifier U53A is connected in sequence to resistors R447 to R451. The end of resistor R451 is connected to pin 14 of operational amplifier U51D. Pin 14 of operational amplifier U51D is connected to pin 12 of operational amplifier U51D through capacitor C258. Pin 12 of operational amplifier U51D, together with the ends of resistors R447 to R450, constitutes signal amplification, which are 4.01 times / 12.06dB, 2.52 times / 8.03dB, 1.59 times / 4.02dB, and 1.00 times / 0.04dB, respectively. Pin 7 of operational amplifier U53B is connected in sequence to resistors R438 to R442. The end of resistor R442 is connected to pin 15 of operational amplifier U51A. Pin 15 of operational amplifier U51A is connected to pin 1 of operational amplifier U51A through capacitor C251. Pin 1 of operational amplifier U51A and the ends of resistors R438 to R441 all constitute signal amplification, which are 4.01 times / 12.06dB, 2.52 times / 8.03dB, 1.59 times / 4.02dB, and 1.00 times / 0.04dB, respectively. Pin 2 of operational amplifier U51A and pin 11 of operational amplifier U51D are both connected to GND, and pin 15 of operational amplifier U51A and pin 14 of operational amplifier U51D are both used as signal output terminals.
3. The smooth digital gain control device according to claim 2, characterized in that: Resistors R416 and R424 are connected between pin 3 of operational amplifier U53A and pin 5 of operational amplifier U53B. Resistors R416 and R424 are connected to GND.
4. The smooth digital gain control device according to claim 3, characterized in that: When the FPGA receives an external gain adjustment command, it calculates the "analog coarse adjustment level + digital fine adjustment value" corresponding to the target gain. After receiving the zero-crossing trigger signal from the zero-crossing detection module, it controls the gradual-in and gradual-out control module to perform the gain adjustment action. Based on the current actual gain value, it controls the analog switch gain adjustment module through I / O.
5. A smooth digital gain control device according to claim 4, characterized in that: The step size of the analog switch gain adjustment module is fixed at 6dB, with specific levels including 0dB, 6dB, 12dB, ..., 66dB, for a total of 12 coarse adjustment levels; The digital gain adjustment module supports 60 fine-tuning levels: 0.1dB, 0.2dB, ..., 6.0dB.
6. A smooth digital gain control device according to claim 2, characterized in that: The gain step value in the gradual-in / gradual-out control module is consistent with the fine-tuning step of the digital gain adjustment module, which is 0.1dB.
7. A smooth digital gain control method, utilizing the apparatus according to any one of claims 1 to 6, characterized in that: The specific process is as follows: S1. Gain adjustment command trigger: The user sends a target gain value command through the buttons, knobs of the audio device or the host computer software, and the command is received by the central control unit. S2. Target Gain Decomposition: The central control unit decomposes the target gain value into "analog coarse adjustment gain" and "digital fine adjustment gain" according to a preset algorithm: the analog coarse adjustment gain is an integer multiple of 6dB, and the value range is 0~66dB. S3, Zero Crossing Detection Waiting: The central control unit sends a detection enable signal to the zero crossing detection module. The zero crossing detection module starts to detect the input audio signal in real time. When the audio signal is detected to be at the zero crossing point, it feeds back the zero crossing trigger signal to the gradual exit control module. S4. Calculate the next gain value: After the gradual-out control module receives the zero-crossing trigger signal, calculate the next gain value. S5. Gain Adjustment Execution: Based on the next gain value output by the progressive-out control module, control the analog switch gain adjustment module via IO to switch it to the decomposed analog coarse adjustment gain level to complete the coarse adjustment action; send a digital fine adjustment command to the digital gain adjustment module to adjust the digital gain.
8. The smooth digital gain control method according to claim 7, characterized in that: In S2, when the target gain is 25.3dB, the analog coarse adjustment gain is determined to be 24dB, and the digital fine adjustment gain is calculated to be 1.3dB.