Main Content

Creating and Downloading an IQ Waveform to a RF Signal Generator

This example shows how to use the Quick-Control RF Signal Generator to generate and transmit RF waveforms.


In this example we will create an IQ waveform and transmit this waveform using the Quick-Control RF Signal Generator.


To run this example you need:

  • Keysight Technologies® N5172B signal generator

  • Keysight VISA version 17.3

  • IVI-C driver for Keysight Technologies N5172B signal generator

  • National Instruments™ IVI® compliance package version or higher

Create IQ waveform

We will create an IQ waveform that consists of two sinusoid signals with real and imaginary values.

When generating signals for the RF Signal Generator ensure that the waveform is a continuous row vector.

% Configure parameters for waveform.

% Number of points in the waveform
points = 1000;

% Determines the frequency offset from the carrier
cycles = 101;
phaseInc = 2*pi*cycles/points;
phase = phaseInc * (0:points-1);

% Create an IQ waveform
Iwave = cos(phase);
Qwave = sin(phase);
IQData = Iwave+1i*Qwave;
IQData = IQData(:)';

Create an RF Signal Generator Object

rf = rfsiggen();

Discover all the available instrument resources you can connect to, using the resources method.

ans =

    ' ASRL1::INSTR

Discover all the available instrument drivers, using drivers method.

ans =

    'Driver: AgRfSigGen_SCPI
     Supported Models:
     E4428C, E4438C
     Driver: RsRfSigGen_SCPI
     Supported Models:
     SMW200A, SMBV100A, SMU200A, SMJ100A, AMU200A, SMATE200A
     Driver: AgRfSigGen
     Supported Models:
     Driver: nisRFSigGen
     Supported Models:'

Connect to Signal Generator

Set Resource and Driver property before connecting to the object.

rf.Resource = '';
rf.Driver = 'AgRfSigGen';
% Connect to the instrument

Download the Waveform

Download the waveform, IQData to the instrument with sampling rate of 10MHz.

samplingRate = 10e6;
download(rf, IQData, samplingRate);

Transmit the Waveform

Transmit the downloaded waveform with center frequency of 1GHz and output power of 0dBm. Note these values are selected as reference values and is not intended to be recognized as standard values for transmitting any RF signals. Loop count represents the number of times the waveform should be repeated.

centerFrequency = 1e9;
outputPower = 0;
loopCount = Inf;
start(rf, centerFrequency, outputPower, loopCount);

Stop Transmitting the Waveform

Once you have finished transmitting the signal, stop the transmission.


Clean Up

Close the connection of the signal generator and remove it from the workspace.

clear rf