Fast AGC algorithm suitable for audio noise reduction

Through the fast AGC algorithm to optimize signal gain control, the problem of slow noise amplification and response time in AGC technology is solved, and the signal processing effect of faster response and lower noise interference is achieved.

CN120301375APending Publication Date: 2025-07-11NANJING UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410039531.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-10
Publication Date
2025-07-11

Smart Images

  • Figure CN120301375A_ABST
    Figure CN120301375A_ABST
Patent Text Reader

Abstract

The invention provides a rapid AGC algorithm suitable for audio noise reduction, and the algorithm comprises a signal preprocessing module which is used for converting an input signal into the amplitude of the input signal; the averaging module is used for averaging the amplitudes of the input signals according to the amplitudes of the input signals to obtain an average value of the signal amplitudes; according to the average value of the signal amplitudes, the output amplitude average value is compared with the amplitude before Mms, and different output states are selected according to comparison with the amplitude; according to the output state, different calculation methods for changing the gain coefficient are selected, and then the current gain coefficient is output according to the different calculation methods; according to an output gain coefficient, the amplitude of an input signal is in a proper range, noise can be effectively suppressed, a signal with a high dynamic range is processed, and a stable output signal is provided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of audio signal processing, and particularly provides a fast automatic gain control technology suitable for audio noise reduction. Background Art

[0002] Automatic Gain Control (AGC) is a signal processing technology used to automatically adjust the gain of a signal during signal transmission or reception to keep the signal within an appropriate amplitude range. AGC is commonly used in fields such as wireless communication, audio processing, and image processing.

[0003] The main function of AGC is to maintain signal stability in the case of large signal strength variations. It dynamically adjusts the gain of the signal, attenuating strong signals to an appropriate level while amplifying weak signals to a reliable reception level. The benefits of this are to avoid distortion problems caused by strong signal overload and to improve the reception sensitivity to weak signals. The working principle of AGC generally consists of two stages: a detection stage and a gain control stage. In the detection stage, AGC monitors the input signal to determine the signal strength. In the gain control stage, AGC automatically adjusts the gain of the signal to achieve dynamic range control. The application of AGC is very extensive. In wireless communication, AGC can automatically adjust the gain of the receiver according to the received signal strength to adapt to signal transmission under different distances and interference conditions. In audio processing, AGC can balance the loudness of sound so that different audio sounds have a consistent volume during playback. In image processing, AGC can enhance the contrast of an image, making the details of the image more clearly visible. In short, automatic gain control is an important signal processing technology that can improve the quality and reliability of signals and is applicable to various fields and application scenarios.

[0004] Generally speaking, the operation of AGC usually involves signal amplification, which may cause the noise in the signal to be amplified as well, thus affecting signal quality. When designing AGC, it is necessary to balance signal gain and noise level to ensure the best balance of signal quality. At the same time, the signal processing by the AGC system may introduce a certain time delay, which may be a problem for some real-time applications. In addition, the response time of AGC is also an important consideration factor, that is, the ability of AGC to quickly adapt to signal changes. How to reduce the interference caused by noise and reduce the response time is one of the important technical issues in this field. Summary of the Invention

[0005] The present invention relates to a fast AGC algorithm suitable for audio noise reduction, aiming to solve some problems existing in current AGC technologies. The system provides more efficient and accurate signal gain control to adapt to different input signal intensities, and offers better anti-interference ability and shorter response time.

