Changes between Version 3 and Version 4 of SISOAGC


Ignore:
Timestamp:
Jan 30, 2007, 4:45:39 PM (17 years ago)
Author:
gbmidd
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SISOAGC

    v3 v4  
    55The gain value is chosen using an automatic gain control (AGC) peripheral, which detects the magnitude of the received signal and determines radio-amplifier gains which place the baseband output signal in the correct range for the receiver.
    66
    7 == Algorithm Details ==
     7== AGC Algorithm ==
    88
    9 The Maxim radios apply gain at two points during downconversion: first at RF and then at baseband, after the downconversion.  The RF gain may be set to any of 0, 15 or 31 dB, while the baseband gain is less granular and may be set to values between 0 and 61 dB in steps of 2 dB.
     9This AGC peripheral is designed specifically for the Maxim 2829 radios, and implements an algorithm tailored only to them.  The general theory of operation is as follows:
    1010
    11 The radio also returns a received signal strength indicator (RSSI), the output of an analog integrator, which gives an estimate of the received signal strength in dB.  From this value, an approximate amount of gain may be determined by subtracting the RSSI from the target level.
     11The radios apply gain at two points during downconversion: course gain is applied at RF (0, 15, or 31 dB), and a fine-grained gain is applied at baseband (0-62 dB, in steps of 2 dB).  Using an analog received signal strength indicator (RSSI), the algorithm selects the appropriate RF gain.  It then uses the digital signal to set the baseband gain.  The choice of RF and baseband gains is determined by the target received signal setting, which is passed into the algorithm upon initialization.
    1212
    13 The AGC peripheral is triggered by a packet-detect signal.  After this arrives, the AGC reads the RSSI and computes a rough gain estimate as described.  This gain is then decomposed into the RF and baseband (BB) gain parts.  These gains are set, and the system is allowed to settle for some time.
    14 
    15 After a settling period, a digital power measurement (vIQ) is computed (taken as the sum-complex magnitude in dB), providing a much more accurate estimate of the signal strength.  The final adjustment to the gain is calculated by subtracting vIQ from the target level.
    16 
    17 The final gain is set, and the gains are locked until the AGC is reset.  At that time, the gains are reset to maximum RF (31 dB) and calibrated BB gain (dependent on the user-defined noise estimate).
     13Before the AGC runs, the gain values in the radio are calibrated such that background noise appears to the receiver at -19 dB.  When a packet is detected, the AGC is triggered, chooses gains, and sets the signal strength to the target value.  These gains are '''locked''' until the AGC is reset.  Ideally, this reset should occur when a packet has been completely processed, so that the AGC is ready for the next packet.
    1814
    1915== DC Offset Correction ==
    2016
    21 As a result of changing gains in the radios, a DC offset (DCO) may be introduced in the downconverted signal, and it may not be the same in the I and Q paths.  The AGC peripheral contains a routine to remove the DCO, which may or may not enabled depending on user requirements.
     17As a result of changing gains in the radios, a DC offset (DCO) may be introduced in the downconverted signal, and it may not be the same in the I and Q paths.  The AGC peripheral contains a core to remove the DCO in both I and Q paths.  This core may or may not be enabled, depending on user requirements.
    2218
    23 == API ==
     19== the AGC API ==
    2420
    25 A driver abstracts register-level operations from the programming-interface; below the functions for controlling the AGC are described.  The driver is {{{warpagc.h}}}, and must be included in the code in order to define the functions below.
     21A driver abstracts register-level operations from the programming-interface; below the functions for controlling the AGC are described.  The driver source code is available in [source:/PlatformSupport/CustomPeripherals/drivers/ofdm_AGC_mimo_opbw_v1_01_a/src/].  It must be included in the project code in order to call the functions below.
    2622
    27 '''{{{void agc_Initialize(int noise_estimate)}}}'''
     23'''{{{void ofdm_AGC_MasterReset()}}}'''
    2824
    29   Resets and initializes the AGC peripheral with all required parameters.  The calibration baseband gain is computed from the noise estimate, so an accurate guess of the noise floor is required.  This value is generally near -85 dB.
     25  Resets all state in the AGC, though does not reinitialize any parameters.  All averagers and other state-machines are reset, and the AGC is enabled when the routine completes.  This routine MUST be called before the AGC can be used reliably.
    3026
    31   Upon completing this routine, the AGC is enabled and online.
     27'''{{{void ofdm_AGC_Reset()}}}'''
    3228
    33 '''{{{void agc_MasterReset()}}}'''
     29  Resets the gains in the radio to their calibration values, but no other state in the core.
    3430
    35   Resets all state in the AGC, though does not reinitialize any parameters.  All averagers and other state-machines are reset, and the AGC is enabled when the routine completes.
     31'''{{{void ofdm_AGC_Initialize(int noise_estimate)}}}'''
    3632
    37 '''{{{void agc_Reset()}}}'''
     33  Resets and initializes the AGC peripheral with all required parameters.  The initial baseband gain is computed from the noise estimate, so an accurate guess of the noise floor is required.  This value is generally near -85 dB.
    3834
    39   Resets only the gain values, but no other state in the core.
     35  Upon completing this routine, the AGC is enabled and ready to be triggered by the packet detector.
    4036
    41 '''{{{void agc_FiltSel(unsigned int state)}}}'''
     37'''{{{void ofdm_AGC_FiltSel(unsigned int state)}}}'''
    4238
    4339  Choose the downsampling filter depending on the value of state.
    4440
    4541  state = 0 : downsampling only[[BR]]
    46 state = 1 : use 32-tap decimating filter
     42  state = 1 : use 32-tap decimating filter
    4743
    48 '''{{{void agc_SetDCO(unsigned int state)}}}'''
     44'''{{{void ofdm_AGC_SetDCO(unsigned int state)}}}'''
    4945
    5046  Enable or disable DC Offset correction
    5147
    5248  state = 0 : DCO disable[[BR]]
    53 state = 1 : DCO enable
     49  state = 1 : DCO enable
    5450
    55 '''{{{agc_SetTarget(signed int c)}}}'''
     51'''{{{ofdm_AGC_SetTarget(signed int c)}}}'''
    5652
    57   Set the target signal strength value c in dB.
     53  Sets the target signal strength value to c dB.  After the AGC completes its execution, the receiver will see a signal of this magnitude.
     54
     55'''{{{void ofdm_AGC_setNoiseEstimate(int noise_estimate)}}}'''
     56
     57  Updates the noise-estimate and re-computes calibration gain values, but WITHOUT reseting state in the AGC.
     58
     59'''{{{unsigned int ofdm_AGC_GetGains(void)}}}'''
     60
     61   (MIMO core only)
     62
     63  Polls the AGC core and returns the current gain values as set in the radio.  These are received in a 16 bit value, divided as shown below:
     64
     65  hi[0 gBB_B g_RF_B | 0 g_BB_A g_RF_A]lo
     66
     67  g_BB_A and g_BB_B are each 5 bits wide, and represent the value of the baseband gains set in radios A and B.  g_RF_A and g_RF_B are 2 bits wide, and return the RF gain value in radios A and B.  The values are interpreted as follows:
     68
     69  g_BB * 2 = baseband gain in dB[[BR]]
     70  g_RF = 0 : 0 dB RF gain[[BR]]
     71  g_RF = 1 : 15 dB RF gain[[BR]]
     72  g_RF = 2 : 31 dB RF gain
     73
     74== Example Instantiation ==
     75
     76Below is a sample instantiation sequence for the AGC core.
     77
     78{{{
     79#!c
     80        // Announce initialization
     81        xil_printf("AGC initialization...\r\n");
     82       
     83        // Call the overall init routine -- Master Reset is included in this, use -85 dB as noise floor estimate
     84        ofdm_AGC_Initialize(-85);
     85       
     86        // Choose the raised-cosine decimation filter
     87        ofdm_AGC_FiltSel(1);
     88       
     89        // Enable DC offset correction
     90        ofdm_AGC_SetDCO(1);
     91
     92        // Set the target signal strength to -15 dB
     93        ofdm_AGC_SetTarget(-15);
     94       
     95        // Reset the gains to their calibration values, computed in the Init routine
     96        ofdm_AGC_Reset();
     97       
     98        // Announce success
     99        xil_printf("AGC setup complete!  Ready to detect a packet!\r\n");
     100
     101}}}
     102
     103After this code executes, the AGC will be armed and ready to trigger on the next packet detection.  After the packet has been processed, ofdm_AGC_Reset() should be called to return the gains to their calibration values.  No other reset is required to prepare the AGC for the next packet.