You are on page 1of 25

MXG HELP

Agilent MXG Vector Signal Generator


Frequency range = 250kHz to 6GHz
Power Range = -110dBm to +17dBm

Notes
Where possible each "Set" Function has an equivielent "Get" function to enable the test code to read
the equipment state if required
The more complex functions are made entirely of the lower level functions. No high level function
contains text based machine specific commands.
This allows each high level function to be easily copied and conveted to a different machine driver.

** Basic Functions **
SetModePreset(obj)
SetRFOn(obj)
SetRFOff(obj)
SetFrequency(obj,Frequency)
Frequency=GetFrequency(obj)
SetRFLevel(obj,RFLevel)
RFLevel=GetRFLevel(obj)
SetIQAttenuation(obj,Attenuation)
Attenuation=GetIQAttenuation(obj)
SetModulationOn(obj)
SetModulationOff(obj)
ModulationState=GetModulationState(obj)
SetARBOn(obj)
SetARBOff(obj)
ARBState=GetARBState(obj)
SetARBSamplingFrequency(obj,ARBSamplingFrequency)

ARBSamplingFrequency=GetARBSamplingFrequency(obj)
GenLoadWaveIQBB(obj,Wave,Peak_Voltage,ARBSamplingFrequency,ArbFileName,Vcm)
PlayBBIQFile(obj,ArbFileName,ARBSamplingFrequency)
GenLoadWaveIQBB_noRescale(obj,Wave,ARBSamplingFrequency,ArbFileName,Vcm)
GenLoadWaveOBJ_RF(obj,WaveOBJ,varargin)
SetIQOptPath(obj,OptPath)
OptPath=GetIQOptPath(obj)
SetIQOutputCM(obj,CommonMode)
CommonMode=GetIQOutputCM(obj)
SetRuntimeScaling(obj,RuntimeScaling)
RuntimeScaling=GetRuntimeScaling(obj)

** Higher Level Functions **


ArbFileName=GenIQ_SineBB(obj,BBfreq,SamplingFrequency,Vpk,Vcm)
ArbFileName=GenIQ_SineRF(obj,RFfreq,RFlevel,BBfreq,SamplingFrequency,Vpk)
ArbFileName=GenIQ_TriangleBB(obj,BBfreq,SamplingFrequency,Vpk,Vcm)
ArbFileName=GenIQ_TriangleRF(obj,RFfreq,RFlevel,BBfreq,SamplingFrequency,Vpk)
ArbFileName=GenIQ_TwoToneBB(obj,BBfreq,SamplingFrequency,Vpk,Vcm,Phase)
ArbFileName=GenIQ_MultiToneBB(obj,BBfreq,SamplingFrequency,Vpk,Vcm,Phase)
ArbFileName=GenIQ_MultiToneRF(obj,RFfreq,RFlevel,BBfreq,SamplingFrequency,Vpk,Phase)
ArbFileName=GenIQ_MultiToneRF_Simple(obj,RFfreq,RFlevel,Phase)

MXA HELP
Agilent MXA Signal Analyser
Frequency Range = 20Hz to 3.6, 8.4, 13.6 or 26.5 GHz

Notes
Where possible each "Set" Function has an equivielent "Get" function to enable the test code to read
the equipment state if required

The more complex functions are made entirely of the lower level functions. No high level function
contains text based machine specific commands.
This allows each high level function to be easily copied and conveted to a different machine driver.

** Basic Functions **
function SetModePreset(obj)
function SetInstrumentFunction(obj,InstrumentFunction)
function InstrumentFunction=GetInstrumentFunction(obj)
function SetInputOutput(obj,InputOutput)
function InputOutput=GetInputOutput(obj)
function SetInputOutputType(obj,InputOutputType)
function InputOutputType=GetInputOutputType(obj)
function SetIQInputMode(obj,Mode)
function IQInputs=GetIQInputMode(obj)
function SetIQInputsImpedance(obj,Impedance)
function IQInputsImpedance=GetIQInputsImpedance(obj)
function SetIQInputsImpedancePlusMode(obj,Impedance,Mode)
function returned=GetIQInputsImpedancePlusMode(obj)
function SetIEqualQOn(obj)
function SetIEqualQOff(obj)
function returned=GetIEqualQ(obj)
function SetPowerReferenceImpedance(obj,Impedance)
function Impedance=GetPowerReferenceImpedance(obj)
function SetIChannelSkew(obj,NanoSecondsToSkew)
function NanoSecondsToSkew=GetIChannelSkew(obj)
function SetQChannelSkew(obj,NanoSecondsToSkew)
function NanoSecondsToSkew=GetQChannelSkew(obj)
function SetMeasurement(obj,Measurement)

function Measurement=GetMeasurement(obj)
function SetIQDisplay(obj,Display)
function Display=GetIQDisplay(obj)
function SetRFInputCouplingAC(obj)
function SetRFInputCouplingDC(obj)
function RFInputCoupling=GetRFInputCoupling(obj)
function AutoTuneFrequency(obj)
function SetCenterFrequency(obj,CenterFrequency)
function CenterFrequency=GetCenterFrequency(obj)
function SetStartFrequency(obj,StartFrequency)
function StartFrequency=GetStartFrequency(obj)
function SetStopFrequency(obj,StopFrequency)
function StopFrequency=GetStopFrequency(obj)
function SetCenterFrequencyStep(obj,StopFrequency)
function SetSpan(obj,FrequencySpan)
function FrequencySpan=GetSpan(obj)
function SetFullSpan(obj)
function SetRefLevel(obj,RefLevel)
function RefLevel=GetRefLevel(obj)
function SetRFAttenuation(obj,RFAttenuation)
function RFAttenuation=GetRFAttenuation(obj)
function SetRFAttenuationAuto(obj,On_Off)
function RFAttenuation=GetRFAttenuationAuto(obj)
function MaxMixerLevel=GetMixerLevel(obj)
function SetScale_Div(obj,Scale_Div)
function Scale_Div=GetScale_Div(obj)
function SetScaleTypeLin(obj)
function SetScaleTypeLog(obj)
function ScaleType=GetScaleType(obj)

