KCC's Quizzes AQQ305 about a mutual exponentiation equation
1. Quote of the month: "A train station is where a train stops. A bus station is where a bus stops. I have a work station on my desk, so..." - unknown
2. Quiz AQQ305 about finding a mutual exponential equation
Good luck, and try to be among the
View All
October Monthly Blog Quiz! Read the blog, take the quiz, and you could win a gift card
Finding Your Circuit Chi — EMC Quiz!
Think you know EMC? Test your knowledge with our 5-question quiz!
Read the blog first, then take the challenge: Finding Your Circuit Chi
Every current flowing creates electromagnetic fields.
Strong EMC design
View All
ADRV9002
Recommended for New Designs
The ADRV9002 is a highly integrated RF transceiver that has dual-channel transmitters, dual-channel receivers, integrated synthesizers, and digital signal...
Datasheet
ADRV9002 on Analog.com
Hello,
As per the title, what exactly does apdUpperThreshPeakExceededCnt / apdLowerThreshPeakExceededCnt actually count?
Is it samples?
Is it local maxima?
Are the peaks counted on the instantaneous power of the received signal or on the on the received signal amplitude?
Thank you in advance.
K.
Hi,
I'll look into this question. The user guide section 'Analog Peak Detector (APD)' gives some details on the general function of the detector.
Regards,
Conrad
Thank you Conrad.
I have already read the APD section in the user guide, but it didn't seem very helpful with regard to my issue.
Hi,
We are writing up an explanation for the question, we will get back to you.
Regards
Rahul
Automatic Gain Control (AGC) has two modes of operation
Note: Assume the clock counter limit is 8 clock cycle.
Normal Mode:

Figure 1: Normal Mode
Figure 1 illustrates the operation of the Normal mode AGC. During the first period, when the signal's peak power exceeds the threshold, the AGC clock counter begins counting. At some point within the first period (indicated in green), the AGC clock counter exceeds the required number of clock cycles. At the end of the first period, the attenuation levels are applied, reducing the signal's power below the threshold, and simultaneously, the AGC clock counter resets.
In the second period, the signal again crosses the threshold, causing the AGC counter to start counting the clock cycles. However, before the counter exceeds the required number of cycles, the signal’s power drops below the threshold. Since the AGC counter doesn’t reach the necessary count, the attenuation is not triggered, and by the end of the second period, the AGC counter resets.
Note: The 1st and 2nd periods are the gain update period which is set by the user in TES.
Fast Attack Mode:

Figure 2: Fast Attack Mode
In this case, the key difference is when the attenuation is applied. During the first period, the signal exceeds the threshold, causing the AGC clock counter to surpass the clock cycle limit, triggering the attenuation immediately and resets the AGC counter. At the end of the first period, again AGC counter resets.
In the second period, the signal once again exceeds the threshold, and the AGC clock counter reaches 4 clock cycles before the signal falls back below the threshold. After some time within the same period, the signal power rises above the threshold again, and the AGC clock counter continues counting, now reaching 10 clock cycles. This exceeds the AGC clock counter limit, triggering the attenuation. Here the AGC clock counter resets once the attenuation is triggered to take care of the situation where signal peak power goes above the threshold again within the same period as shown in the figure 2.
Regards
Rahul
Hi and thanks for the thorough reply. Through TES I have noticed that the lowest value I can set Gain Refresh Period to is 50.5us whether I have Fast Attack option enabled or not. Is that valid, is it really 50.5us the lowest value I can set it to when I have fast attack enabled or can it go even lower? Thank you.
Hi,
In fast attack mode, the update happens whenever the signal exceeds the threshold, causing the AGC clock counter to surpass the clock cycle limit.
Regards
Rahul
Hi,
You didn’t answer my question though. I was asking about the Gain Refresh Period which you have denoted with vertical dashed lines in Figure 2. Does it go lower than 50.5us when fast attack is enabled or not?
any news on my last question?
Hi,
Yes, we have been actively working on your request. It requires careful analysis to ensure accuracy before providing our recommendation, which is why our response may take some time.
We can reduce the gain update period below 50.5µs using Python or C. The core issue lies in the Rx gain. Attenuation occurs correctly during high signal power, but the system fails to apply the corresponding gain increase when the signal returns to normal. Since attenuation is applied instantly, whereas applying gain takes time, the minimum value for the gain update period is 50.5 us.
Regards
Rahul
Hi,
So basically what you are saying is that if I am using C code I can reduce the gain update period to a value lower than 50.5us? That way would gain (recovery) be applied faster when the signal level returns to normal ? Can you please explain in the simple recovery case, i.e., no "fast recovery", how are the parameters hbUnderRangeHighThreshCount, hbOverloadThreshCount and hbOverloadDurationCount connected to one another with an example like you did with the attack scenario?
Hi,
any news yet regarding the recovery process of the AGC?
Thank you.
Hi,
We can reduce the gain update period below 50.5µs using Python or C. The core issue lies in the Rx gain. Attenuation occurs correctly during high signal power, but the system fails to apply the corresponding gain increase when the signal returns to normal. Since attenuation is applied instantly, whereas applying gain takes time, the minimum value for the gain update period is 50.5 us.
As I suggested, the minimum gain update period is 50.5us, you can set the value less than 50.5us but the issue is with the applying gain for example if you gain index is around 230 and at this time you signal power is reduced then the gain index should increment from 230 to lets say 240. This wont happen when the gain refresh period is less than 50.5us but decrementing the gain index will work.
Now coming to the parameters:
The four-parameter feedback_inner_high_inner_low ,feedback_apd_high_apd_low, feedback_apd_low_hb_low & feedback_apd_high_hb_high are the threshold counter exceed status. There are two mode one is peak only where the analog peak detector and half band peak detector are considered i.e., feedback_apd_low_hb_low & feedback_apd_high_hb_high whereas in the case of peak and power mode, analog peak and power detectors are considered i.e., feedback_inner_high_inner_low & feedback_apd_high_apd_low. The GIPO pins are the used for indicating the over range and under range condition of the detectors (Analog peak detector(APD), Half-Band Peak detector and Power detector(rms and dynamic range of 60dB)).
• feedback_apd_low_hb_low: Analog peak detector lower and Half band detector lower
• feedback_apd_high_hb_high: Analog peak detector higher and Half band detector higher
• feedback_inner_high_inner_low: Power detector higher and lower
• feedback_apd_high_apd_low: Analog peak detector higher and lower
Please refer to the user guide description and the Rx block chain below:


In order to use the peak or peak + power detection mode, you can choose this option under the Gain control tab in TES and for assigning the GPIO that can be done under the GPIO tab of TES. You can also assign all the parameter details by modifying the below data structure.

Data structure



Data structure

Power detector
The figure below shows the example using the just the power detector and the parameters (overRangeHighPowerTresh, overRangeLowPowerTresh, underRangeHighPowerTresh and underRangeLowPowerTresh) are related to the power detector.

The GPIO are the indicator of the inner high and low i.e., OverRangeLowerTresh and underRangeHighPowerTresh. This is also mentioned in the user guide as shown below:

Peak detector
The below figure shows the AGC working using the peak detector, here the peak detector has two level of threshold lower and higher i.e., apdHigherThresh is related to APD Hi Thrshld Counter Exceeded (GPIO 7) and apdLowThresh is related to APD Lo Thrshld Count Exceeded (GPIO 5).


One can calculate the values of the lower and higher threshold value of analog peak detector are shown below

For instance, if the peak underload threshold value is -9dBFS then the apdLowThresh will be 18


Half Band detector
The below figure shows the operation of the half band peak detector, here you can see 4 different threshold values (hbHighThresh, hbUnderRangeLowThresh, hbUnderRangeMidThresh & hbUnderRangeHighThresh). These levels are made so that the signal increment is in a ramp up manner as highlighted in the figure below:


More information on GPIO:
As can be seen from the below figures, the DGPIO pins from 4-7 are used for both the mode i.e., peak mode & power + peak mode. For instance, in peak mode, DGPIO 4 is assigned to feedback mask bit position to 0 (hb_low_threshold_counter_exceeded).

Similarly, I have made the relation table for each mode and GPIO pin using the above figure

Experiments:
Case 1 (Peak Mode): In this case we have tested the peak mode option where the APD & HB peak detector LO and HI threshold are assigned to respective GPIO as shown below
Step 1: When the signal power was well below the threshold values of APD and HB detector. You can see the GPIO pins are low.

Step 2: When increasing the signal power, we can observe that the APD lower threshold exceeded

Step 3 : When increasing the signal power further we can observe that HB lower threshold get exceeded, then APD higher and last the HB high. Please find the sequence below


Case 2 (Power and Peak Mode): In this case we have tested the power and peak mode option where the power inner higher and lower is assigned to gpio 1 & 0 respectively whereas gpio 3 & 2 are assigned to APD high and lower threshold respectively.


Power under load
Peak lower threshold exceeded
Peak higher threshold exceeded
Power overloaded

Regards
Rahul
Hi,
We can reduce the gain update period below 50.5µs using Python or C. The core issue lies in the Rx gain. Attenuation occurs correctly during high signal power, but the system fails to apply the corresponding gain increase when the signal returns to normal. Since attenuation is applied instantly, whereas applying gain takes time, the minimum value for the gain update period is 50.5 us.
As I suggested, the minimum gain update period is 50.5us, you can set the value less than 50.5us but the issue is with the applying gain for example if you gain index is around 230 and at this time you signal power is reduced then the gain index should increment from 230 to lets say 240. This wont happen when the gain refresh period is less than 50.5us but decrementing the gain index will work.
Now coming to the parameters:
The four-parameter feedback_inner_high_inner_low ,feedback_apd_high_apd_low, feedback_apd_low_hb_low & feedback_apd_high_hb_high are the threshold counter exceed status. There are two mode one is peak only where the analog peak detector and half band peak detector are considered i.e., feedback_apd_low_hb_low & feedback_apd_high_hb_high whereas in the case of peak and power mode, analog peak and power detectors are considered i.e., feedback_inner_high_inner_low & feedback_apd_high_apd_low. The GIPO pins are the used for indicating the over range and under range condition of the detectors (Analog peak detector(APD), Half-Band Peak detector and Power detector(rms and dynamic range of 60dB)).
• feedback_apd_low_hb_low: Analog peak detector lower and Half band detector lower
• feedback_apd_high_hb_high: Analog peak detector higher and Half band detector higher
• feedback_inner_high_inner_low: Power detector higher and lower
• feedback_apd_high_apd_low: Analog peak detector higher and lower
Please refer to the user guide description and the Rx block chain below:


In order to use the peak or peak + power detection mode, you can choose this option under the Gain control tab in TES and for assigning the GPIO that can be done under the GPIO tab of TES. You can also assign all the parameter details by modifying the below data structure.

Data structure



Data structure

Power detector
The figure below shows the example using the just the power detector and the parameters (overRangeHighPowerTresh, overRangeLowPowerTresh, underRangeHighPowerTresh and underRangeLowPowerTresh) are related to the power detector.

The GPIO are the indicator of the inner high and low i.e., OverRangeLowerTresh and underRangeHighPowerTresh. This is also mentioned in the user guide as shown below:

Peak detector
The below figure shows the AGC working using the peak detector, here the peak detector has two level of threshold lower and higher i.e., apdHigherThresh is related to APD Hi Thrshld Counter Exceeded (GPIO 7) and apdLowThresh is related to APD Lo Thrshld Count Exceeded (GPIO 5).


One can calculate the values of the lower and higher threshold value of analog peak detector are shown below

For instance, if the peak underload threshold value is -9dBFS then the apdLowThresh will be 18


Half Band detector
The below figure shows the operation of the half band peak detector, here you can see 4 different threshold values (hbHighThresh, hbUnderRangeLowThresh, hbUnderRangeMidThresh & hbUnderRangeHighThresh). These levels are made so that the signal increment is in a ramp up manner as highlighted in the figure below:


More information on GPIO:
As can be seen from the below figures, the DGPIO pins from 4-7 are used for both the mode i.e., peak mode & power + peak mode. For instance, in peak mode, DGPIO 4 is assigned to feedback mask bit position to 0 (hb_low_threshold_counter_exceeded).

Similarly, I have made the relation table for each mode and GPIO pin using the above figure

Experiments:
Case 1 (Peak Mode): In this case we have tested the peak mode option where the APD & HB peak detector LO and HI threshold are assigned to respective GPIO as shown below
Step 1: When the signal power was well below the threshold values of APD and HB detector. You can see the GPIO pins are low.

Step 2: When increasing the signal power, we can observe that the APD lower threshold exceeded

Step 3 : When increasing the signal power further we can observe that HB lower threshold get exceeded, then APD higher and last the HB high. Please find the sequence below


Case 2 (Power and Peak Mode): In this case we have tested the power and peak mode option where the power inner higher and lower is assigned to gpio 1 & 0 respectively whereas gpio 3 & 2 are assigned to APD high and lower threshold respectively.


Power under load
Peak lower threshold exceeded
Peak higher threshold exceeded
Power overloaded

Regards
Rahul
Hi,
Thank you for your reply. What you listed is very useful, however in our setup we have a very specific problem.
Consider the following setup parameters:
fast attack = enabled
fast recovery = disabled
apd = enabled
hbpd = enabled
power_detector = disabled
Peak_Overload_Threshold_dBFS = -20.0
Peak_Underload_Threshold_dBFS = -32.0
attack/recover steps = 0.5 dB
gain update period = 50.5 us
The problem we are facing is that we are inserting a signal that exceeds our upper threshold and the AGC successfully applies attenuation and brings the signal within the set boundaries. However, our signal later gets weaker and falls under the underload threshold. Here we need the AGC to remove attenuation and bring it back within the boundaries once again, but it fails to do so. In other words, it always fails to recover our signal. Why is that happening? Do you maybe need any more parameters to help determine why is that happening?
Any news on that specific problem?
Hi,
I can replicate the issue that you are observing when the signal goes low. I cannot recover the gain. I have tested a few experiments on the lower threshold values, and the issue starts when the Peak_Underload_Threshold_dBFS goes below -23 dBFS. I have raised the necessary concerns with the relevant team to find the root cause for it. We will update you once we have resolved this issue.
Regards
Rahul
Hi,
Do you have any news yet?
Regards
K.
Hi,
This concern has been duly noted and is being addressed internally. However, we do not have a confirmed schedule for its inclusion in a future SDK release at this time.
Regards
Rahul
Hi,
Do you have any news regarding the timeline of this fix?
Can you estimate approximately when will this be released?
Thank you in advance,
Konstantinos
Hi,
We currently dont have the fixed time line.
Regards
Rahul