The audio receiving device is already an indispensable tool in daily life, learning, and work. However, for some reasons, such as switching channels, playing advertisements, etc., the volume of the signal will be different when the signal is output, which seriously affects the user. Listening effect. The main reason for this large difference in volume is that the amplitude of the audio signal input is inconsistent. The solution is to perform gain control.
The earliest gain control is analog circuit detection control, but the analog circuit design is relatively cumbersome, and it is difficult to achieve a wide range of gain control. Therefore, with the development of digital signal processing devices (DSP), the use of DSP for gain control has become mainstream. At first, the general method of digital device processing is that the large signal reduces the gain and the small signal does not. There are also methods for amplifying small signals, but since the gain adjustment is too large without signal input, the background noise is also increased, so the gain adjustment range is not large and the ideal control effect cannot be achieved. In addition, the input signal is basically detected, that is, feedforward control, the output signal is not detected, so if the gain is large when inputting, the output will be limited, affecting the listening effect. And the cost of the DSP solution is relatively high. This scheme uses a low-cost single-chip microcomputer as the processing core, and completes the gain automatic control through a simple gain control algorithm.
System hardware design <br> As shown in Figure 1, the whole system is designed with the audio signal acquisition and processing as the core. The audio signal input and output terminals on both sides of the audio control chip PGA2311 are sent to the A/D port of the MSP430F149 for sampling after being level-shifted by the amplifier TL084 (the signal input/output terminals are all detected to solve the problem that there is no signal at the input end). Whether the gain is adjusted or not, and avoiding excessive gain causes the output limit to occur). The sampled data is processed by a software algorithm to obtain a gain value, which is configured by the level converter 74HC245 to the PGA2311. The buttons and the digital tube complete the setting and display of the output level threshold range.
Main control circuit <br> The main control chip MSP430F149 is a 16-bit, 48 8-bit parallel I/O port with a reduced instruction set and ultra-low power consumption (minimum 0.1Î¼A in power-saving mode). The addressing space is 64 KB and the RAM is 2 KB, which brings great convenience to system development. It has a 12-bit A/D converter ADC12, sample and hold, and analog multiplexer. The ADC12 features high speed, versatile features that enable A/D conversion of eight external analog sources and four internal reference sources, including internal temperature sensor sources. The ADC12 also offers a variety of sample trigger modes, conversion clock cycles, and conversion mode options.
The PGA2311 is a two-channel, programmable gain amplifier that interacts with the MSP430F149 via the SPI bus with a gain range of +31.5 to -95.5 dB.
The MSP430F149 in Figure 1 is powered by 3.3 V, while the PGA231l is a Â±5 V-powered CMOS device. Therefore, care should be taken when matching the I/O logic levels to achieve level matching with the level shifter 74HC245 when driving the PGA2311.
Level shifting circuit <br> Since the general audio output device has different volume and is AC-coupled, the A/D sampling voltage range of the MSP430F149 is 0-2.5 V, in order to avoid matching the sampled signal with A/D. Clipping distortion requires scaling (or reducing) the input signal and moving the center voltage to around 1.25 V. as shown in picture 2.
Software Design <br> The software design includes key display, peripheral control, and audio signal processing. The focus is on the AGC algorithm for audio signal processing. The button display responds to the user setting the output volume level and displays it. The peripheral control is mainly to configure the PGA2311.
The core of the AGC algorithm AGC algorithm is to judge whether the dynamic range of the signal exceeds the set size by the envelope information of the signal. Here, it is necessary to quickly track the change of the envelope and perform gain control in time.
In the conventional AGC algorithm, the multiplication and division operation has a large occupation of CPU resources. The AGC algorithm proposed here is relatively simple and practical. The specific implementation process: from the A / D port of the microcontroller, the level of the audio input / output signal is stored in an array. The array stores the data to meet the threshold comparison requirements and enters the peak comparison process. According to the stored input signal data, the algorithm of bubble sorting is used to find the maximum amplitude, and it is judged whether there is a signal at the input end. If it is determined that there is no audio signal input, the gain is not adjusted to prevent the gain from being increased due to the output signal being too small, the noise is too large, or once the sound is present, the short-time output sound is too large due to the excessive gain. If there is a signal at the input, the output is detected. The bubble sorting program is also called to find the maximum amplitude. If the output signal exceeds the set threshold, the gain is reduced, otherwise the gain is increased. When the gain is reduced, the step is larger, and the step is smaller when the gain is increased, so that the volume outputted during the gain adjustment makes the user feel uncomfortable.
Experimental Argument <br> Experimental demonstration for verifying the correctness of the design. Set the output level range, input the abrupt audio signal from the computer, and observe the output through the oscilloscope, as shown in Figure 4.
From the sudden change in volume indicated by the box in Figure 4, it can be seen that after the input volume suddenly increases, the gain is turned down within 500 ms, and the volume output is kept output within the set range. Experiments such as treble mutant bass are not illustrated here because the adjustment period is long.
Conclusion <br> The experimental results show that the design gain control is timely and accurate, keeps the output signal level stable output in the set range, and low power consumption, simple to implement, and highly portable, which can meet the current user's audio receiving device volume. Output requirements.
Air Filter: Prevents harmful debris, dirt and contaminants from entering your engine.
Engine protection is the name of the game.So is engine performance. Acceleration can improve up to after an old, dirty air filter is replaced. Our Pennzoil air filters are engineered to trap harmful contaminants that can damage your engine.
Old and dirty air filters lead to reduced engine power, decreased throttle response, weaker acceleration and increased engine wear. Sounds ugly. Well, it is, and you should have it replaced when it gets bad.
Automotive Air Filter,Car Air Filter,Air Filter Cartridge
Donguan Bronco Filter Co., Ltd , https://www.broncofilter-cn.com