This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TLV320AIC3204: AGC configuration

Part Number: TLV320AIC3204

Hii Ti,

I am currently working on an audio project where I need to configure AGC and DRC in my application. I have gone through the available datasheets and user guides for both AGC and DRC, but I still need clarification on how the parameters are actually calculated.

Specifically, I would like to understand how to determine parameters such as AGC attack time, decay time, noise threshold, and other related settings — especially with respect to different sampling rates and real-world operating environments.

Could someone please explain how these AGC and DRC parameters should be calculated or interpreted for a given sampling rate? Any guidance or examples would be greatly appreciated.

Thanks in advance.

Regards,
N. Eswara Rao

 

  • Hi Eswararao,

    All of the time based parameters (attack, decay, debounce time) are expressed in number of samples, so the actual time unit will depend on the sample rate that you are running at. The other level based parameters can be incremented in specific steps, which you can find in the register map starting with register 81.

    Section 1.4 in the application reference guide has an example for you to start with.

    There isn't a practical way to simply calculate the parameters ahead of time and then forget about it. It has to be tuned and adjusted in the environment you expect it to be operated in. But in general,

    Attack time and decay times: represents how quickly the PGA gain will decrease or increase the PGA gain respectively to return to the target level. High time constants can maintain a strict value, but risk sounding compressed and artificial. Low constants are more organic sounding, but too low and you will hear noticeable rises and falls in the audio that could be distracting.

    Gain Hysteresis: sets a debounce for how strictly the gain is adjusted to meet the target level. Low hysteresis will be less accurate to the target level, but too high a hysteresis will create audible artifacts as the gain is constantly changing tiny amounts to meet the target level

    Noise threshold and Max gain: these act as the upper and lower bounds of the AGC. If the signal is below the noise threshold, the AGC will return the gain to 0dB. This can be set to your noise floor, or whatever you consider to be not worth amplifying. Max gain caps the AGC from applying so much gain that the signal becomes full of background noise. Set this based on the most amount of gain you expect to need to apply without adding too much noise. You might not be able to reach the target level from low levels because of how much gain would need to be added and the noise floor becomes too much of a problem.

    Low pass filter: this controls the signal envelope that the AGC will see. A more aggressive filter (lower cut off) will keep the AGC from acting sporadically due to quick changes in the audio signal, but it will take longer to respond. A looser filter will respond more quickly to changes but too much high frequency content will make the AGC adjust faster than it probably should.

    Best regards,
    Jeff McPherson

  • Thank you Jeff McPherson,

    In the datasheet, it is mentioned that the AGC attack time and decay time are calculated using a formula of the form:

    time = (multiplier) × (word_clock)


    Specifically, how does the word clock relate to the AGC timing parameters, and how does this formula translate into real-world time values (e.g., milliseconds)?

    Also, apart from the example calculations given in the datasheet, are there any additional formulas or explanations that can help in understanding how AGC/DRC timing parameters are derived for different sampling rates and different environments?

    Thanks in advance.

    Regards,

    N Eswara rao.

  • Hi Eswararao,

    The AGC runs in the digital domain. By definition, it can only operate in units of samples. The sample rate (i.e. WCLK) defines how frequent these samples are. The AGC time constant for attack and decay, is therefore an integer multiple of the WCLK.

    You've already found the right formula. WCLK period * multiplier = time. For example the default attack time is 32 WCLKs, so assuming a 48kHz sample rate

    (1/48kHz) * 32 = 0.66ms

    This formula is the same for all the other parameters that are referenced to WCLK. Level based parameters such as noise debounce, noise threshold, hysteresis etc. are only related to the sample rate insofar as that the measurements of the respective level can only occur at every sample. Their programed values do not depend on the sample rate. For example, your target level setting does not change with sample rate, but at a higher sample rate you would reach your target level faster.

    Best regards,
    Jeff McPherson

  • Thank you Jeff McPherson,

    I am reviewing the AGC attack-time calculation from the datasheet.
    For a 44.1 kHz sampling rate, the base attack time is calculated as:

          (3*32)/44100 = 2.1msec

    The datasheet example, however, shows an attack time of around 20 ms.
    My understanding is that this difference comes from the attack-time scaling factor.

    According to the datasheet, when the scaling factor is set to 1, it represents a 10× multiplier applied to the base time.
    So:

      2.1 * 10 = 21msec.

    which matches the ~20 ms example.

    So to confirm:

    • The raw formula gives ~2.1 ms

    • A scaling factor of 1 multiplies the base attack time by 10× or 1×

    • This results in the final ~20 ms attack time

    And same for all the parameters like decay time, debounce time , .., of all AGC parameters.

    Please let me know if this interpretation is correct or if there is any additional scaling detail I should be aware of.


  • Hi Eswararao,

    Your understanding is correct, the scaling factors just act as an additional multiplier to get into the ms range rather than us.

    Best regards,
    Jeff McPherson