This fixup allows the AGC LMS driver to select the appropriate LNA when changing
the LNA's gain. libbladeRF reads, masks, and writes this field, however for
performance reasons the AGC LMS driver should know the final value of the
register without first reading it.
Allow the AGC to choose the appropriate DC offset LUT setting for correcting
the DC offset. Essentially, libbladeRF loads the DC offset lookup table from a
previously computed DC calibration table, and NIOS exposes the correction for
each of the gains. The AGC the selects which correction it wants applied based
on its gain setting.
The AGC core runs in a different clock domain for that of the NiOS core. Three
synchrinozers have been added to allow the AGC core to drive signals in the
lms_rx_clock_out clock domain while communicating with the NiOS core in the
\80MHz\ clock domain.
Automatic Gain Control is essential for a receive chain to drastically increase
the system's dynamic range. RF frontends, such as the LMS6002D, have static
ranges of about 6.02dB per bit. In the case of a 12 bit ADC that means 72dB of
dynamic range. That means that without changing any of the LNA or VGA gains (the
gain remain unchanged or "static") the RF frontend should be able to "see"
signals 72dB around the middle of its range which is set by the LNA and VGA
gains. Although those values seem high, that range is only usable if the
incoming signal requires an infinitesimally small amount of SNR to demodulate.
The 802.11a 6Mbps rate requires about 6dB of SNR, so that along with the noise
figure of the receiver very quickly start taking dB away from the 72dB of
dynamic range. The only option to be able to listen to a signal, which with its
SNR requirements falls below the static range, is to start using the RF
frontend's dnyamic range. The dynamic range of the receiver is adjusted by
altering the settings of physical amplifiers such as the LNA, and VGAs. For the
LMS6002D this range goes from about -120dBm to about +4dBm.
At this point an AGC's useful becomes apparent. The AGC quickly and wisely
adjusts the values of the physical amplifiers to bring the incoming singal
along with its SNR requirements into the static range of the RF frontend.
The AGC implementation in this commit is specific to 802.11 on the LMS6002D.
The AGC idles at the higest gain state so as to not miss anything, and moves to
lower gain settings when the power measurement IIR indicates the system does
not have enough headroom for the 10dB of PAPR 802.11 allows for.
The AGC threshold values overlap a little bit between the high, mid, and low
gain settings. This is done on purpose to add hysteresis to the core.
It is important to note that the AGC does not instantaneously go from high to
low gain, and it will stop at the middle gain setting, wait for the group delays
of the analog RF components to expire, and collect a new IIR reading before
deciding it has settled or if it should go on to the low gain stage.
The power ranges and subsequent gain settings are as follows:
High gain: -82dBm - -52dBm
lna_gain => 6 dB (Max)
rxvga1_gain => 30 dB
rxvga2_gain => 15 dB
Mid gain: -52dBm - -30dBm
lna_gain => 3 dB (Mid)
rxvga1_gain => 30 dB
rxvga2_gain => 0 dB
Low gain: -30dBm - -17dBm
lna_gain => 3 dB (Mid)
rxvga1_gain => 12 dB
rxvga2_gain => 0 dB
The AGC depends on a newer DC cal table and FPGA version 0.7.0 being loaded. A
DC cal table version of 2 or greater is also required for the AGC to work.
The DC calibration table will now include mean residual errors for 3 different
gains (that will be used by the AGC amont other things) including:
Max : LNA=6dB, RXVGA1=30dB, RXVGA2=15dB
Mid : LNA=6dB, RXVGA1=30dB, RXVGA2= 0dB
Low : LNA=3dB, RXVGA1=12dB, RXVGA2= 0dB
The DC cal table version has been bumped to 2. This commit will allow backward
compatibility with existing DC cal tables.
- Made changes to the readme which were meant to be part of the
initial bladeRF-fsk commit, but were not.
- Also added a comment to rx_ch_filter.h, regarding MATLAB
- Cleaned up trailing whitespace.
- Added round() and roundf() functions for VS version 2012 and below, since
they lack implementation of these functions
- Minor formatting edits to make the compiler (v17.00.50727.1) happy
This commit introduces a new utility which is a bladeRF-to-bladeRF text/file
transfer program. The program uses a custom FSK software modem (implemented in
host-side C code) to send/receive data. Included is a Matlab/Octave
simulation/implementation of the modem's physical layer. Supports
Windows/Linux/OSX. More info can be found in the README.md.
This utility now builds/installs as part of the bladeRF host side code. Meaning
it is included when building the host software from the source.
As of 1154ef7b, the calibration table generation uses a default of
10 MHz increments. This was changed due to the tradeoff between
improved results and a longer calibration run-time.
Fixes#480