U9361C/F/G/M RCal Receiver Calibrator Measurement Guide
59
Programming with MATLAB
% Connect to the instruments
fopen(my_SA);
fopen(my_SG);
% get instrument identification to make sure we are speaking with the
% devices
query(my_SA,'*idn?');
query(my_SG,'*idn?');
% Assumes X-Series Signal Analyzer has desired measurement parameters set in VMA, IF
Gain Auto
center_frequency = query(my_SA, ':FREQ:CENT?')
mech_atten = query(my_SA, ':POW:ATT?')
preamp = query(my_SA, ':POW:GAIN:BAND?')
preamp_enable = query(my_SA, ':POW:GAIN?')
elec_atten = query(my_SA, ':POW:EATT?')
coupling = query(my_SA, ':INP:COUP?')
uW_path = query(my_SA, ':POW:MW:PATH?')
fprintf(my_SA, ':DDEM:IF:GAIN:AUTO ON')
IF_gain = query(my_SA, ':DDEM:IF:GAIN:AUTO?')
pno = query(my_SA, 'DDEM:FREQ:SYNT?') %Phase Noise Offset
% IF path, Start and Stop Frequency, is determined by the IF BW
% Determine IF path given IF BW
Info_BW = query(my_SA, 'DDEM:BAND?')
Info_BW_num = str2num(Info_BW)
if Info_BW_num <= 10E6
IF_path = 'B10M'
elseif Info_BW_num > 10E6 && Info_BW_num <= 25E6
IF_path = 'B25M'
elseif Info_BW_num > 25E6 && Info_BW_num <= 40E6
IF_path = 'B40M'
elseif Info_BW_num > 40E6 && Info_BW_num <= 160E6
IF_path = 'B160M'
elseif Info_BW_num > 160E6 && Info_BW_num <= 255E6
IF_path = 'B255M'
elseif Info_BW_num > 255E6 && Info_BW_num <= 510E6
IF_path = 'B510M'
elseif Info_BW_num > 510E6 && Info_BW_num <= 1000E6
IF_path = 'B100M'
end
% Assume Single-Carrier (Add additional frequency range for OFDM)
center_frequency_num = str2num(center_frequency)
freq_start = num2str(center_frequency_num)
freq_stop = num2str(center_frequency_num)
% Now populate an RCal State with the instrument parameters
fprintf(my_SA, ':SYST:CAL:CGR %d', cal_group)