Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic Gain Control (AGC) not working properly #18

Open
kirat68 opened this issue Nov 17, 2021 · 1 comment
Open

Automatic Gain Control (AGC) not working properly #18

kirat68 opened this issue Nov 17, 2021 · 1 comment
Assignees

Comments

@kirat68
Copy link

kirat68 commented Nov 17, 2021

Hello Franco

Playing with the AGC right now.

I did not checked your code and do not know how it is implemented but AGC is creating noise when jumping around trying to reduce or increase the gain. This is obviously not coming through in FM mode. But in AM it is absolutely problematic.

Test is simple. Disabling AGC stops this audible spikes.

Further more it seems that the SDR reacts to gain changes even in AGC mode. In this mode gain settings should not affect the gain at all.

@fventuri
Copy link
Owner

Tarik,
the gr-sdrplay3 GNU Radio module just enables/disables the AGC in the SDRplay API as requested by the user via the set_gain_mode() method (https://github.com/fventuri/gr-sdrplay3/blob/master/lib/rsp_impl.cc#L418-L441), but the actual implementation of the AGC happens inside the RSP hardware as you can see for instance in the high level block diagram of the RSPduo (https://www.sdrplay.com/wp-content/uploads/2018/06/RSPDuo-Technical-Information-R1P1.pdf).

Also please note that the SDRplay RSPs have two independent mechanisms to control the overall gain:

  • an 'RF' gain control, which is dependent on the RSP model, frequency, etc, and is controlled via an 'index' called LNA state. There is no AGC for this part
  • an 'IF' gain control, which you can see in the block diagram mentioned before; this one is the same for all the RSP models and typically goes from -20dB to -59dB in steps of 1dB each (the SDRplay API calls it a 'gain reduction' - gRdB - and therefore they use the range 20-59); the AGC refers only to this 'IF' gain

Therefore, even with the IF AGC enabled, the RF gain/LNA state can be changed by the user, and of course these changes affect the overall gain.

Finally gain changes due to the AGC are reported back to the client application via the event callback (see here: https://github.com/fventuri/gr-sdrplay3/blob/master/lib/rsp_impl.cc#L755-L760); they are currently displayed as a log message if the user enables the show_gain_changes flag, but in the future could become part of a GNU Radio message port, as you suggested in another discussion thread (#16 (comment)).

Franco

@fventuri fventuri self-assigned this Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants