Automatic gain control using ADAU1701

We are going to implement the ADAU1701 within an industrial application which contains an audio processing.

There is a need to configure an automatic gain control (AGC), but this DSP-type (ADAU1701) does not offer an AGC toolbox.

We are searching for a schematic, which will perform the AGC functionality.  

We would like to receive your support.

HAPE

  • 0
    •  Analog Employees 
    on Apr 3, 2019 6:02 PM over 1 year ago

    Hello HAPE,

    I am looking into some options for you. But first, can I ask how you want this to behave? There are limiters that will lower the gain if the audio gets too loud but does nothing to the audio below the threshold. Then there are compressors that will pretty much do the same thing but with a lower ratio so it is not as severe as a limiter but is still not what I would call a true compressor.

    Then there is a true compressor that will lower the gain when the audio is above the threshold and increase the gain when it is below the threshold. Most AGC circuits in radios do this but audio engineers in pro audio often do not understand this concept. Usually you need to couple this with a gate so that the noise floor is not raised too much when there is little or no audio. This is the squelch circuits in radios. 

    So are you looking to only act on the audio that is above the threshold or act on both sides of the threshold with a band in the middle where the audio gain is unchanged? 

    Is the application mono or stereo? If it is stereo then is it true stereo signal or just two channels of independent audio?

    Thanks,

    Dave T

  • Hello Dave T,

    thank you for your response. In our application the following notes are essential:

    ad.1 the input signal is usually true stereo but within the DSP there are two audio signals beeing processed independently.

    ad. 2  some audio equipment of the user ( e.g. various and variable 2 CH audio sources) will then be connected the input of  the DSP.  The user may as well change the volume during listening to his audio.  

    ad. 3 the further signal processing within the ADAU1701 contains several blocks which are functioning as: low pass filtering, dynamic compression and modulating a 500Hz sinus signal.

    ad. 4 the desired functionality of that circuitry is generating a low pass envelope signal which will be used to modulate a 500Hz sinus signal.

    But the parameter settings within the two independent audio signals are different (e.g. different cut off frequency of the LP and different slope of the compression).  Two modulated 500Hz signals are then the DSP output and serving as an input for further electronics. This function is working properly. 

    ad. 5 the reason for the additionally desired automatic gain (AGC) control functionality is to maintain a constant output level, even when the volume of the audio input is changed.

    We would appreciate your options.

    Thanks

    HAPE

      

  • 0
    •  Analog Employees 
    on Apr 4, 2019 11:24 PM over 1 year ago in reply to info@synoptrix.com

    Hello HAPE,

    Thanks for the info. I think the first thing to try is simply a compressor limiter set to a really high ratio and the threshold set really low. So most average level signals will be compressed a good 20-30 dB. Then after this compressor you add around 20dB of gain to compensate. So if the signal goes any higher it will simply compress more and more and the level out will stay about the same. Then when the signal goes down be gained up a good 20-30 dB to try to keep the output the same and then it will eventually start going down so the noise floor when there is no signal will not go up too high. 

    This will require some adjustments to suit your needs like with the release and hold times. 

    I made some quick adjustments using music and it seemed to work well. I can adjust the input level around 20dB or more without noticeable change in the output volume. In this example project I put an input volume control in to be able to experiment with it. The only parts you need for your project is the Compressor and the volume control after it. The compressor is the RMS--> Standard Resolution --> Lower Range --> Standard Independent RMS.

    I chose this one because you can link the two inputs if desired or run them independently. Hopefully you have enough MIPS left in your project for this. Compressors take a fair amount of resources. There are some other ones that are more lean but this one I like. 

    Dave T

    ADAU1701 AGC Example.zip

  • Hello Dave,

    thank you very much for your helpful support and we really appreciated your solution path which is using a compressor in order to create an automatic gain control function.  

    We were testing now several transfer functions within that compressor as well as selecting different attack and release times. We observed that the attack and release times had to be chosen quite long in avoiding distortion artefacts and "pumping". 

    From now on we are going to insert these AGC blocks into our recent project. Our prospective practical experince will show if that AGC is working efficiently and does as well not exceed the resources of ADAU1701 and its MIPS.  

    But there again, another basic approach for designing an AGC with ADAU1701 should be examined as well. 

    We conclude that a servo control mechanism e.g. a closed loop control is required, because the amplifier circuitry must have the "kowledge" of the desired output amplitude in order to properly adjust the gain. It follows then, that an AGC requires feedback as well as a variable gain amplifier (e.g. VGA).  

    The very basic architecture for a closed loop AGC-system in principle consists of an VGA, as a next device to the audio input within the signal chain.  The VGA determines the amplitude A and adjusts the gain accordingly. The amplitude B measurement is performed by a detector block (different detector types might be used and for the purpose of enabling a proper attack and decay behavior in order to reduce the control speed e.g. RMS, envelope detector, logarithmic etc.). The output of B is then compared to a desired reference Bref.  By means of a feedback block that "error signal" will control the gain of the VGA.  

    In our application the AGC should be a feedback circuit that takes the maximum level of the modulated output signal (as a reference Bref.) and controls the gain of the input signal. 

    If you don´t mind my asking this, is it possible at all to design an AGC which is operating on a closed loop circuitry by using the tools of ADAU1701?   

    We would be glad to have your proposal for solution. 

    Many thanks

    HAPE 

     

  • 0
    •  Analog Employees 
    on Apr 8, 2019 4:00 PM over 1 year ago in reply to info@synoptrix.com

    Hello HAPE,

    You are correct that you have to set the time constants for your type of program material. I did leave that for you to do since setting something up for music can be very different if it is for voice only. Etc. Anyhow,...

    I do not have time to work up an example but what you can do is use a compressor with an external sidechain input. The rectification and time constants are still being calculated in the compressor cell so you do not have to do this outside of the compressor cell, but, if you do you can just set the internal controls so they are out of the way of the external controls. Like a slow attack and fast release. 

    Here is where you can find the cell:

    The extra pin is the sidechain input.

    Here is a quick picture of one way to do this. I set this on the output of the compressor since it seems like you desire a feedback style of compression. To do this you must use a feedback cell at some point in the sidechain to avoid a compiler error. It sets up a one sample delay. In this example I only summed the two channels and then used an external volume control to realize a threshold/compression level adjustment outside of the DSP. You can implement anything you like in this chain. You can EQ it for a De-Esser or to make it not respond to low frequencies. 

    We have peak and RMS envelope generators, log functions, comparators etc. So you should be able to do what you mentioned however, I think you will run out of MIPS.

    If you really need to develop all this outside of the compressor then Instead of using the compressor cell you may only need to use the externally controlled volume control as your gain element. It has a slew control to control the zipper noise but that will limit the speed. Again, you will have to make adjustments. 

    On the forum there are lots of example of circuits to do parts of what you describe. Others on the forum may chime in and help. It is an interesting problem but I have to take care of other deadlines at the moment. 

    Dave T