function SetYAxisUnit(obj,YAxisUnit)
function YAxisUnit=GetYAxisUnit(obj)
function SetReferenceLevelOffset(obj,ReferenceLevelOffset)
function ReferenceLevelOffset=GetReferenceLevelOffset(obj)
function SetInternalPreampOff(obj)
function SetInternalPreampOnFull(obj)
function SetInternalPreampOnLow(obj)
function InternalPreamp=GetInternalPreamp(obj)
function SetTraceAverage(obj,varargin)
function SetTraceClearWrite(obj,varargin)
function SetTraceMaxHold(obj,varargin)
function SetTraceMinHold(obj,varargin)
function SetRBW(obj,ResolutionBandwidth)
function ResolutionBandwidth=GetRBW(obj)
function SetRBWAuto(obj,ON_OFF)
function Auto=GetRBWAuto(obj)
function SetRBWRatio(obj,RBWRatio)
function RBWRatio=GetRBWRatio(obj)
function SetVBW(obj,VideoBandwidth)
function VideoBandwidth=GetVBW(obj)
function SetVBWAuto(obj,ON_OFF)
function Auto=GetVBWAuto(obj)
function SetVBWRatio(obj,VBWRatio)
function VBWRatio=GetVBWRatio(obj)
function SetVideoCount(obj,VideoCount)
function VideoCount=GetVideoCount(obj)
function SetVideoRestart(obj)
function SetVideoAvOn(obj)
function SetVideoAvOff(obj)

function SetVideoMaxHoldOn(obj)
function SetVideoMaxHoldOff(obj)
function SetVideoMinHoldOn(obj)
function SetVideoMinHoldOff(obj)
function VideoType=GetVideoType(obj)
function SetSweepTime(obj,SweepTime)
function SweepTime=GetSweepTime(obj)
function SetSweepContOn(obj)
function SetSweepContOff(obj)
function InitiateSweep(obj)
function SweepPoints=GetSweepPoints(obj)
function SetSweepPoints(obj,SweepPoints)
function Marker=SetMarker(obj,Frequency,MarkerIndex)
function Marker=SetMarkerZeroSpan(obj,SwpTime,MarkerIndex)
function Marker=GetMarker(obj,MarkerIndex)
function Marker=SetMarkerOnPeak(obj)
function Marker=SetMarkerOnMin(obj)
function Marker=GetMarkerNextPeak(obj)
function Marker=GetMarkerNextRightPeak(obj)
function Marker=GetMarkerNextLeftPeak(obj)
function CenterFrequency=SetPeakToCenter(obj)
function RefLvl=SetRefLvlToMarker(obj,MarkerIndex)
function RelativeNoisePowerDensity=MeasureNoisePowerDensity(obj,OffsetFrequency,Band,varargin)
function SetMarkerFunction(obj,MarkerFunct)
function MarkerFunct=GetMarkerFunction(obj)
function SetMarkerBand(obj,MarkerBand)
function MarkerBand=GetMarkerBand(obj)
function SetMarkerBandZeroSpan(obj,MarkerBand)
function MarkerBand=GetMarkerBandZeroSpan(obj)

function DeleteMarker(obj,MarkerIndex)
function SpectrumSA=GetSpectrumSA(obj)
function SpectrumIQ=GetSpectrumIQ(obj,varargin)
function WaveTimeIQ=GetWaveTimeIQ(obj)
function SetNoiseSourceOn(obj)
function SetNoiseSourceOff(obj)
function DiodeState=GetNoiseSource(obj)

** Higher Level Functions **


** These are very useful high level functons and have been described in slighty more detail **
** Once these functions are in place engineers will rarely need the lower level functions above **

function Spectrum=GetSpectrumSARF_AllInOne(obj, varargin)


% Spectrum[struct] = GetSpectrumSARF_AllInOne(OptionalArguments)
% GetSpectrumSARF_AllInOne gets the RF spectrum from the Agilent MXA Signal Analyzer, where the
signal is connected to the RF input
%
% Optional inputs:
% DefConfig : [0/1] Configures the MXA to further defined settings while considering new settings (de
fault: 0)
% CF

: Center frequency in MHz (default: keep as configured if DefConfig=0 or if DefConfig=1 t


hen 2000MHz)

% FSpan : Frequency span in MHz (default: keep as configured if DefConfig=0 or if DefConfig=1 the
n 40MHz)
% FStart

: Start frequency in MHz -if FSpan is not defined-

% FStop

: Stop frequency in MHz -if FSpan is not defined-

% RefLevel : Reference level in dBm (default: keep as configured if DefConfig=0 or if DefConfig=1 th


en 0dBm)
% RBW
: Resolution bandwidth in kHz (default: keep as configured if DefConfig=0 or if DefConfig
=1 then 'Auto')

