Data Header Variables
The VSA can save trace data or recordings to a file for later recall into the VSA or for sharing with another program such as MATLAB or Excel. Saved recordings and trace data are very similar in that they can be saved to mostly the same file formats and they can both be recalled into the VSA as either a recording or as a trace (with some exceptions).
You can also read Trace Data Header variables using the .NET API 1) Access Preamble Indicator, or 2) Application Programming Interface. To do this, you will need to get access to the MeasurementData object for the Trace that contains the data you want to read (through the Trace.MeasurementData property).
For example, to read the trace title Data Header, here is the syntax you might use:
string title = app.Display.Traces[0].MeasurementData.State["TrcTtl"];
The main difference between saved trace data and recordings is that while recordings can contain only time waveform data, traces can also contain symbol data, summary data, etc. Another difference is that saved trace data contains information about how the data was shown in the trace.
When you save a trace or recording, the VSA adds a data header to the file. The data header contains a list of key-value pairs that describe the measurement data. These key-value pairs provide information about how the VSA was set up for the measurement (for example, input range, number of averages, window type). Other key-value pairs provide information about the measurement data itself (for example, if overloads occurred). The T_ variables provide information about how the data was shown in a trace.
When you save a trace and want to recall it again with the same appearance as when it was saved, you must save the trace with the data header (Save > Save Selected trace > Save Options > Save header with data).
The NextItemArray data header variable is an important datatype attribute for efficient reading of large CSV and TXT files and is included in saved trace files even if Save header with data is not selected in the Save > Save Selected trace > Save Options dialog.
The measurement data is denoted by the following data headers:
- Y - the data for a single input channel
- Yn - the data for two channel recordings, where n is the channel number
- Yn_m - the data for multi-channel recordings, where n is the channel and m is the total number of channels
For real data (baseband), there is one value per line. For complex data (zoom), there are two values per line, the first being the real value and the second being the imaginary value of the data point.
To recall a recording, there are two key variables that should be in the data header: one of the Y headers listed above and XDelta (delta time, default of 1.0).
Other useful variables include XStart (Trigger Delay, default of 0.0), InputRange (used for default scaling, default of 0.0), InputRefImped (used for watts/dBm deciBels referenced to a milliWatt: dB relative to 1 milliwatt dissipated in the nominal input impedance of the analyzer units, default is 50 ohms), FreqValidMin and FreqValidMax (default is no frequency blanking).
For Zoom recordings, two additional variables that should be included are InputCenter and InputZoom.
Recording data header variables
SegmentOffsets, SegmentOffsetsN Y - single channel Y1_m, Y2_m, ..., Yn_m - m channels YScale - Only for N5106A/N5110A files |
Trace data header variables
The data header may contain any of the following variables. The variables stored in the data header depend on the type of data contained in the trace.
The T_ variables provide information about how the trace display was set up to view the measurement results.
Segmented Recordings
To recall a segmented recording, there are two key variables that should be in the data header: one of the Y headers listed above and XDelta (delta time, default of 1.0)
Other useful variables include XStart (Trigger Delay, default of 0.0), InputRange (used for default scaling, default of 0.0), InputRefImped (used for watts/dBm units, default is 50 ohms), FreqValidMin and FreqValidMax (default is no frequency blanking).
For Zoom recordings, two additional variables that should be included are InputCenter and InputZoom.