DC removal not working with API 2.09

Add useful snippets of code or links to entire SDR projects.
DK7OB
Posts: 47
Joined: Thu Mar 24, 2016 7:14 am

DC removal not working with API 2.09

Postby DK7OB » Wed Jan 04, 2017 11:30 am

I am running gqrx on Ubuntu 16.04.

After I updated to API 2.09 and newest SoapySDRPlay from github the DC correction does not work any more. I see a DC spike in the spectrum which was not the case with the API 1.97.

If I enable DC removal in gqrx, I get the following output on the console:

Code: Select all

mir_sdr_StreamUninit()
mir_sdr_2500_Readback001Trim: readback = 0xcc19a0f
mir_sdr_2500_Bypass001Trim: reg13=0x1ed reg14=0x3031ae
mir_sdr_StreamInit()
mir_sdr_Init: starting hardware initialization
mir_sdr_Init: gR=20dB fs=2,000MHz rf=5,350MHz bw=0,200MHz if=0,000MHz
DownConvert: Enable=0 DecM=1 OutScale=0 (fs=2,000000 bw=200 if=0)
mir_sdr_usb_USB DLL: Revision 0.1.1
mir_sdr_2500_Init: fnaddr = 7
mir_sdr_2500_Init: adjusting squelch trim 0x1, rx gating enable 1, tx_trim 0, reg2 = 0x4801
initHw: Register7 = 0x000014
initRfFreqDependentHw(1): Tuner Register0 = 0x043e10
mir_sdr_SetFs: Sample Freq requested 2000000,000000
mir_sdr_SetFs: Fs->FsNomHz+dFsHz=2000000,0+0,0Hz=2000000,0Hz FsToggle->1
mir_sdr_SetRf: f->125350000,000Hz (int=14 frac=a73 afc=0) fSynth:2005600000,000
mir_sdr_SetRf: Rf->RfNomHz+dRfHz+LifHz+Lif1Hz=5350000,0+0,0+0,0Hz+120000000,0Hz=125350000,0Hz RfToggle->1
mir_sdr_SetGr: GR->20[20,0,0,0] gRset->0x14 DCCALmode=3 DCCALspd=0 GrToggle->1
setToggleStates: initialising sampNum=0x00017a02, gainSetting=0x014, FsToggle=0, RfToggle=0, GrToggle=0
setToggleStates: initialising Fs=2000000,000, Rf=125350000,000, Gr=20
mir_sdr_RSP_SetGr: in: 20 1 1 0
mir_sdr_RSP_SetGr: GR->20[20,0,0,24] gRset->0xD4 DCCALmode=3 DCCALspd=0 GrToggle->1
mir_sdr_RSP_SetGr: out: 20 44 1
mir_sdr_DecimateControl: 1 4 0
mir_sdr_DecimateControl: DecimateEnable=1, DecimateDecM=4, DecimateOutScale=2, DecimateRound[0]=0x00000002, DecimateRound[1]=0xfffffffe
mir_sdr_SetDcMode: DCCAL: mode->4 speedup->0
mir_sdr_SetDcTrackTime: DCTRK_TIM->63
DCcoeff=0,001500 adj_for_Fs=0,001500 Fs=2000000,000
AGCcoeff=0,290000 adj_for_Fs=0,290000 Fs=2000000,000
adj_for_PktSz=0,290000 PktSz=252
mir_sdr_ReadPacket: Gain update confirmed: Gr=20dB GrToggle=1 gset=0xd4
grChanged @ 118
DCoffsetCorrection: switched to tracking mode diff=119 curr=1490,94 last=1371,24


If I enable the DC remove, I get this:

Code: Select all