% RBWRatio : This overides the 'RBW' setting. RBW set to 'auto', RBW = Span / RBWRatio (default:
kee
p as configured if DefConfig=0 or if DefConfig=1 then 100)
% VBW
: Video bandwidth in kHz (default: keep as configured if DefConfig=0 or if DefConfig=1 th
en 'Auto')
% VBWRatio : This overides the 'VBW' setting. VBW set to 'auto', VBW = RBW / VBWRatio (default:
keep as configured if DefConfig=0 or if DefConfig=1 then 1)
% VideoCount : Video Average/Hold count (default: keep as configured if DefConfig=0 or if
DefConfig=1
then 10)
% DispMode : Display mode ['Write' 'Aver' 'MaxH' 'MinH'] (default: keep as configured if DefConfig=0
or if DefConfig=1 then 'Write')
% PlotSpectr : Plot spectrum after data capture, PlotSpectr=1 to plot spectrum, 0 will not plot (defau
lt: 0)
% RST

: [0/1] Preset MSA before measuring (default: 0)

%
% Examples
% Sprectrum = GetSpectrumSARF_AllInOne();
%

No default settings used, All settings will be kept as configured on instrument

% Sprectrum = GetSpectrumSARF_AllInOne('CF',2500,'FSpan',20',RefLevel',-10);
%

No default settings used, Settings not specified will be kept as configured on instrument

Specified settings will be applied, CentreFreq=2.5GHz, Span=20MHz, RefLvl=-10dBm

% Sprectrum = GetSpectrumSARF_AllInOne('DefConfig',1,'CF',2500,'FSpan',20',RefLevel',-10);
%

Default settings used, Settings not specified will be loaded with defualts as described above

Specified settings will be applied and will override defualt settings, CentreFreq=2.5GHz, Span=20
MHz, RefLvl=-10dBm

%
% Returned Structure
% Spectrum.Frequency[[double]] = Array of Frequencies [MHz], Spectrum X-Axis
% Spectrum.Amplitude[[double] = Array of Amplitudes [dBm], Spectrum Y-Axis
% Spectrum.RBW[double]

Resolution BW during spectrum capture [kHz]

% Spectrum.VBW[double]

Video BW during spectrum capture [kHz]

function Spectrum=GetSpectrumIQRF_AllInOne(obj, varargin)


% Spectrum = GetSpectrumIQRF_AllInOne(OptionalArguments)
% GetSpectrumIQRF_AllInOne gets the complex spectrum from the Agilent MXA Signal Analyzer (IQbasic
mode), where the signal is connected to the RF input
%
% Optional inputs:
% DefConfig : [0/1] Configures the MXA to further defined settings while considering new settings (de
fault: 0)
% CF

: Center frequency in MHz (default: keep as configured if DefConfig=0 or if DefConfig=1 t


hen 2000MHz)

% FSpan : Frequency span in MHz (default: keep as configured if DefConfig=0 or if DefConfig=1 the
n 40MHz)
% RefLevel : Reference level in dBm (default: keep as configured if DefConfig=0 or if DefConfig=1 th
en 0dBm)
% RBW
: Resolution bandwidth in kHz, Value overrides AutoCouple if set (default: keep as config
ured if DefConfig=0 or if DefConfig=1 then 'Auto')
% IFpath : Configures which IF path the signal flows, Options are 'Auto' 'B10M' 'B25M' 'B40M''B140
M' (default: keep as configured if DefConfig=0 or if DefConfig=1 then 'Auto')
% AutoCouple : Automatically couple multiple instrument settings, Options 'Auto' or 'None'(default: ke
ep as configured if DefConfig=0 or if DefConfig=1 then 'Auto')
% Trig
: Set trigger source, Options are 'IMM' 'VID 'LINE','EXT1', 'EXT2' 'RFB'' 'FRAM' 'IF' (de fault:
keep as configured if DefConfig=0 or if DefConfig=1 then 'IMM')
% AverSpectr : Capture RealTime or Averaged spectrum, AverSpectr=1 for Averaged, AverSpectr=0 for
Real
Time (default: 0)
% PlotSpectr : Plot spectrum after data capture, PlotSpectr=1 to plot spectrum, 0 will not plot (defau
lt: 0)
% RST

: [0/1] Preset MSA before measuring (default: 0)

%
% Examples
% Sprectrum = GetSpectrumIQRF_AllInOne();
%

No default settings used, All settings will be kept as configured on instrument

% Sprectrum = GetSpectrumIQRF_AllInOne('CF',2500,'FSpan',20',RefLevel',-10);
%

No default settings used, Settings not specified will be kept as configured on instrument

Specified settings will be applied, CentreFreq=2.5GHz, Span=20MHz, RefLvl=-10dBm

% Sprectrum = GetSpectrumIQRF_AllInOne('DefConfig',1,'CF',2500,'FSpan',20',RefLevel',-10);
%

Default settings used, Settings not specified will be loaded with defualts as described above

Specified settings will be applied and will override defualt settings, CentreFreq=2.5GHz, Span=20
MHz, RefLvl=-10dBm

%
% Returned Structure
% Spectrum.Frequency[[double]] = Array of Frequencies [MHz], Spectrum X-Axis
% Spectrum.Amplitude[[double] = Array of Amplitudes [dBm], Spectrum Y-Axis
% Spectrum.RBW[double]

Resolution BW during spectrum capture [kHz]

function Spectrum=GetSpectrumIQ_AllInOne(obj, varargin)


% Spectrum[struct] = GetSpectrumIQ_AllInOne(OptionalArguments)
% GetSpectrumIQ_AllInOne gets the complex spectrum from the Agilent MXA Signal Analyzer (IQbasic
mode), w
here the signal is connected to the IQ inputs
%
% Optional inputs:
% DefConfig : [0/1] Configures the MXA to further defined settings while considering new settings (de
fault: 0)
% CF

: Center frequency in MHz (default: keep as configured if DefConfig=0 or if DefConfig=1 t


hen 0MHz)

% FSpan : Frequency span in MHz (default: keep as configured if DefConfig=0 or if DefConfig=1 the
n 10MHz)
% RefLevel : Reference level in dBm (default: keep as configured if DefConfig=0 or if DefConfig=1 th
en 0dBm)

% RBW
: Resolution bandwidth in kHz, Value overrides AutoCouple if set (default: keep as config
ured if DefConfig=0 or if DefConfig=1 then 'Auto')
% IFpath : Configures which IF path the signal flows, Options are 'Auto' 'B10M' 'B25M' 'B40M''B140
M' (default: keep as configured if DefConfig=0 or if DefConfig=1 then 'Auto')
% AutoCouple : Automatically couple multiple instrument settings, Options 'Auto' or 'None'(default: ke
ep as configured if DefConfig=0 or if DefConfig=1 then 'Auto')
% Trig

: Set trigger source, Options are 'EXT1' 'EXT2' 'IMMe' 'IQM' 'IDEM' ' QDEM' 'IINP' 'QINP'
'AIQM' (default: keep as configured if DefConfig=0 or if DefConfig=1 then 'IMM')

% IQmode : IQ Input Mode, 'Unbal', 'Bal' (default: keep as configured if DefConfig=0 or if DefConf
ig=1 then 'Bal')
% IQimped : IQ Input Impedance, 50, 1e6 [Ohms] (default: keep as configured if DefConfig=0 or if De
fConfig=1 then 50)
% IQtype : IQ Input Type, 'IQ' 'IONLy' 'QONLy' 'IND' (default: keep as configured if DefConfig=0 o
r if DefConfig=1 then 'IQ')
% AverSpectr : Capture RealTime or Averaged spectrum, AverSpectr=1 for Averaged, AverSpectr=0 for
Real
Time (default: 0)
% PlotSpectr : Plot spectrum after data capture, PlotSpectr=1 to plot spectrum, 0 will not plot (defau
lt: 0)
% RST

: [0/1] Preset MSA before measuring (default: 0)

%
% Examples
% Sprectrum = GetSpectrumIQ_AllInOne();
%

No default settings used, All settings will be kept as configured on instrument

% Sprectrum = GetSpectrumIQ_AllInOne('CF',2500,'FSpan',20',RefLevel',-10);
%

No default settings used, Settings not specified will be kept as configured on instrument

Specified settings will be applied, CentreFreq=2.5GHz, Span=20MHz, RefLvl=-10dBm

% Sprectrum = GetSpectrumIQ_AllInOne('DefConfig',1,'CF',2500,'FSpan',20',RefLevel',-10);
%

Default settings used, Settings not specified will be loaded with defualts as described above

Specified settings will be applied and will override defualt settings, CentreFreq=2.5GHz, Span=20
MHz, RefLvl=-10dBm

%
% Returned Structure

% Spectrum.Frequency[[double]] = Array of Frequencies [MHz], Spectrum X-Axis


% Spectrum.Amplitude[[double] = Array of Amplitudes [dBm], Spectrum Y-Axis
% Spectrum.RBW[double]

= Resolution BW during spectrum capture [kHz]

function Peak=PeakSearchSARF_AllInOne(obj, varargin)


% Peak[struct] = PeakSearchSARF_AllInOne(OptionalArguments)
% PeakSearchSARF_AllInOne searches for a peak in the RF spectrum in the Agilent MXA Signal Analyzer,
wher e the RF signal is connected to the RF input
% Some care is needed when running this function to ensure there is at least a small peak above the
noise floor for the function to initally find
% The default settings are capable of finding a signal as low as -90dBm, for lower level signals a lower
'Initial_FSpan' or higher 'RBWRatio' would be advisable
%
% Optional inputs:
% DefConfig
: [0/1] Configures the MXA to further defined settings while considering new sett
ings (default: 0)
% Initial_CF
: Center frequency in MHz (default: keep as configured if DefConfig=0 or if DefCo
nfig=1 then 2000MHz)
% Initial_FSpan : Frequency span in MHz (default: keep as configured if DefConfig=0 or if DefConf
ig=1 then 1MHz)
% Initial_FStart

: Start frequency in MHz -if FSpan is not defined-

% Initial_FStop

: Stop frequency in MHz -if FSpan is not defined-

% Initial_RefLevel : Reference level in dBm (default: keep as configured if DefConfig=0 or if DefCon


fig=1 then 0dBm)
% NoRefLvlReset

: Disables SetRefLvlToMarker during peak search (default: 0)

% MaxNumIters

: Number of zoom interations to descend during search (default: 5)

% SpanRatio

: Span change per zoom interation, specified as a fraction (default: 0.2)

% Convergence
: Set convergance criteria to end search if peak found, Specifies the minimum Pea
k to NoiseFloor in dB (default: 20)

% RBW
: Resolution bandwidth in kHz, Care should be taken when this is specified as it will fix
the RBW for all zoom iterations (Better to RBWRatio below) (default: keep as configured if DefConfig=0
or if DefConfig=1 then 'Auto')
% RBWRatio
: This overides the 'RBW' setting. RBW set to 'auto', RBW = Span / RBWRatio (defa
ult: keep as configured if DefConfig=0 or if DefConfig=1 then 100)
% VBW
: Video bandwidth in kHz (default: keep as configured if DefConfig=0 or if DefCon
fig=1 then 'Auto')
% VBWRatio
: This overides the 'VBW' setting. VBW set to 'auto', VBW = RBW / VBWRatio (defau
lt: keep as configured if DefConfig=0 or if DefConfig=1 then 1)
% VideoCount
: Video Average/Hold count (default: keep as configured if DefConfig=0 or if DefC
onfig=1 then 10)
% DispMode
: Display mode ['Write' 'Aver' 'MaxH' 'MinH'] (default: keep as configured if Def
Config=0 or if DefConfig=1 then 'Write')
% RST

: [0/1] Preset MSA before measuring (default: 0)

%
% Examples
% Peak = PeakSearchSARF_AllInOne();
%

No default settings used, All settings will be kept as configured on instrument

% Peak = PeakSearchSARF_AllInOne('Initial_CF',2500,'Initial_FSpan',20','MaxNumIters',10);
%

No default settings used, Settings not specified will be kept as configured on instrument

%
set

Specified settings will be applied, CentreFreq=2.5GHz, Span=20MHz, Max Number of interations


to 10

% Peak =
PeakSearchSARF_AllInOne('DefConfig',1,'Initial_CF',2500,'Initial_FSpan',20','MaxNumIters',10);
%

Default settings used, Settings not specified will be loaded with defaults as described above

%
set

Specified settings will be applied, CentreFreq=2.5GHz, Span=20MHz, Max Number of interations


to 10

%
% Returned Structure
% Peak.Amplitude

= Amplitude of Peak [dBm]

% Peak.Frequency

= Frequency of Peak [MHz]

% Peak.Name

= Returns 'Void Marker' if search unsuccessful

% Peak.FloorAmplitude = Amplitude spectrum floor 3xRBW away from peak [dBm]


% Peak.NumIters

= Number of iterations to acheive convergange criteria

% Peak.FinalSpan

= Value of final span after peak search complete [MHz]

% Peak.FinalRBW

= Value of final RBW after peak search complete [kHz]

function Peak=PeakSearchIQRF_AllInOne(obj, varargin)


% Peak[struct] = PeakSearchIQRF_AllInOne(OptionalArguments)
% PeakSearchIQRF_AllInOne searches for a peak in the RF complex spectrum in the Agilent MXA Signal
Analyz er, where the RF signal is connected to the RF input
% Some care is needed when running this function to ensure there is at least a small peak above the
noise floor for the function to initally find
% The default settings are capable of finding a signal as low as -90dBm, for lower level signals a lower
'Initial_FSpan' or higher 'RBWRatio' would be advisable
%
% Optional inputs:
% DefConfig
: [0/1] Configures the MXA to further defined settings while considering new sett
ings (default: 0)
% Initial_CF
: Center frequency in MHz (default: keep as configured if DefConfig=0 or if DefCo
nfig=1 then 2000MHz)
% Initial_FSpan : Frequency span in MHz (Max 25MHz)(default: keep as configured if DefConfig=0 or
if DefConfig=1 then 1MHz)
% Initial_RefLevel : Reference level in dBm (default: keep as configured if DefConfig=0 or if DefCon
fig=1 then 0dBm)
% MaxNumIters
% SpanRatio

: Number of zoom interations to descend during search (default: 5)


: Span change per zoom interation, specified as a fraction (default: 0.2)

% Convergence
: Set convergance criteria to end search if peak found, Specifies the minimum Pea
k to NoiseFloor in dB (default: 20)

% RBW
: Resolution bandwidth in kHz, Care should be taken when this is specified as it will fix
the RBW for all zoom iterations (Better to RBWRatio below) (default: keep as configured if DefConfig=0
or if DefConfig=1 then 'Auto')
% IFpath
: Configures which IF path the signal flows, Options are 'Auto' 'B10M' 'B25M' 'B4
0M''B140M' (default: keep as configured if DefConfig=0 or if DefConfig=1 then 'Auto')
% AutoCouple
: Automatically couple multiple instrument settings, Options 'Auto' or 'None'(def
ault: keep as configured if DefConfig=0 or if DefConfig=1 then 'Auto')
% Trig
: Set trigger source, Options are 'IMM' 'VID 'LINE','EXT1', 'EXT2' 'RFB'' 'FRAM'
(default: keep as configured if DefConfig=0 or if DefConfig=1 then 'IMM')
% RST

'IF'

: [0/1] Preset MSA before measuring (default: 0)

%
% Examples
% Peak = PeakSearchIQRF_AllInOne();
%

No default settings used, All settings will be kept as configured on instrument

% Peak = PeakSearchIQRF_AllInOne('Initial_CF',2500,'Initial_FSpan',20','MaxNumIters',10);
%

No default settings used, Settings not specified will be kept as configured on instrument

%
set

Specified settings will be applied, CentreFreq=2.5GHz, Span=20MHz, Max Number of interations


to 10

% Peak =
PeakSearchIQRF_AllInOne('DefConfig',1,'Initial_CF',2500,'Initial_FSpan',20','MaxNumIters',10);
%

Default settings used, Settings not specified will be loaded with defaults as described above

%
set

Specified settings will be applied, CentreFreq=2.5GHz, Span=20MHz, Max Number of interations


to 10

%
% Returned Structure
% Peak.Amplitude

= Amplitude of Peak [dBm]

% Peak.Frequency

= Frequency of Peak [MHz]

% Peak.Name

= Returns 'Void Marker' if search unsuccessful

% Peak.FloorAmplitude = Amplitude spectrum floor 3xRBW away from peak [dBm]


% Peak.NumIters

= Number of iterations to acheive convergange criteria

% Peak.FinalSpan

= Value of final span after peak search complete [MHz]

% Peak.FinalRBW

= Value of final RBW after peak search complete [kHz]

function Peak=PeakSearchIQ_AllInOne(obj, varargin)


% Peak[struct] = PeakSearchIQRF_AllInOne(OptionalArguments)
% PeakSearchIQRF_AllInOne searches for a peak in the RF complex spectrum in the Agilent MXA Signal
Analyz er, where the signal is connected through the IQ inputs
% Some care is needed when running this function to ensure there is at least a small peak above the
noise floor for the function to initally find
% The default settings are capable of finding a signal as low as -90dBm, for lower level signals a lower
'Initial_FSpan' or higher 'RBWRatio' would be advisable
%
% Optional inputs:
% DefConfig
: [0/1] Configures the MXA to further defined settings while considering new sett
ings (default: 0)
% Initial_CF
: Center frequency in MHz (default: keep as configured if DefConfig=0 or if DefCo
nfig=1 then 2000MHz)
% Initial_FSpan : Frequency span in MHz (Max 25MHz)(default: keep as configured if DefConfig=0 or
if DefConfig=1 then 1MHz)
% Initial_RefLevel : Reference level in dBm (default: keep as configured if DefConfig=0 or if DefCon
fig=1 then 0dBm)
% MaxNumIters
% SpanRatio

: Number of zoom interations to descend during search (default: 5)


: Span change per zoom interation, specified as a fraction (default: 0.2)

% Convergence
: Set convergance criteria to end search if peak found, Specifies the minimum Pea
k to NoiseFloor in dB (default: 20)
% RBW
: Resolution bandwidth in kHz, Care should be taken when this is specified as it will fix
the RBW for all zoom iterations (Better to RBWRatio below) (default: keep as configured if DefConfig=0
or if DefConfig=1 then 'Auto')
% IFpath
: Configures which IF path the signal flows, Options are 'Auto' 'B10M' 'B25M' 'B4
0M''B140M' (default: keep as configured if DefConfig=0 or if DefConfig=1 then 'Auto')
% AutoCouple
: Automatically couple multiple instrument settings, Options 'Auto' or 'None'(def
ault: keep as configured if DefConfig=0 or if DefConfig=1 then 'Auto')

% Trig
: Set trigger source, Options are 'EXT1' 'EXT2' 'IMMe' 'IQM' 'IDEM' ' QDEM' 'IINP ' 'QINP'
'AIQM' (default: keep as configured if DefConfig=0 or if DefConfig=1 then 'IMM')
% IQmode
: IQ Input Mode, 'Unbal', 'Bal' (default: keep as configured if DefConfig=0 or if
DefConfig=1 then 'Bal')
% IQimped
: IQ Input Impedance, 50, 1e6 [Ohms] (default: keep as configured if DefConfig=0
or if DefConfig=1 then 50)
% IQtype
: IQ Input Type, 'IQ' 'IONL' 'QONL' 'IND' (default: keep as configured if DefConf ig=0 or
if DefConfig=1 then 'IQ')
% RST

: [0/1] Preset MSA before measuring (default: 0)

%
% Examples
% Peak = PeakSearchIQ_AllInOne();
%

No default settings used, All settings will be kept as configured on instrument

% Peak = PeakSearchIQ_AllInOne('Initial_CF',2500,'Initial_FSpan',20','MaxNumIters',10);
%

No default settings used, Settings not specified will be kept as configured on instrument

%
set

Specified settings will be applied, CentreFreq=2.5GHz, Span=20MHz, Max Number of interations


to 10

% Peak = PeakSearchIQ_AllInOne('DefConfig',1,'Initial_CF',2500,'Initial_FSpan',20','MaxNumIters',10);
%

Default settings used, Settings not specified will be loaded with defaults as described above

%
set

Specified settings will be applied, CentreFreq=2.5GHz, Span=20MHz, Max Number of interations


to 10

%
% Returned Structure
% Peak.Amplitude

= Amplitude of Peak [dBm]

% Peak.Frequency

= Frequency of Peak [MHz]

% Peak.Name

= Returns 'Void Marker' if search unsuccessful

% Peak.FloorAmplitude = Amplitude spectrum floor 3xRBW away from peak [dBm]


% Peak.NumIters

= Number of iterations to acheive convergange criteria

% Peak.FinalSpan

= Value of final span after peak search complete [MHz]

% Peak.FinalRBW

= Value of final RBW after peak search complete [kHz]

function Wave=GetWaveTimeIQRF_AllInOne(obj, varargin)


% Wave[struct] = GetWaveTimeIQRF_AllInOne(OptionalArguments)
% GetWaveTimeIQRF_AllInOne gets the Demodulated IQ Time Domain Waveforms from the Agilent
MXA Signal Anal
yzer (IQbasic mode), where the signal is connected to the RF input
%
% Optional inputs:
% DefConfig : [0/1] Configures the MXA to further defined settings while considering new settings (de
fault: 0)
% CF

: Center frequency in MHz (default: keep as configured if DefConfig=0 or if DefConfig=1 t


hen 2000MHz)

% CaptureTime: Capture time period to sample wave over in ms (default: keep as configured if
DefConfig
=0 or if DefConfig=1 then 1ms)
% IFpath : Configures which IF path the signal flows, Options are 'Auto' 'B10M' 'B25M' 'B40M''B140
M' (default: keep as configured if DefConfig=0 or if DefConfig=1 then 'Auto')
% IFBWdig : Digital IF BW setting in MHz, If IFpath set to 'Auto' appropriate path will be selected
(default: keep as configured if DefConfig=0 or if DefConfig=1 then 1MHz)
% AutoCouple : Automatically couple multiple instrument settings, Options 'All' or 'None'(default: kee
p as configured if DefConfig=0 or if DefConfig=1 then 'Auto')
% Trig
: Set trigger source, Options are 'IMM' 'VID 'LINE','EXT1', 'EXT2' 'RFB' 'FRAM' 'IF' (def ault:
keep as configured if DefConfig=0 or if DefConfig=1 then 'IMM')
% PlotWave : Plot wave after data capture, PlotSpectr=1 to plot spectrum, 0 will not plot (default:
0)
% RST

: [0/1] Preset MSA before measuring (default: 0)

RefLevel

: Set the reference Level

Scale_Div

: Sets the Scale per division

%
% % Examples
% Wave = GetWaveTimeIQ_AllInOne();
%

No default settings used, All settings will be kept as configured on instrument

% Wave = GetWaveTimeIQ_AllInOne('CF',2500,'CaptureTime',2,'Trig','EXT1');
%

No default settings used, Settings not specified will be kept as configured on instrument

Specified settings will be applied, CentreFreq=2.5GHz, Capture 2ms of data, Trigger off External
1

% Wave = GetWaveTimeIQ_AllInOne('DefConfig',1,'CF',2500,'CaptureTime',2,'Trig','EXT1');
%

Default settings used, Settings not specified will be loaded with defaults as described above

Specified settings will be applied, CentreFreq=2.5GHz, Capture 2ms of data, Trigger set to Extern
al 1

%
% Returned Structure
% Wave.Iamplitude[[double]] - I Amplitude Array (V)
% Wave.Qamplitude[[double]] - Q Amplitude Array (V)
% Wave.Time[[double]] - Time Array (s)

function Wave=GetWaveTimeIQ_AllInOne(obj, varargin)


% Wave[struct] = GetWaveTimeIQ_AllInOne(OptionalArguments)
% GetWaveTimeIQ_AllInOne gets the Demodulated IQ Time Domain Waveforms from the Agilent MXA
Signal Analyz er (IQbasic mode), where the signal is connected to the IQ inputs
%
% Optional inputs:
% DefConfig : [0/1] Configures the MXA to further defined settings while considering new settings (de
fault: 0)
% CF

: Center frequency in MHz (default: keep as configured if DefConfig=0 or if DefConfig=1 t


hen 2000MHz)

% CaptureTime: Capture time period to sample wave over in ms (default: keep as configured if
DefConfig
=0 or if DefConfig=1 then 1ms)
% IFpath : Configures which IF path the signal flows, Options are 'Auto' 'B10M' 'B25M' 'B40M''B140
M' (default: keep as configured if DefConfig=0 or if DefConfig=1 then 'Auto')

% IFBWdig : Digital IF BW setting in MHz, If IFpath set to 'Auto' appropriate path will be selected
(default: keep as configured if DefConfig=0 or if DefConfig=1 then 1MHz)
% AutoCouple : Automatically couple multiple instrument settings, Options 'Auto' or 'None'(default: ke
ep as configured if DefConfig=0 or if DefConfig=1 then 'Auto')
% IQmode : IQ Input Mode, 'Unbal', 'Bal' (default: keep as configured if DefConfig=0 or if DefConf
ig=1 then 'Bal')
% IQimped : IQ Input Impedance, 50, 1e6 [Ohms] (default: keep as configured if DefConfig=0 or if D
efConfig=1 then 50)
% IQtype : IQ Input Type, 'IQ' 'IONL' 'QONL' 'IND' (default: keep as configured if DefConfig=0 or
if DefConfig=1 then 'IQ')
% Trig

: Set trigger source, Options are 'IMM' 'EXT1' 'EXT2' 'IQM' 'IDEM' 'QDEM' 'IINP' 'QINP' '
AIQM' (default: keep as configured if DefConfig=0 or if DefConfig=1 then 'IMM')

% PlotWave : Plot wave after data capture, PlotSpectr=1 to plot spectrum, 0 will not plot (default:
0)
% RST

: [0/1] Preset MSA before measuring (default: 0)

%
% Examples
% Wave = GetWaveTimeIQ_AllInOne();
%

No default settings used, All settings will be kept as configured on instrument

% Wave = GetWaveTimeIQ_AllInOne('CF',2500,'CaptureTime',2,'Trig','EXT1');
%

No default settings used, Settings not specified will be kept as configured on instrument

Specified settings will be applied, CentreFreq=2.5GHz, Capture 2ms of data, Trigger off External
1

% Wave = GetWaveTimeIQ_AllInOne('DefConfig',1,'CF',2500,'CaptureTime',2,'IQmode','UnBal');
%

Default settings used, Settings not specified will be loaded with defaults as described above

Specified settings will be applied, CentreFreq=2.5GHz, Capture 2ms of data, IQ inputs set to UnBa
lanced

%
% Returned Structure
% Wave.Iamplitude[[double]] - I Amplitude Array (V)
% Wave.Qamplitude[[double]] - Q Amplitude Array (V)
% Wave.Time[[double]] - Time Array (s)

function NoiseFloor=NoiseFloorSearchSARF_AllInOne(obj, varargin)


% NoiseFloor[struct] = NoiseFloorSearchSARF_AllInOne(OptionalArguments)
% NoiseFloorSearchSARF_AllInOne searches for the noise floor in the RF spectrum in the Agilent MXA
Signal Analyzer, where the RF signal is connected to the RF input
% The noise band marker is used and hence the RBW is accounted for, FloorAmplitude is returned in
dBm/Hz
%
% Optional inputs:
% DefConfig
: [0/1] Configures the MXA to further defined settings while considering new sett
ings (default: 0)
% CF
: Center frequency in MHz (default: keep as configured if DefConfig=0 or if DefCo nfig=1
then 2000MHz)
% MkrBand
: Marker band to avgerage noise floor over in MHz (default: keep as configured if
DefConfig=0 or if DefConfig=1 then 1MHz)
% Initial_RefLevel : Reference level in dBm (default: keep as configured if DefConfig=0 or if DefCon
fig=1 then 0dBm)
% RefLevMargin
: Set convergance criteria to end search if noise floor found, Specifies the mini
mum Noise Floor to RefLevel in dB (default: 30)
% RBW
: Resolution bandwidth in kHz (default: keep as configured if DefConfig=0 or if D
efConfig=1 then 'Auto')
% RBWRatio
: This overides the 'RBW' setting. RBW set to 'auto', RBW = Span / RBWRatio (defa
ult: keep as configured if DefConfig=0 or if DefConfig=1 then 100)
% VBW
: Video bandwidth in kHz (default: keep as configured if DefConfig=0 or if DefCon
fig=1 then 'Auto')
% VBWRatio
: This overides the 'VBW' setting. VBW set to 'auto', VBW = RBW / VBWRatio (defau
lt: keep as configured if DefConfig=0 or if DefConfig=1 then 1)
% AvgCount
: Video Average/Hold count (default: keep as configured if DefConfig=0 or if DefC
onfig=1 then 10)

% DispMode
: Display mode ['Write' 'Aver' 'MaxH' 'MinH'] (default: keep as configured if Def
Config=0 or if DefConfig=1 then 'Write')
% RST

: [0/1] Preset MSA before measuring (default: 0)

%
% Examples
% NoiseFloor = NoiseFloorSearchSARF_AllInOne();
%

No default settings used, All settings will be kept as configured on instrument

% NoiseFloor = NoiseFloorSearchSARF_AllInOne('CF',2500,'MkrBand',20');
%

No default settings used, Settings not specified will be kept as configured on instrument

Specified settings will be applied, CentreFreq=2.5GHz, MarkerBand=20MHz

% NoiseFloor = NoiseFloorSearchSARF_AllInOne('DefConfig',1,'CF',2500,'MrkBand',20');
%

Default settings used, Settings not specified will be loaded with defaults as described above

Specified settings will be applied, CentreFreq=2.5GHz, MarkerBand=20MHz

%
% Returned Structure
% NoiseFloor.Amplitude

= Amplitude of Noise Floor [dBm]

% NoiseFloor.Frequency

= Centre Frequency of Noise Floor measurement [MHz]

% NoiseFloor.Name

= Returns 'Void Marker' if search unsuccessful

% NoiseFloor.FinalRefLevel =

Value of final RBW after peak search complete [kHz]

% NoiseFloor.BandPeak

Maximum peak signal in the marker band [dBm]

% NoiseFloor.BandMin
=
Minimum signal in the marker band [dBm] (BandMax and BandMin can
be use d to ensure no spurs are contained within noise floor measurement)

E3646A Help
Agilent 2 channel Power Supply
+8V ch1
+8V ch2

Notes
Where possible each Set Function has an equivielent Get function to enable the test code to read the
equipment state if required
The more complex functions are made entirely of the lower level functions. No high level function
contains text based machine specific commands.
This allows each high level function to be easily copied and conveted to a different machine driver.

** Basic Functions **
function SetModePreset(obj)
function Ch1_Select(obj)
function Ch2_Select(obj)
function OutputOn(obj)
function OutputOff(obj)
function OutState=GetOutput(obj)
function Voltage=GetVoltage(obj)
function SetCurrent(obj,Current)
function Current=GetCurrent(obj)
function SetVoltageCurrent(obj,Voltage,Current)
function Setting=GetVoltageCurrent(obj)
function Current=MeasureCurrent(obj)
function Voltage=MeasureVoltage(obj)
function SetCurrentRange_mA(obj)
function SetCurrentRange_A(obj)

function Ch1_SetVoltage(obj,Voltage)
function Voltage=Ch1_GetVoltage(obj)
function Ch1_SetCurrent(obj,Current)
function Current=Ch1_GetCurrent(obj)
function Ch1_SetVoltageCurrent(obj,Voltage,Current)
function Setting=Ch1_GetVoltageCurrent(obj)
function Current=Ch1_MeasureCurrent(obj)
function Voltage=Ch1_MeasureVoltage(obj)
function Ch2_SetVoltage(obj,Voltage)
function Voltage=Ch2_GetVoltage(obj)
function Ch2_SetCurrent(obj,Current)
function Current=Ch2_GetCurrent(obj)
function Ch2_SetVoltageCurrent(obj,Voltage,Current)
function Setting=Ch2_GetVoltageCurrent(obj)
function Current=Ch2_MeasureCurrent(obj)
function Voltage=Ch2_MeasureVoltage(obj)

You might also like