Trace Data Transfers
Applying Gain Correction Using the Memory Trace
Applying Gain Correction Using the
Memory Trace
The Corrected Memory array is filled with a copy of the Corrected Data array when the Data
−
> Memory operation is performed. By setting the analyzer to perform Data/Memory trace math, you can apply your own correction factor to the measurement data trace by filling the Corrected
Memory array with the appropriate complex numbers.
In general, you should use the analyzer's calibration feature to correct for errors in your system. However, there may be cases where you wish to simulate the effect of adding a cable in series with your DUT, and observe how this imaginary cable will attenuate the measured response versus frequency. Or you may wish to apply an absolute offset to simulate the effect of adding or removing a pad from the measurement.
These simulations are easily accomplished using the Corrected Memory array and the Data/Memory feature.
The Corrected Data and Memory arrays contain complex linear data, as opposed to logged data. When displaying the traces using Lin Mag format, the result of the Data divided by Memory operation (Data/Mem) will be to divide each point of the data trace by each point of the memory trace. When displaying data in Log Mag format, the result of
Data/Memory will be equivalent to subtracting the Log Mag value of the
Memory trace from that of the Data trace.
6-16 Programmer’s Guide
Trace Data Transfers
Applying Gain Correction Using the Memory Trace
The following example BASIC code segment shows how to download a complex array from your program to the analyzer's Memory trace. The program's "Mem" array is initialized with the proper values such that when the analyzer computes Data divided by Memory, the desired increasing gain will be applied.
100
110
120
130
140
150
160
170
180
190
200
210
220
230
240
250
260
270
280
290
300
310
320
REAL Mem(1:201,1:2)
ASSIGN @Hp8711 TO 716
! Fill memory array (denominator in Data/Mem)
! with values that will result in an
! upward sloping gain factor vs. frequency.
! Used to compensate for cable loss vs. frequency
! Adds 0 dB of gain at start freq; 3 dB at stop freq
FOR Pt=1 TO 201
Gain_factor_db=3.0*(Pt
−
1)/200 ! 0..3 dB Power
Gain_factor_lin=10^(Gain_factor_db/20)
Mem(Pt,1)=1.0/Gain_factor_lin ! real
Mem(Pt,2)=0.0
NEXT Pt
! imag
! Download to the memory trace
OUTPUT @Hp8711;"FORM:DATA ASCII"
OUTPUT @Hp8711;"TRACE:DATA CH1SMEM";
FOR Pt=1 TO 201
! Note the ";"
FOR I=1 TO 2
OUTPUT @Hp8711;",";Mem(Pt,I);
NEXT I
NEXT Pt
! Note the ";"
OUTPUT @Hp8711;"" ! Send linefeed
OUTPUT @Hp8711;"CALC1:MATH (IMPL/CH1SMEM)" ! Data/Mem
The example above downloads data to the corrected memory array. The data is sent by the program to the analyzer using ASCII encoding. The data is sent as ASCII characters, separated by commas. The analyzer accepts the comma separated list of numbers until it receives a linefeed to terminate the command. The program uses semicolons at the end of some OUTPUT statements to avoid sending a linefeed until all of the data has been sent. After the last number is sent, the program sends a linefeed, and the analyzer accepts the data.
Remember, for faster transfers, use binary data encoding instead of
ASCII.
Programmer’s Guide 6-17