Hi. I tried getting in to chat.gnuradio.org, but my login credentials no longer work, and they still don't work after resetting my password (maybe my account name to use for login is not my email?), so asking here instead. AGC2, in gr-analog/include/gnuradio/analog/agc2.h, has this code: ``` gr_complex scale(gr_complex input) { gr_complex output = input * _gain; float tmp = -_reference + sqrt(output.real() * output.real() + output.imag() * output.imag()); float rate = _decay_rate; if ((tmp) > _gain) { rate = _attack_rate; } _gain -= tmp * rate; // Not sure about this; will blow up if _gain < 0 (happens // when rates are too high), but is this the solution? if (_gain < 0.0) _gain = 10e-5; if (_max_gain > 0.0 && _gain > _max_gain) { _gain = _max_gain; } return output; } ``` I'm not talking about the "not sure about this", but about `if ((tmp) > _gain) {`. Should that not be `> 0.0`? `tmp` is already current magnitude minus reference, so should not attack vs decay rate be decided on whether it's above or below reference, not above and below `reference + current gain`? Maybe there's a good reason, but in my mind this means that my input is such that the current gain is normally 1000, input is ~1e-3 (noise) to 1e-1 (signal), reference is 1, then the attack rate will basically never be used? Same for the agc2_ff duplication further down the file. I'm not sure if this is why my PWM experiments stabilize, just not to around reference. -- typedef struct me_s { char name[] = { "Thomas Habets" }; char email[] = { "thomas@habets.se" }; char kernel[] = { "Linux" }; char *pgpKey[] = { "http://www.habets.pp.se/pubkey.txt" }; char pgp[] = { "9907 8698 8A24 F52F 1C2E 87F6 39A4 9EEA 460A 0169" }; char coolcmd[] = { "echo '. ./_&. ./_'>_;. ./_" }; } me_t;
No comments:
Post a Comment