mir_sdr_StreamUninit()
mir_sdr_2500_Readback001Trim: readback = 0xcc19a0f
mir_sdr_2500_Bypass001Trim: reg13=0x1ed reg14=0x3031ae
mir_sdr_StreamInit()
mir_sdr_Init: starting hardware initialization
mir_sdr_Init: gR=20dB fs=2,000MHz rf=5,350MHz bw=0,200MHz if=0,000MHz
DownConvert: Enable=0 DecM=1 OutScale=0 (fs=2,000000 bw=200 if=0)
mir_sdr_usb_USB DLL: Revision 0.1.1
mir_sdr_2500_Init: fnaddr = 7
mir_sdr_2500_Init: adjusting squelch trim 0x1, rx gating enable 1, tx_trim 0, reg2 = 0x4801
initHw: Register7 = 0x000014
initRfFreqDependentHw(1): Tuner Register0 = 0x043e10
mir_sdr_SetFs: Sample Freq requested 2000000,000000
mir_sdr_SetFs: Fs->FsNomHz+dFsHz=2000000,0+0,0Hz=2000000,0Hz FsToggle->1
mir_sdr_SetRf: f->125350000,000Hz (int=14 frac=a73 afc=0) fSynth:2005600000,000
mir_sdr_SetRf: Rf->RfNomHz+dRfHz+LifHz+Lif1Hz=5350000,0+0,0+0,0Hz+120000000,0Hz=125350000,0Hz RfToggle->1
mir_sdr_SetGr: GR->20[20,0,0,0] gRset->0x14 DCCALmode=3 DCCALspd=0 GrToggle->1
setToggleStates: initialising sampNum=0x00017a02, gainSetting=0x014, FsToggle=0, RfToggle=1, GrToggle=0
setToggleStates: initialising Fs=2000000,000, Rf=125350000,000, Gr=20
mir_sdr_RSP_SetGr: in: 20 1 1 0
mir_sdr_RSP_SetGr: GR->20[20,0,0,24] gRset->0xD4 DCCALmode=3 DCCALspd=0 GrToggle->1
mir_sdr_RSP_SetGr: out: 20 44 1
mir_sdr_DecimateControl: 1 4 0
mir_sdr_DecimateControl: DecimateEnable=1, DecimateDecM=4, DecimateOutScale=2, DecimateRound[0]=0x00000002, DecimateRound[1]=0xfffffffe
mir_sdr_SetDcMode: DCCAL: mode->4 speedup->0
mir_sdr_SetDcTrackTime: DCTRK_TIM->63
DCcoeff=0,001500 adj_for_Fs=0,001500 Fs=2000000,000
AGCcoeff=0,290000 adj_for_Fs=0,290000 Fs=2000000,000
adj_for_PktSz=0,290000 PktSz=252
mir_sdr_ReadPacket: Gain update confirmed: Gr=20dB GrToggle=1 gset=0xd4
grChanged @ 126
DCoffsetCorrection: switched to tracking mode diff=57 curr=1293,51 last=1350,60


Any ideas?

Wolf, DK7OB

Reason: No reason

sdrplay
Posts: 573
Joined: Wed Jan 07, 2015 7:58 am

Re: DC removal not working with API 2.09

Postby sdrplay » Wed Jan 04, 2017 4:57 pm

There will always be an element of the DC component and you're at maximum gain so I'm not surprised you're seeing it. Reduce the gain and it will improve.

Best regards,

SDRplay Support

Reason: No reason

DK7OB
Posts: 47
Joined: Thu Mar 24, 2016 7:14 am

Re: DC removal not working with API 2.09

Postby DK7OB » Wed Jan 04, 2017 7:22 pm

The DC removal was working, but due to a problem in gqrx it could not be disabled. This is now fixed.

But still the DC spike is much more visible than with API 1.97 and matching soapysdrplay. The spike is even worse with gain reduction at maximum.

I attach 3 screen shots:
1. DC correction disabled
2. DC correction enabled, gain reduction maximum
3. DC correction enabled, gain reduction minimum

The DC spike is at 5.350 MHz (grey line)

Anybody using gqrx with API 2.09?
Attachments
dcdisabled.png
dcdisabled.png (218.08 KiB) Viewed 1227 times
dcenabled_grmax.png
dcenabled_grmax.png (217.03 KiB) Viewed 1227 times
dcenabled_grmin1.png
dcenabled_grmin1.png (229.07 KiB) Viewed 1227 times

Reason: No reason


Return to “Code Corner”

Who is online

Users browsing this forum: No registered users and 1 guest