[0006] The object of the present invention is to provide a fast AGC algorithm suitable for audio noise reduction. The fast AGC algorithm suitable for audio noise reduction includes: a data processing module for squaring and summing the I and Q signals of the input signal to convert the input signal into the corresponding amplitude; a sliding window module for taking the average value of the input data to optimize the final gain control. By adjusting and smoothing these mutated signals, it can better process and control various types of signal intensities, thereby achieving finer and more accurate gain control; a state selection module for judging the current state of the signal for subsequent gain calculation to reduce the noise between audio signals and improve the reception quality of the signal; a gain coefficient control module for selecting different calculation methods for changing the gain coefficient for different states to achieve the output being stable at the target threshold. This invention combines the following main features: 1) Response time optimization: Compared with traditional AGC systems, the present invention adopts an innovative adaptive gain control algorithm that can judge the state of the current signal according to the intensity of the input signal, and then dynamically change and automatically adjust the gain level. Based on real-time signal analysis and processing, this algorithm can quickly respond to signal changes and adjust the gain in real time as needed to ensure the stability and quality of the output signal. 2) Interference suppression; Compared with traditional AGC systems, the present invention takes measures for interference suppression and signal optimization. By judging the state of the input signal and then adopting different signal processing techniques, we can improve the signal quality and reduce the noise level in the signal. This feature can reduce the influence of noise introduction during signal amplification, thereby providing a clearer and more accurate output signal.

[0007] Description of the Drawings

[0008] Figure 1 Is the implementation block diagram of the AGC algorithm

[0009] Figure 2 Is the flowchart of the AGC algorithm

[0010] Figure 3 Is the FPGA implementation effect diagram when the input signal changes from small to large

[0011] Figure 4 Is the FPGA implementation effect diagram when the input signal changes from large to small and attenuates by 20 dB

[0012] Figure 5 ​FPGA implementation effect diagram where the input signal decreases from large to small and attenuates by 40 dB

[0013] Figure 6 FPGA implementation effect diagram where the input signal decreases from large to small and attenuates by 60 dB

[0014] Figure 7 FPGA implementation effect diagram where the input signal decreases from large to small and attenuates by less than 20 dB

[0015] Figure 8 FPGA implementation effect diagram where the input signal decreases from large to small and rapidly attenuates by 20 dB within the hold time

[0016] Figure 9 FPGA implementation effect diagram where the input signal decreases from large to small and rapidly attenuates by less than 20 dB within the hold time

[0017] Figure 10 FPGA implementation effect diagram where the input signal decreases from large to small and then increases, and the second large signal appears within the hold time

[0018] Figure 11 FPGA implementation effect diagram where the input signal decreases from large to small and then increases, and the second large signal appears within the release time

[0019] Figure 12 FPGA implementation effect diagram where a large noise signal appears within the hold / release time

[0020] Figure 13 Diagram of the corresponding relationship between the hold time and the release time Detailed implementation method

[0021] The automatic gain control module processes the two-channel signals of the external input I and Q, then enters the signal processing to obtain the amplitude corresponding to the input signal, and calculates the average amplitude after passing through a FIFO with a depth of 16. Then, different algorithms are selected according to the change of the amplitude to calculate the gain coefficient, and finally the calculated gain coefficient is multiplied by the input signal to obtain the final stable signal. The implementation block diagram is as Figure 1 shown

[0022] Figure 1 In the signal processing, the output I and Q signals are and then the corresponding amplitude is obtained. Calculating the average amplitude is to store the input amplitude into a FIFO with a depth of 16, and use the first-in-first-out characteristic of the FIFO to calculate the average amplitude of 16 input amplitudes. Each time a data is input into the FIFO, the average value of the 16 data in the FIFO is recalculated

[0023] Figure 1The medium gain coefficient calculation part mainly adjusts the gain coefficient based on the difference between the current amplitude and the target threshold, and selects different calculation methods by comparing whether the average amplitude decays or increases compared to the previous amplitude. When the average amplitude increases compared to the previous amplitude, the Newton iteration algorithm is used to quickly adjust the gain coefficient to make the output signal stable. When the average amplitude decays compared to the previous amplitude, the slow gain adjustment algorithm is used to adjust the gain coefficient to make the output signal stable. The above two adjustment algorithms both control the current amplitude to approach the target threshold by adjusting the gain coefficient. The specific implementation is as follows:

[0024] Newton iteration algorithm:

[0025]

[0026] a k represents the current gain, p0 represents the target threshold, and p0(k) represents the current amplitude.

