Although some trace manipulations were alluded to in the previous section, there are considerable trace computation capabilities that warrant further discussion. The simplest of these is TraceMemMath where some operation (addition, subtraction, multiplication or division) is applied between current trace data and that stored in trace memory for that trace. Some points of interest:
• The math is always applied on the basic, linear complex numbers….not on the displayed, formatted numbers.
• Example: The trace is formatted as log mag + phase, the first data point is plotted at 20 dB, 0 degrees and the first memory point is plotted as 40 dB, 90 degrees. Data(/)Memory is selected. This will be computed as (10+j0)/(0+j100)=-j0.1. The result will be displayed as –20 dB, –90 degrees.
• It does not matter if the entire complex value is being presently displayed (e.g., a real-only graph type), the math will be applied to the entire complex number.
• If the user is commonly using log mag graph types, the math may appear counter-intuitive. If one is measuring S21 with a thru line connected, stores data to memory and selects Data(/)Memory, the immediate result is a flat line near 0 dB since one is dividing current data by something very similar (hence close to 1 in linear terms). If one selects Data(–)Memory, the result will be bouncing near the noise floor since now one is plotting the 20*log10(|X–Y|) where X and Y are nearly identical.
• The math is applied after smoothing.
• The math may be applied before or after group delay, depending on the user selection for order of operations (this matters since group delay is computed as a derivative of phase, so if trace match comes first, it acts on phase).
The math is applied before self-normalization (as used in gain compression).
Now that the math is defined, the trace memory behavior needs to be discussed. Historically, Anritsu VNAs had one memory associated with each trace and they were not accessible from other traces or channels. If the number of points is changed, a stored memory will not be available (but will again be available if the number of points is changed back). Trace memory data (formatted or not) can be saved or recalled into that same trace memory location.
Now there is a more flexible definition where there are 20 trace memories per channel and they can be shared amongst the traces. The point count rules are unchanged. The default behavior is the same as the historic model in that a store operation from trace X will be to memory location X and, by default, TraceMemMath will use memory location X. The control dialog is shown in Figure: Memory Trace Configuration Dialog Box.
Memory Trace Configuration Dialog Box
The matrix in the upper portion of the dialog controls which memories are visible in the current trace (current trace denoted in the title of the dialog) when the display selection is either Memory or Data and Memory. Each box is a toggle button to display or not display the memory and a given button will only be active if something has been stored in that location. The trace where that stored data originally came from will be shown in parentheses (the first two memory locations have data originally from trace 1 and the third location contains data originally from trace 3 in the above example).
The Memory Math pull-down selects which memory will be used for a math operation of the form DataMemMath (discussed previously). The various locations will only be available if something has been stored in that location.
The Store To Memory Configuration section controls what happens when Store Data To Memory is selected. The default is to use the last used location. Thus if this dialog has not been used, it will default to using the location with the same number as the active trace. Another choice is to force a location selection dialog to appear every time data is stored. The final choice is to sequence through all of the memories beginning with the last used location for that trace. This selection is handy when one wants to capture evolutionary data from a DUT (with time, bias conditions, etc.) and it is inconvenient to save data to a discrete file each time. Note that when the 20 locations have been used up with this approach, the oldest stored information will be overwritten and the saving will continue cyclically.
Finally, certain tasks can only deal with one memory per trace so a ‘dominant’ memory can be selected for the active trace. One of these tasks groups are marker operations on memory (searching for targets, etc.). Another task group is saving and recalling of trace memory information (formatted or unformatted). These dominant memory locations default to the same numbered location as the current active trace and can be selected independently for the two task groups.
Inter-trace Math
This function allows one to combine measurements from two traces into a result to be plotted in a third trace position. In the Simple Operation mode, the concept is very similar to trace math just discussed, the available operators are the same and the operations again occur on the base, linear complex value. The difference is that the input variables can come from different traces (with completely different S-parameters or user-defined parameters) and can even be based on trace math in that different trace (hence the Type selection in the menu shown in Figure: Inter-trace Math Menu).
Inter-trace Math Menu
Depending on the ‘Calculation To Use’ selection, either a simple (+ - * /) operation set with two arguments is allowed (Simple Operation) or a much more complete set of operations and arguments are possible (Equation Editor).
An example could be someone wanting to measure S21/S12 for a device as a measure of reciprocity (e.g., the device is an isolator). If trace 1 was configured as S21 and trace 2 was configured as S12, then the above settings for the Simple Operation would allow a display of the ratio in real-time. In contrast to basic trace math (where one could measure S21, save it to memory, then change the measurement to S12 and plot DataMemMath) which would be quasi-static, the inter-trace measurement version allows for observing changes during tuning correctly. On a more advanced level, one could normalize each of the input variables using DataMemMath on those traces and then operate on the normalized variables using Inter-trace math (e.g., Tr1/Mem1 + Tr2/Mem2).
Equation Editor
The Equation Editor allows a much more complete set of operations between trace data sets (and S-parameter sets) than does the Simple Operation inter-trace math just described. The main dialog is shown next (see Figure: Equation Editor Dialog—Trace Mode and Figure: Equation Editor Dialog—sNp File Selection Mode) and consists of a selection of functions, input variables (traces and s-parameters in various formats, and sNp file selection) and scalar entry along with some editing tools.
A central concept is that the entire equation is based on complex vectors (which is how trace data and S-parameters come in and what is desired for plotting) of length equal to the number of points. Scalars (real or complex) can be used throughout but, where necessary, will be automatically vectorized (same value at each position in a vector of length equal to the number of points).
Example:
Trace 1 has three points [1+j1, 2+j2, 3+j3]. The equation is Tr1+pi. The result of the calculation will be [(1+pi)+j1, (2+pi)+j2, (3+pi)+j3].
Syntax errors will be flagged if parentheses are not used to resolve precedence problems (e.g., Tr1 * –T2 will not be accepted but Tr1 * (–Tr2) will be).
If the input variable format is selected as Raw or Corrected, the variable will enter the equation as a linear complex number (either with or without calibration applied; note that receiver calibrations are applied to all). If Formatted is selected, the current graph type format will be used so the vector may be purely real.
If the time domain checkbox is selected, all traces and parameters will be processed into time domain in the background if they are not already displayed that way. Lowpass Processing will be used if the current frequency list supports it, but otherwise Bandpass Process will be used. Trace time domain parameters will be used, which may be at default if not already configured. It is recommended to configure desired variables in time domain so the results are predictable. See the Measurement—Time Domain (Option 2) chapter of this guide for more information.
Note that trace memory and trace math (discussed earlier in this section) can be used as the incoming variables. Constant π (PI)is available and the 'j' button is used for entering complex scalars. The scientific notation exponent marker 'E' is also available (e.g., 1E9 for 1000000000).
Only single-ended S-parameters are available as direct arguments for the editor. Any mixed-mode S-parameter can, however, be created as a trace variable and used that way as an argument. This is because of the wide variety of underlying port permutations possible with the mixed mode parameters.
Equation Editor Dialog—Trace Mode
Note that S-parameters from .sNp files may also be used in the equations (see Figure: Equation Editor Dialog—sNp File Selection Mode). Up to 16 files may be used and all S-parameters within a given file (for N up to 4) can be used. Interpolation and flat-line extrapolation will apply when the file frequency range does not match the current frequency range. The data from the files is stored as part of the VNA setup files (and during application shutdown) so the original file location does not need to be maintained. The original file name will continue to appear in the dialog as an aid to remember the nature of the data.
Data (and memory and processed results) from other channels may also be used in the calculation for the active channel. This is particularly useful when data over other sweep ranges is needed (e.g., values of various harmonics for computation of total harmonic distortion). It is required, however, that all channels being used in the equation must have the same number of sweep points so that the vector lengths will be commensurate (and a channel will not be available for variable inclusion if it has a different number of sweep points). The various channels do not have to use the same frequency range, although they commonly will be related (e.g., by a harmonic). Also, the data from the various channels being used in an equation will all be converted to time domain if that checkbox has been selected for the current equation.
Equation Editor Dialog—sNp File Selection Mode
Supported Complex Functions
Following are description of the more complex functions supported (the output of the function is complex unless otherwise noted).
• ABS()—Complex magnitude for complex input and absolute value for real input. Output is real.
• ACOS()—Arccosine; radian output. This will accept complex arguments and uses the standard branch cut.
• ANGLE()—Phase of complex input; radian output. Output is real.
• ASIN()—Arcsine, radian output. This will accept complex arguments and uses the standard branch cut.
• ATAN()—Arctangent, radian output. This will accept complex arguments and uses the standard branch cut.
• ATAN2()—Arctangent with the ability to properly resolve quadrants. The argument is complex and it is internally split into real and imaginary components with sign checking. Radian output
• CONJ()—conjugate
• COS()—Cosine, radian input. Note that this function will accept complex inputs and treat them as such. Commonly one would use this function only with a formatted trace set up for phase and then multiplied by pi/180 to convert to radians.
• CPX(a,b)—Complex equivalent taking 2 real inputs; output is a+jb. If the inputs are complex, the real part of each is taken prior to combination into a new complex variable.
• EXP()—Exponential
• IM()—Imaginary part of a complex input. Output is real.
• MAG()—Magnitude accepting complex input (same as ABS). Output is real.
• MAX()—Maximum value of the MAGNITUDE of the variable selected. (Note that this updates only after a sweep completes so there may be a one sweep delay until the value propagates to a plotted equation). Output is real.
• MAX_HOLD()—Accumulates maximum value of the MAGNITUDE of the argument sweep-to-sweep. The process is reset by clearing the equation or turning inter-trace math off. (Note that this updates only after a sweep completes so there may be a one sweep delay until the value propagates to a plotted equation). Output is real.
• MEAN()—Average value in a complex sense; (note that this updates only after a sweep completes, so there may be a one sweep delay until the value propagates to a plotted equation)
• MEDIAN()—Median value of the MAGNITUDE of the argument; (note that this updates only after a sweep completes, so there may be a one sweep delay until the value propagates to a plotted equation). Output is real.
• MIN()—Minimum value of the MAGNITUDE of the argument …(note that this updates only after a sweep completes, so there may be a one sweep delay until the value propagates to a plotted equation). Output is real.
• MIN_HOLD()—Accumulates maximum value of the MAGNITUDE of the argument sweep-to-sweep. The process is reset by clearing the equation or turning inter-trace math off. (Note that this updates only after a sweep completes, so there may be a one sweep delay until the value propagates to a plotted equation). Output is real.
• MRKX()—Readout of active maker on entered trace, x-value. If no marker is on, a 0 will be returned. If more than one marker is on, the active marker will be used. Output is real. Since this function relies on a trace marker value, the argument can be ONLY a trace and not a function involving a trace.
• MRKY()—Readout of active maker on entered trace, y-value. If no marker is on, a 0 will be returned. If more than one marker is on, the active marker will be used. Since this function relies on a trace marker value, the argument can be ONLY a trace and not a function involving a trace.
• PHASE()—Same as ANGLE but degree output. Output is real.
• POW(z,n)—Raises a complex variable z to the nth power. n is a scalar.
• RE()—Returns real part of a complex input. Output is real.
• REWRAP()—Rewraps phase of a complex variable when range was truncated (often by a power function). The calculation is based on slope of low frequency data.
• SDEV()—Standard deviation of input data. This is evaluated only at sweep completion, so there may be a one sweep delay for values to propagate to a displayed equation. This calculation is based on the equation below where N is the number of points. Note that the output is real.
Equation 13‑3.
• SIN()—Sine. Note that this function will accept complex inputs and treat them as such. Commonly one would use this function only with a formatted trace set up for phase and then multiplied by pi/180 to convert to radians.
• SQRT()—Square root; standard branch cut
• TAN()—Tangent. Note that this function will accept complex inputs and treat them as such. Commonly one would use this function only with a formatted trace set up for phase and then multiplied by pi/180 to convert to radians.
• XAXISARRAY()—Generates the vector corresponding to the current sweep variable. Output is real.