Maybe I'm wrong but at line 141, it should be a division and not a difference ??? I'm telling that because in line 143, the result "tmp" is compared to the gain. There is a unit problem here I think : amplitude (result of the difference) can't be compared to a gain which do not have unit by definition....

I will try wider value for attack.

Le 09/12/2021 à 13:23, Jeff Long a écrit :
The change in gain is also proportional to the difference between the reference level and the signal level. So it probably is having some influence but it reacts more quickly. Try a smaller value for attack. Take a look at the source here

https://github.com/gnuradio/gnuradio/blob/35a242f1cd4b724be0c4708d8690f82c804aafd8/gr-analog/include/gnuradio/analog/agc2.h#L64

for more info. It may just not be a great algorithm, or may not work for the rates and changes in signal you have.

On Thu, Dec 9, 2021 at 7:07 AM Fabien PELLET <fpellet.f4...@free.fr> wrote:

    Thanks for the explanation.

    Do you have any idea on why the attack as no influence ?

    Le 09/12/2021 à 12:58, Jeff Long a écrit :
    Attack and decay are unitless per-sample multipliers, so 1.0e-2
    gives you a time "on the order of" 100 samples. It's really an
    exponential attack and decay, but that gives you an idea. So,
    your observation is correct - a smaller value gives you a longer
    attack/decay.

    On Thu, Dec 9, 2021 at 4:33 AM Fabien PELLET
    <fpellet.f4...@free.fr> wrote:

        Hello,

        I'm trying to work with the module AGC2 but I have some
        trouble using it.

        First problem is : what is the unit of the parameters attack
        and decay ?
        I thought initially that it was in second but after some test
        it is
        clearly not in that unit. Indeed, if I increase the value of
        the decay
        for example, the time of the increase of the gain at the end
        of a signal
        will go down where it should go up.

        Second problem (maybe in relation with the first) : the
        attack value
        have absolutly no influence.... From 10-6 to 10-2, I can't
        see any
        changes on the output signal.

        Does someone have any explanation ?

        Best regards,

        Fabien, F4CTZ.

Reply via email to