[0027] When using this algorithm, first calculate the difference between the current amplitude and the target threshold, and then select the corresponding formula for calculation according to the difference until the difference between the current amplitude and the target threshold is no greater than 1 / 64 of the target threshold, and the gain coefficient remains unchanged. At this time, the output signal reaches a stable value.

[0028] Slow gain adjustment algorithm:

[0029] a k+1 = a k +(P0 / P0(k)) / n0(0.2)

[0030] where a k is the current gain coefficient, P0 is the target threshold, P0(k) is the current amplitude, and n0 is the number of effective data points corresponding to the release time at a sampling rate of 12K. For example, if the release time is 300ms, the corresponding number of points is 3600.

[0031] When using this algorithm, first determine the corresponding release time based on the decay amount of the average amplitude compared to the previous amplitude and calculate the corresponding number of effective data points, then calculate the quotient between the target threshold and the current amplitude, and further obtain the value by which the gain coefficient increases for each effective data point, so as to achieve the stable value of the output signal within the corresponding release time.

[0032] Figure 2 In the adaptive mode, the Newton iteration method is used for gain adjustment. In the release mode, the slow gain adjustment algorithm is used for gain adjustment.

[0033] The algorithm process is mainly summarized as follows: when the average amplitude changes from a small signal to a large signal, the Newton iteration method is used for fast response, and when the difference between the amplitude and the target threshold is less than 1 / 64 of the target threshold, the response stops. When the average amplitude changes from a large signal to a small signal, different hold times and release times are first determined according to the attenuation amount. After the hold time, the release time is entered, and during the release time, the gain slow adjustment method is used. During the process, the gain coefficient G increases until the output is stable within the release time. When the input signal changes during the hold time and the release time, the gain coefficient algorithm is changed according to the difference between the amplitude of the input signal and the target threshold, that is, when the current amplitude is greater than 1.5 times the target threshold during the hold time or the release time, the Newton iteration method is used for fast response, and when the current amplitude is not greater than 1.5 times the target threshold during the hold time or the release time, the original state is maintained. The signal input is mainly divided into the following situations: ① The noise signal becomes a large signal. ② The small signal becomes a large signal. ③ The large signal becomes a small signal. ④ The signal changes from large to small, and there is a rapid amplitude attenuation of 20 dB during the hold time. ⑤ The signal changes from large to small, and there is a slow amplitude attenuation during the hold time. ⑥ The large signal becomes a noise signal. ⑦ The large signal becomes a small signal and then becomes a large signal (the second large signal appears during the hold time). ⑧ The large signal becomes a small signal and then becomes a large signal (the second large signal appears during the release time). ⑨ The signal changes from large to small, and the total attenuation is less than 20 dB. ⑩ The signal changes from large to small and then becomes smaller, and the total attenuation is greater than 20 dB. Different states correspond to different modes, thereby changing the gain calculation method.

[0034] The present invention controls the amplitude of the input signal through the Modelsim software and verifies the fast AGC algorithm applicable to audio noise reduction in the Modelsim operating environment.

[0035] Figure 3 In it, I_datain represents the input signal input into the AGC system; W_ave_data represents the mean value of the input signal; O_dataout represents the signal output after being adjusted by the AGC system. The above figure describes the change timing diagram of the output signal when the input small signal becomes a large signal. It can be seen from the figure that when the small signal becomes a large signal, the output signal can respond quickly, so that the finally output signal remains stable.

[0036] When the situation is that the input signal changes from a large signal to a small signal, it mainly simulates the decrease in intonation when speaking or simulates stopping speaking. At this time, different hold times are corresponding to the attenuation degree of the input signal. Figure 4It is shown that the input signal changes from a large signal to a small signal, and the attenuation amplitude is 20 dB. It can be seen from the figure that when the large signal changes to a small signal (attenuated by 20 dB), the output signal first enters a holding time. During the holding time, the gain coefficient remains unchanged. After the holding time ends, it enters the release time. During the release time, the gain coefficient slowly increases, and finally the finally output signal is stabilized.

