Technical data
146 Agilent Signal Generators Programming Guide
Programming Examples
LAN Programming Interface Examples
# Send identification query
print $sock "*IDN?\n";
$response = <$sock>;
chomp $response;
print "Instrument ID: $response\n";
TCP-IP (LAN) Programming Using Matlab
The examples in this section are meant to be used in one of three ways:
• Using a PSA to directly calculate and load an Equalization filter into the MXG. (This process can
be easily automated.)
1. Set up the PSA to measure the modulation.
2. Turn on the equalization filter.
3. Call loadPsaEqFilterFreq (example 1) in Matlab to read out the equalization channel response
over LAN via SCPI and calculate the correct equalization filter.
4. Call writeMxgFir (example 3) in Matlab to write out the equalization filter over LAN via SCPI
to the MXG.
• Manual process using the VSA 89600 software to measure the channel response, calculate the
correction equalization filter and load that filter into the MXG:
1. Setup to measure the modulation.
2. Turn on the equalization filter.
3. View the equalization channel response trace, either “Eq Ch Freq Resp” or “Eq Impls Resp”.
4. Save the trace as ".mat" file, with the header included.
5. Call loadVsaEqFilter (example 2) in Matlab to read the file and calculate a correction filter.
6. Call writeMxgFir (example 3) in Matlab to write out the equalization filter over LAN via SCPI
to the MXG.
• Takes a user created filter in Matlab—either an equalization filter or a modulation filter—and
writes it to a FIR file in the MXG.
This section contains the following examples:
1. “Example 1: Reading Out the Channel Response and Calculating Corrections for an Equalization
Filter Using Matlab”
2. “Example 2: Reading a VSA Trace and Setting up the Equalization Filter Using Matlab”
3. “Example 3: Downloading a FIR filter in Matlab to the MXG” on page 150
Example 1: Reading Out the Channel Response and Calculating Corrections for an Equalization Filter Using Matlab
This example reads out the channel response from a PSA and calculates a correction equalization
filter that can be loaded into the MXG.
The following program example is available on the signal generator Documentation CD- ROM as
loadPsaEQFilterFreq.m.
function [corrFilter] = loadPsaEqFilter(psaDev, destRate)