Page 1 of 1

ADC Setpoint not working

Posted: Thu Mar 31, 2016 6:21 am
by DaveB
I don't normally move the setpoint from -20dB but in the past doing so had an effect on the noise floor and if set to 0 dB or just under could end up with overload. I was chasing down a varying noise floor (possible local off frequency transmitter?) and found that with the current version changing the value has no effect at all. Also originally setting the ADC to a high reduction worsened the signal/noise ratio.

From what I understood the ADC setpoint gave a ceiling to prevent overload on stronger signals

Re: ADC Setpoint not working

Posted: Fri Apr 01, 2016 8:35 am
by DK7OB
I have the same or a similar issue. Running gqrx with soapy-sdrplay on Kubuntu 14.04. All software built from latest git.

In gqrx I get the gain sliders TUNER and LNAT. The TUNER slider more or less works as expected, but sometimes the noise floor jumps about 20dB when moving the TUNER slider. This is depending on the setting of the LNAT slider. But the behavior seems to be a bit random, at least I couldn't figure out how it is supposed to work. I didn't find a block diagram of the SDRPlay yet to find out where the gains are set.

There might be bugs in all parts of the software, but before assuming this, I have to understand how it is supposed to work.

Wolf, DK7OB

Re: ADC Setpoint not working

Posted: Fri Apr 01, 2016 9:45 pm
by DaveB
I only know the Windows platform - but what Mirics API are you using? When API 1.8.0 was released the interaction between the LNA gain and the tuner gain was changed and caused a 20 dB jump in overall gain at the changeover point. This was corrected in a few days later in API 1.8.1. Is it possible the Linux API hasn't been 'corrected'.

There is a good explanation on this forum about how the LNA 'gain' and IF gain work - but basically in versions before API 1.8.0 the LNA 'gain' tells the system at what point the LNA is turned on/off. So for example if you set the LNA to -59dB (gain reduction) - if the IF gain is set to -58dB the LNA is on. If you set the IF gain reduction to -60 dB the LNA is off.

From what you write this is what seems to be happening in your linux set-up. Another example LNA threshold -50 dB - LNA will be on if the IF gain reduction is <50 and on if it is >50.

The internal LNA - which is being switched on/off has a 24 dB gain. The LNA that is in front of the Mirics chip is only on above 60 MHz. You can find a block diagram and other information under "Generic Documentation" on the SDRPlay Website under "Platforms/Linux" (or Platforms/Windows).

The latest windows API changes the way the LNA gain is set - it just has an on/off choice. When you turn it on the overall system gain stays the same - the IF gain is reduced by 24 dB - so the signal level doesn't change - but you should see a small improvement in s/n ratio.

David

Re: ADC Setpoint not working

Posted: Sat Apr 02, 2016 10:32 am
by DK7OB
David, thanks for your reply.

The name of the API installer is SDRplay_RSP_MiricsAPI-1.9.4.run, and the Web page says "Includes API 1.8.1", but what I see is exactly what you write. The gain jumps around 20dB or so (at least the noise floor jumps that way). This is with the "soapy" driver. There is another one ("osmosdr") which provides only one gain setting, maybe that one has this change included. Good thing is I can look into the driver code (not the API code unfortunately)

I found a chip block diagram in the cq DL, a German radio amateur magazine. There you see the internal LNAs. I was a bit confused by the block diagram with the external LNA only for higher frequencies, but the LNA setting had an effect on HF as well. Now I understand it.

On HF I have to play with the gain setting quite a lot to avoid overload and spurious signals. Most of the time I try to disable the LNA, only on the high end of the HF range (above 20MHz or so) it seems to bring a bit of SNR improvement. The AGC sets the gain too high so I get more spurious signals.

Maybe that's a lesser problem on Windows because the Windows software is more advanced than the Linux SW.

Re: ADC Setpoint not working

Posted: Mon Apr 04, 2016 2:06 pm
by DK7OB
I did some more detailed investigations regarding setting the gain reductions.

Setup: SDRplay connected to Rohde und Schwarz Signal generator SML, frequency 25MHz, level -80dBm.
gqrx with SoapySDRPlay driver from git master and latest SDRplay API on Kubuntu 14.04.

Observation:
When the LNA threshold is > 24 dB, the gain reduction is working smoothly, and at the LNA threshold the noise floor goes down when the LNA is switched in, the overall gain stays constant (resp. changes 1 step).

The following appears in the log when moving through the threshold (LNA threshold = 27dB):

Code: Select all

