Skip to content

SDR Module

Todd Schumann edited this page Aug 9, 2018 · 8 revisions

The SDR module is a Python driver to control the SDR that is to be used in the test. A couple SDR modules are included in SDR Calibrator, but you may need to create your own. Instructions for this can be found at the bottom.

SDR Profile Parameters

If the parameter has [USER_SET], it must contain a value. If it has [DEFAULTABLE] instead, the driver should have a default value for the parameter.

  • sdr_module = [USER_SET]: This is the name of the SDR module found in the sdrcalibrator/lib/equipment/sdr directory that will be loaded. It does not have a default value.
  • sdr_connect_params = [USER_SET]: This parameter is a Python dictionary with any connection parameters the specific SDR module may need. For example, it may define the IP address or serial number associated with the SDR. This parameter is not currently defaultable, but you can pass an empty dictionary if no parameters are required.
  • sdr_clock_frequency = [DEFAULTABLE]: This parameter defines the clock frequency (if settable) on the SDR. For SDRs which do not have a settable clock frequency, this can be set to None.
  • sdr_sampling_frequency = [DEFAULTABLE]: This parameter defines the sampling frequency (if settable) on the SDR. For SDRs which do not have a settable sampling frequency, this can be set to None.
  • sdr_auto_dc_offset = [DEFAULTABLE]: This parameter turns on (True) of off (False) the automatic DC offset algorithm for the SDR. If the SDR does not have this algorithm implemented, None may be used.
  • sdr_auto_iq_balance = [DEFAULTABLE]: This parameter turns on (True) of off (False) the automatic IQ balance algorithm for the SDR. If the SDR does not have this algorithm implemented, None may be used.
  • sdr_gain = [DEFAULTABLE]: This parameter, in dB, is the gain value that the SDR will be set to immediately after initialization. Using this does not prevent the gain from being changed later in the script, instead, it is just a convenience for scripts which use a constant gain throughout the entire run.
  • sdr_f0_tuning_error_threshold = [DEFAULTABLE]: This parameter defines (in Hz) how large an offset between the requested center frequency and the actual center frequency causes an error to be triggered.
  • sdr_use_dsp_lo_shift = [DEFAULTABLE]: This parameter will tell the SDR to shift the center frequency using the onboard DSP. Since not all SDRs have an onboard DSP or if you don't want to use this feature, this can be turned off by setting it to False or None.
  • sdr_dsp_lo_shift = [DEFAULTABLE]: This parameter will determine how much the DSP will shift the center frequency (in Hz) if this feature is enabled. Note that while this value is defaultable, it is highly recommended to not use the default setting if it is being used since it will depend greatly on the other measurement parameters.
  • sdr_conditioning_samples = [DEFAULTABLE]: This parameter is the number of samples which are ignored at the beginning of any acquisition. Ignoring samples allows the automatic DC offset and IQ balance algorithm to take effect and allows the device to reach a more steady-state temperature, reducing measurement uncertainty.
  • sdr_power_limit = [DEFAULTABLE]: This parameter defines the maximum power (in dB) that can be applied to the SDR above a gain setting if power_limit_output_power is also set True (for example, setting this to -15dB and using a gain of 50dB will trigger errors if a power greater than -65dBm is requested as the input power).
  • sdr_power_scale_factor = None: This defines the power scale factor (in dB) for all frequencies for the SDR. This will be added to the SDR measured power to calculate the "true" SDR measured power. If this is set to anything but None, it will override the sdr_power_scaling_factor_file and any interpolation. This is usually used with 0 to disable any use of the scale factor.
  • sdr_power_scale_factor = False: This is the path to a file that defines the scale factor vs gain vs frequency matrix for the current SDR. These files can be generated with the Scale Factor test. In order to use this, sdr_power_scale_factor must be set to None. If both scale factor parameters are set to None, then a default scale factor of 0dB is used for all frequencies (essentially disabling any scaling).

Parameter Quick-Copy

For convenience, here is a copyable list of parameters in this category

# SDR parameters
sdr_module = 'MODULE_NAME'
sdr_connect_params = {}
#sdr_clock_frequency = 48e6
#sdr_sampling_frequency = 48e6
#sdr_auto_dc_offset = True
#sdr_auto_iq_imbalance = True
#sdr_gain = 20
#sdr_f0_tuning_error_threshold = 1e6
#sdr_use_dsp_lo_shift = False
#sdr_dsp_lo_shift = -6e6
#sdr_conditioning_samples = 100000
#sdr_power_limit = -15
#sdr_power_scale_factor = None
#sdr_power_scale_factor_file = './path/to/file/scale_factors.csv'

Note: The parameters set here are not based on the default parameter recommendations for any particular SDR. Instead, they are just examples to show formatting.

Writing an SDR Driver

Coming soon!