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.
Introduction
在此示例中,我们将创建智商波形,并使用快速控制RF信号发生器传输此波形。
Requirements
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 16.0.1.2 or higher
创建IQ波形
我们将创建一个智商波形,该波形由两个具有真实值和想象值的正弦信号组成。
在生成RF信号发生器的信号时,请确保波形是连续的行矢量。
% Configure parameters for waveform.% Number of points in the waveformpoints = 1000;% Determines the frequency offset from the carrier周期= 101;phaseinc = 2*pi*循环/点;phase = epthinc *(0:points-1);% Create an IQ waveformIwave = 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资源
method.
RF.Resources
ans = ' ASRL1::INSTR ASRL3::INSTR ASRL::COM1 ASRL::COM3 PXI0::MEMACC TCPIP0::172.28.22.99::inst0::INSTR TCPIP0::A-N5172B-50283.dhcp.mathworks.com::inst0::INSTR TCPIP0::A-N9010A-21026.dhcp.mathworks.com::inst0::INSTR '
Discover all the available instrument drivers, usingdrivers
method.
rf.drivers
ans = 'Driver: AgRfSigGen_SCPI Supported Models: E4428C, E4438C Driver: RsRfSigGen_SCPI Supported Models: SMW200A, SMBV100A, SMU200A, SMJ100A, AMU200A, SMATE200A Driver: AgRfSigGen Supported Models: E4428C,E4438C,N5181A,N5182A,N5183A,N5171B,N5181B,N5172B N5182B,N5173B,N5183B,E8241A,E8244A,E8251A,E8254A,E8247C Driver: nisRFSigGen Supported Models:'
Connect to Signal Generator
SetResource
和Driver
财产之前连接到对象。
rf.Resource ='TCPIP0::A-N5172B-50283.dhcp.mathworks.com::inst0::INSTR'; rf.Driver ='AgRfSigGen';% Connect to the instrumentconnect(rf);
Download the Waveform
Download the waveform,iqdata
to the instrument with sampling rate of 10MHz.
samplingRate = 10e6; download(rf, IQData, samplingRate);
传输波形
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
传输信号后,停止传输。
停止(RF);
Clean Up
Close the connection of the signal generator and remove it from the workspace.
disconnect(rf); delete(rf); clearrf