mir_sdr_SetGr: GR->28[4,0,0,24] gRset->0xC4 DCCALmode=4 DCCALspd=1 GrToggle->1
mir_sdr_SetGrParams: gRmin->0 lnaGrThresh->27
mir_sdr_ReadPacket: Gain update confirmed: Gr=28dB GrToggle=1 gset=0xc5
mir_sdr_ResetUpdateFlags: resetGainUpdate=1 resetRfUpdate=0 resetFsUpdate=0
mir_sdr_SetGr: GR->27[3,0,0,24] gRset->0xC3 DCCALmode=4 DCCALspd=1 GrToggle->1
mir_sdr_SetGrParams: gRmin->0 lnaGrThresh->27
mir_sdr_ReadPacket: Gain update confirmed: Gr=27dB GrToggle=1 gset=0xc3
mir_sdr_ResetUpdateFlags: resetGainUpdate=1 resetRfUpdate=0 resetFsUpdate=0
mir_sdr_SetGr: GR->26[26,0,0,0] gRset->0x1A DCCALmode=4 DCCALspd=1 GrToggle->1
mir_sdr_SetGrParams: gRmin->0 lnaGrThresh->27
Now I reduce the LNA threshold to 20 dB and move through the tuner gain reduction. At gain reduction 23dB, the signal and noise floor fall down until GR=19dB where signal and noise floor are back to normal. Reason is that in this range the API tries to set a negative gain reduction which does not work. Log:

Code: Select all

mir_sdr_SetGr: GR->24[0,0,0,24] gRset->0xC0 DCCALmode=4 DCCALspd=1 GrToggle->1
mir_sdr_SetGrParams: gRmin->0 lnaGrThresh->20
mir_sdr_ReadPacket: Gain update confirmed: Gr=24dB GrToggle=1 gset=0xc1
mir_sdr_ResetUpdateFlags: resetGainUpdate=1 resetRfUpdate=0 resetFsUpdate=0
mir_sdr_SetGr: GR->23[-1,0,0,24] gRset->0xFFFFFFFF DCCALmode=4 DCCALspd=1 GrToggle->1
mir_sdr_SetGrParams: gRmin->0 lnaGrThresh->20
mir_sdr_ReadPacket: Gain update confirmed: Gr=23dB GrToggle=1 gset=0x3ff
mir_sdr_ResetUpdateFlags: resetGainUpdate=1 resetRfUpdate=0 resetFsUpdate=0
mir_sdr_SetGr: GR->22[-2,0,0,24] gRset->0xFFFFFFFE DCCALmode=4 DCCALspd=1 GrToggle->1
mir_sdr_SetGrParams: gRmin->0 lnaGrThresh->20
mir_sdr_ReadPacket: Gain update confirmed: Gr=22dB GrToggle=1 gset=0x3ff
mir_sdr_ResetUpdateFlags: resetGainUpdate=1 resetRfUpdate=0 resetFsUpdate=0
mir_sdr_SetGr: GR->21[-3,0,0,24] gRset->0xFFFFFFFD DCCALmode=4 DCCALspd=1 GrToggle->1
mir_sdr_SetGrParams: gRmin->0 lnaGrThresh->20
mir_sdr_ReadPacket: Gain update confirmed: Gr=21dB GrToggle=1 gset=0x3fd
mir_sdr_ResetUpdateFlags: resetGainUpdate=1 resetRfUpdate=0 resetFsUpdate=0
mir_sdr_SetGr: GR->20[-4,0,0,24] gRset->0xFFFFFFFC DCCALmode=4 DCCALspd=1 GrToggle->1
mir_sdr_SetGrParams: gRmin->0 lnaGrThresh->20
mir_sdr_ReadPacket: Gain update confirmed: Gr=20dB GrToggle=1 gset=0x3fd
mir_sdr_ResetUpdateFlags: resetGainUpdate=1 resetRfUpdate=0 resetFsUpdate=0
mir_sdr_SetGr: GR->19[19,0,0,0] gRset->0x13 DCCALmode=4 DCCALspd=1 GrToggle->1
mir_sdr_SetGrParams: gRmin->0 lnaGrThresh->20
mir_sdr_ReadPacket: Gain update confirmed: Gr=19dB GrToggle=1 gset=0x13
mir_sdr_ResetUpdateFlags: resetGainUpdate=1 resetRfUpdate=0 resetFsUpdate=0
Conclusion: LNA threshold < 24 dB should not be used.
I did not test other frequency ranges, but I expect a similar behavior.