I will try to put the PR and contribute. I will ask on the chat if someone can tell me how to proceed.

Le 20/12/2021 à 23:39, Jeff Long a écrit :
(back on mailing list)

I can put in the PR in the next few days. Or hop over to chat.gnuradio.org <http://chat.gnuradio.org> (General Chat room) and someone will probably be able to help with the PR process. New contributors are always welcome.

On Mon, Dec 20, 2021, 17:25 Fabien PELLET <fpellet.f4...@free.fr> wrote:

    The bug is that AGC2 was created to permit to adjust attack and
    decay delaies but in fact, only the decay has an effect on the
    output signal : attack parameter has no effect.

    The problem is that, in lines 71 and 143 of "agc2.h", the the
    error value calculated in the variable "tmp" is compared to the
    current gain where it should be compared to zero. This is for what
    it never enter in the IF condition where "attack" value is used.

    Could it be considered as a bug or not ?

    If yes, I can pull a request on github but it is the first time.
    Please could you explain me what I have to put in "base" and
    "request" ?

    Thanks,

    Fabien, F4CTZ.

    Le 20/12/2021 à 20:05, Jeff Long a écrit :
    If this is really a bug, then the best thing to do would be to
    submit a github pull request against the master branch. If you
    are not able to do that, point us to the modification and an
    explanation of why it is correct, and we can put in a PR.

    On Mon, Dec 20, 2021 at 1:18 PM Fabien PELLET
    <fpellet.f4...@free.fr> wrote:

        Hello,

        After a long time of understanding all necessary points for
        creating an OOT (documentation is very very poor on some
        details like adding parameters, etc.), I manage to rewrite a
        new module AGC to test the solution proposed : compare tmp to
        0 instead of "_gain" at line 141 of agc2.h.

        Attack value works with this modification of the code. Maybe
        it could be added in a new version of gr-analog....

        Best regards,

        Fabien, F4CTZ.

        Le 09/12/2021 à 14:52, Jeff Long a écrit :
        Maybe "tmp" should be compared to 0, not to gain. It does
        look suspicious. Not sure what algorithm the author had in mind.

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

            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