There is spike when sending zeros/signals (DC bias)?

Having issues with the site, hardware, source code, or any other issues?
Post Reply
t-leikan
Posts: 1
Joined: Mon Sep 21, 2015 4:07 am

There is spike when sending zeros/signals (DC bias)?

Post by t-leikan »

Hi, we want to send signals in on/off duty cycle (40ms/40ms for example), in off cycle, we want there is no signal at all. But there is big spike in the center of the frequency can be seen in spectrum analyzer.
After we take a closer look, it seems the spike is always there, in the center of the frequency, until we shut bladerf down completely by disable the tx module, but it takes too much time to enable and disable the module.
Any suggestions will be much appreciated.
jynik
Posts: 455
Joined: Thu Jun 06, 2013 8:15 pm

Re: There is spike when sending zeros/signals (DC bias)?

Post by jynik »

You're correct - what you're seeing is DC offset. The LMS6002D on the bladeRF can inject some opposite voltages to compensate for this, and you can "tune" this via the bladerf_set_correction(). Note that the magnitude of this DC offset is going to change with gain and frequency settings.

In general, you'll want to run the LMS6 DC calibrations first before using the aforementioned function to dial in the correction values, via bladerf_calibrate_dc() for each of the following LMS6002 modules: BLADERF_DC_CAL_LPF_TUNING, BLADERF_DC_CAL_TX_LPF, BLADERF_DC_CAL_RX_LPF, BLADERF_DC_CAL_RXVGA2.

As far as the bladeRF-cli goes, this procedure looks like:

Code: Select all

# Set the desired frequency and gain settings. For simplicity, we assume other
# parameters that do not affect DC offset (e.g., samplerate, bandwidth) are already
# configured.
bladeRF> set frequency tx 921M

  Set TX frequency:  921000000Hz

bladeRF> set txvga1 -8

  TXVGA1 Gain:  -8 dB

bladeRF> set txvga2 0

  TXVGA2 Gain:   0 dB

# Perform all the internal LMS6 calibrations, (i.e., each of the items associated 
# with bladerf_calibrate_dc())
bladeRF> cal lms

  Calibrating LMS LPF tuning module...
    LPF tuning module: 23

  Calibrating LMS TX LPF modules...
    TX LPF I filter: 33
    TX LPF Q filter: 43

  Calibrating LMS RX LPF modules...
    RX LPF I filter: 33
    RX LPF Q filter: 17

  Calibrating LMS RXVGA2 modules...
    RX VGA2 DC reference module: 25
    RX VGA2 stage 1, I channel: 33
    RX VGA2 stage 1, Q channel: 30
    RX VGA2 stage 2, I channel: 35
    RX VGA2 stage 2, Q channel: 33

# Attempt to automatically find correction values that minimize DC offset
bladeRF> cal dc tx

  TX DC I Setting = -81, error ~= 2.031774
  TX DC Q Setting = 276, error ~= 1.671806
As you see, there may be some residual error if the correction value adjustments are too simply coarse. If you want to continue to adjust this manually in the CLI, one thing you can do is transmit a file of 0+0j and tweak the correction settings while you run. If you're in linux, it's sufficient to use /dev/zero. If you're in Windows, you'll need to find a way to generate a file full of zeros.

Code: Select all

bladeRF> tx config file=/dev/zero repeat=0;
bladeRF> tx start
bladeRF> cal dc tx -64 256
bladeRF> tx stop
bladeRF> cal dc tx -96 320
bladeRF> tx stop
If you're using GNU Radio gr-osmosdr blocks, be aware that you'll need to set the "DC Offset Mode" to "Manual." If you have it set to "Off" it will zeroize these correction values, overwriting your settings.

For an upcoming release, I'm working on cleaning up and improving some shortcomings and issues with this calibration. Hopefully that will be out soon after the holidays.

By the way, I have a quick and dirty little tool for on-off keying that might be of interest to you: OOKiedokie

Cheers,
Jon
Post Reply