[0037] Figure 5 It is shown that the input signal changes from a large signal to a small signal, and the attenuation amplitude is 40 dB. It can be seen from the figure that when the large signal changes to a small signal (attenuated by 40 dB), the output signal first enters a holding time (the holding time is longer than that when attenuated by 20 dB). During the holding time, the gain coefficient remains unchanged. After the holding time ends, it enters the release time. During the release time, the gain coefficient slowly increases, and finally the finally output signal is stabilized.

[0038] Figure 6 It is shown that the input signal changes from a large signal to a small signal, and the attenuation amplitude is 60 dB. It can be seen from the figure that when the large signal changes to a small signal (attenuated by 60 dB), the output signal first enters a holding time (the holding time is longer than that when attenuated by 40 dB). During the holding time, the gain coefficient remains unchanged. After the holding time ends, it enters the release time. During the release time, the gain coefficient slowly increases, and finally the finally output signal is stabilized.

[0039] Figure 7 It is shown that the input signal changes from a large signal to a small signal, and the attenuation amplitude is less than 20 dB. It can be seen from the figure that when the large signal changes to a small signal (attenuated by less than 20 dB), the output signal does not enter the holding time and directly enters the release time. During the release time, the gain coefficient slowly increases, and finally the finally output signal is stabilized.

[0040] When the situation is that the input signal changes from large to small, and there is a rapid attenuation of 20 dB in amplitude during the holding time. Simulate the situation of continuous attenuation of intonation when speaking. At this time, the holding time will be updated again according to the total attenuation. Figure 8 It is shown that the input signal changes from large to small and attenuates again during the holding time, and the attenuation is greater than 20 dB. At this time, the holding time is determined according to the attenuation amount during the first attenuation and enters the holding time. When it attenuates again during the holding time and the attenuation amount is greater than that of the first attenuation, the holding time is updated again. Finally, after the holding time ends, it enters the release time and the output signal is stabilized during the release time. When the input signal changes from large to small and there is attenuation during the holding time but the attenuation amount does not exceed 20 dB, the timing diagram is as follows.

[0041] Figure 9It is shown in [X] that when the input signal decreases from a large value and further attenuates within the hold time with the attenuation being less than 20 dB, the hold time is determined based on the attenuation amount during the first attenuation and then enters the hold time. When it attenuates again within the hold time and the attenuation amount is less than that of the first attenuation, the original hold time is maintained. Finally, after the hold time ends, it enters the release time and the output signal stabilizes within the release time.

[0042] When the situation is that the input signal decreases from a large value and then increases, this simulates the situation of speaking again after a pause during speaking. In this case, the hold time will directly end and enter the adaptive adjustment state. Figure 10 It is shown in [X] that the input signal changes from a large signal to a small signal and then becomes a large signal again, and the second large signal appears within the hold time. When the second large signal appears, the hold time is immediately stopped and it directly enters the gain adaptive adjustment mode to quickly adjust the gain coefficient so that the output signal reaches the threshold.

[0043] Figure 11 It is shown in [X] that the input signal changes from a large signal to a small signal and then becomes a large signal again, and the second large signal appears within the release time. When the second large signal appears, the release time is immediately stopped and it directly enters the gain adaptive adjustment mode to quickly adjust the gain coefficient so that the output signal reaches the threshold.

[0044] In addition, there are several special situations, that is, a large-amplitude noise signal appears within the hold time or the release time. In this case, the original hold time or release time should be maintained, ignoring the large noise signal in the middle to maintain the signal stability and avoid distortion. Figure 12 For the input signal that changes from a large signal to a small signal and a large noise signal appears within the hold time or the release time, this noise signal should be ignored and the original hold time state or release time state should be maintained. It still enters the release time after the hold time ends, and finally the output is adaptively adjusted to the threshold state for stable output. As can be seen from the above figure, when the signal amplitude increases from small to large, the output amplitude can be quickly adjusted to the threshold, and when the signal amplitude decreases from large to small, different hold times and release times correspond to different attenuation amounts. Figure 13 They are the specific hold time and release time.

[0045] The beneficial effects of the present invention are as follows. By using algorithms for real-time signal analysis and processing, it is possible to quickly determine the current signal state based on the input signal strength and dynamically adjust the gain level. This technology can rapidly respond to signal changes and adjust the gain in real time as needed to ensure the stability and high quality of the output signal. Measures for interference suppression and signal optimization are taken. By adopting different signal processing techniques according to the state of the input signal, the signal quality is improved and the noise level is reduced. This method reduces the influence of noise during signal amplification, thereby providing a clearer and more accurate output signal. In this way, we can better optimize the signal and effectively eliminate interference, resulting in a significant improvement in the final signal quality.

Claims

1. A fast AGC algorithm applicable to audio noise reduction, characterized in that the fast AGC algorithm applicable to audio noise reduction includes: Step 1: The signal preprocessing module is used to convert the externally input signal into the amplitude of the input signal; Step 2: The sliding window calculation module is used to perform an average operation on the input signal amplitude obtained in Step 1 to obtain the average value of the signal amplitude; Step 3: The state selection module compares the average value output by Step 2 with the amplitude before Mms, and selects the corresponding output state according to the amplitude difference; Step 4: The gain coefficient calculation module selects different calculation methods for changing the gain coefficient through different states output by Step 3, and then outputs the current gain coefficient according to different calculation methods; Step 5: Perform a multiplication operation on the gain coefficient received in Step 4 and the input signal to calculate the signal after gain. Step 6: Determine whether the signal after gain is within the threshold range. If it holds, output the signal; otherwise, maintain the original state and execute Step 4.

2. The fast AGC algorithm applicable to audio noise reduction according to claim 1, wherein In Step 1, the data preprocessing module converts the input signal into the amplitude of the input signal, specifically including: The input signal is divided into two I / Q signals, and the two I / Q signals are processed through the calculation formula I 2 +Q 2 . After squaring them respectively and then performing a summation operation, finally, a operation is performed to take the square root of the result to obtain the amplitude of the input signal.

3. The fast AGC algorithm applicable to audio noise reduction according to claim 1, characterized in that, The sliding window module in Step 2 caches the amplitude of the input signal of the preprocessing module, and calculates the average every time N data are input to output the current average amplitude.

4. The fast AGC algorithm applicable to audio noise reduction according to claim 1, wherein In Step 3, the state selection module compares the average amplitude input by the sliding window module with the amplitude before Mms, and selects different output states according to the comparison with the amplitude, specifically including: Compare the input average amplitude with the amplitude before Mms. When the input average amplitude decays more than NdB compared to the amplitude before Mms, enter the hold state; when the input average amplitude decays less than NdB compared to the amplitude before Mms, enter the adaptive state; and when the hold state ends, enter the release state. Finally, after the release state ends, re-enter the adaptive state.

5. The fast AGC algorithm applicable to audio noise reduction according to claim 1, characterized in that Step 4 outputs the gain coefficient of the corresponding signal according to the gain calculation method finally selected by the state selection module, specifically including: When the state output by Step 4 is the hold state, the gain coefficient remains unchanged at this time; when the output state is the release state, the slow gain calculation method is used for the gain calculation method at this time, and the gain coefficient at this time is calculated and output; when the output state is the adaptive state, the Newton iteration method is used for the gain calculation method at this time, and the gain coefficient at this time is calculated and output.

6. The fast AGC algorithm applicable to audio noise reduction according to claim 1, wherein Step 6 determines whether the signal after gain is within the threshold range. If it holds, output the signal; otherwise, maintain the original state and execute Step 4. Specifically including: When the signal after gain output in Step 5 is not within the threshold range, maintain the original state and return to Step 4 for recalculation of the gain. When the output signal is within the threshold range, directly output the signal.