-
Notifications
You must be signed in to change notification settings - Fork 0
Home
SDR calibrator provides utilities to test software defined radios (SDRs) using laboratory grade equipment. For example, one could automatically apply a continuous wave (CW) signal from a signal generator, measure the received power from the SDR, and determine if a power scale factor is necessary to recover the true power applied from the signal generator. The SDRs and laboratory grade equipment are controlled using a short Python driver stored in the ./sdrcalibrator/lib/equipment
directories. New equipment can SDRs can be added by writing a short driver and placing it in the corresponding folder.
-
Install the necessary libraries:
sudo apt-get install gnuradio-dev libuhd-dev python-numpy python-matplotlib python-pip
-
Install the necessary Python libraries:
sudo pip install pyvisa-py
-
Setup equipment according to the basic setup below: [get image]
-
Copy a profile from
./profiles/examples/*.profile
to./profiles/*.profile
and modify to your needs. -
Run SDR calibrator with your modified profile:
./sdr_calibrator.py ./profiles/*.profile
To run SDR Calibrator, run the base script with the chosen profile as a parameter. Modifying the profile to fit your needs is all that needs to be done to customize a test to your setup.
./sdr_calibrator.py ./profiles/power_measurement.profile
~*~*~* Power Measurement *~*~*~
Checking profile... Done!
Initializing equipment...
Configuring logger...
Disabling logging to file...Done!
Initializing SDR...
SDR should be of type 'B210'...
Connecting to SDR... Done!
SDR clock frequency will be set to 48.0MHz... Done!
SDR sampling frequency will be set to 12.0MHz... Done!
Setting auto DC offset correction to True... Done!
Setting auto IQ balance correction to True... Done!
Setting SDR gain to 30dBm... Done!
Center frequency tuning error threshold: 1.0MHz...
Disabling DSP LO shifting...Done!
Loading SDR scale factors from file... Done!
Initializing signal generator...
Signal generator should be of type 'Agilent E8663B'...
Connecting to signal generator... Done!
Signal generator on/off settling times set to 1s/0s
Checking defaulted parameters which rely on equipment settings... Done!
Extending equipment to dependency tests... Done!
Using 1024 bins per FFT...
Creating the None FFT window... Done!
Setting up CW from signal generator...
Computing f0 and CW frequencies...Done
SDR center frequency will be set to: 73.0MHz
Signal generator CW will be set to: 74.0MHz
Computing output power for the CW signal...Done!
Signal generator CW output power will be set to: -40dBm
Approximate power at SDR input will be: -40dBm
Configuring signal generator...
Tuning signal generator to 74.0MHz... Done!
Setting signal generator output power to -40dBm... Done!
Assuming the true power to be -40dBm...
Tuning SDR to 73.0MHz...
Requested f0: 73.0MHz
Actual f0: 73.0MHz
LO frequency: 73.0MHz
DSP frequency: -0.0MHz
Scale factor: -32.8505467404dBm
Turning on the signal generator RF output... Done!
Reading 1024000 samples after 10240 conditioning samples...Done!
Scaling IQ data with defined scale factor... Done!
Turning off the signal generator RF output... Done!
Computing the SDR measured power... Done!
Powering down siggen... Done!
Powering down sdr... Done!
Test completed in 3.6466960907s!
[Update with a plot]
Please note: some packages, including uhd
will output their own debug and info to the terminal which may cause additional output during runtime. However, only the above test will be output to the log file if a log file is being generated.
The detailed usage will depend on the test and your current setup. This guide will go over the detailed usage, including the built-in tests and the different equipment setups.
Additional functionality can be added to SDR calibrator through the drag-and-drop method. New equipment will be found as long as a driver for it exists in the designated equipment folder and new tests will be recognized as long as the test script is placed in the sdrcalibrator/lib/scripts
folder.
To use equipment aside from the small sampling included in SDR Calibrator, one has to write a short driver which will perform a few basic tasks using the interface for that piece of equipment. For example, the driver for the Agilent E8663B Signal Generator contains the tune_to_frequency
, set_power
, rf_on
, and rf_off
functions, among others, which use PyVisa to communicate these commands to the actual signal generator (specifically through the ethernet interface). The commands needed can typically be found in the datasheet or user manual for each piece of equipment. Examples of other interfaces include GPIB, USB, and serial.
Writing the driver for each piece of equipment is relatively simple and most easily done by copying an existing driver for a similar piece of equipment and modifying it. New types of equipment (for example, using a vector signal generator to output an arbitrary waveform) are not currently supported, but can be implemented using this procedure. To implement a new piece of equipment as one of the built-in categories, yadda yadda yadda... The categories are as follows (linking to a description of the driver and the subdirectory in sdrcalibrator/lib/equipment
where the driver need be stored):
- Software Defined Radio (sdr)
- Signal Generator (siggen)
- Power Meter (pwrmtr)
- RF Switch (switch)
- Programmable Attenuator (atten)
Creating a custom test script is fairly simple when running the built-in equipment types. To see the capabilities of the built-in equipment, please review them here. Additionally, this guide will go over how to write a custom test script.
Douglas Anderson | NTIA/Institute for Telecommunication Sciences | [email protected]
Todd Schumann | NTIA/Institute for Telecommunication Sciences | [email protected]
Copyright NTIA/Institute for Telecommunication Sciences. Released under GPL 3 - see LICENSE.