Import/Export Data    Related Topics

Stores one or several data or memory traces to a file or loads a memory trace from a file. Import or export is selected from a submenu:


Import Complex Data...

Calls up a dialog to load a memory trace from a trace file. Trace files are ASCII files with selectable file format.

The loaded trace data is used to generate a memory trace which is coupled to the active data trace. Import Data corresponds to a standard Open File dialog with an additional checkbox:

On loading data from a trace file, the analyzer displays a list box to select one of the traces stored in the file. The example below shows a Touchstone (*.s2p) file, containing all four 2-port S-parameters; see Trace File Formats. 

Coupling between the imported memory trace and the active data trace implies that the stimulus values of the imported data and of the active trace must be compatible. Compatibility means that the Sweep Type of the two traces must match; the position and number of the sweep points do not have to be the same.

The analyzer checks for compatibility before importing data. The Select Parameter box remains empty if the selected files contains no compatible data.

When a *.s1p file is opened the Select Parameter box indicates the 1-port (reflection) parameter S11, irrespective of the actual S-parameter stored in the file.  

To import a trace file (*.snp or *.csv) you can also use the Windows Explorer and simply double-click the file or drag and drop the file into the NWA application. The imported data generates a memory trace which is coupled to the active data trace.

Remote control:

MMEMory:LOAD:TRACe "<trc_name>","<file_name>"


Export S-Matrix...

Calls up a dialog to store a full set of S-parameters to a Touchstone (*.s<n>p) file. The analyzer exports the complex (raw) measurement data.

Complex and formatted data is tapped at different stages of the data processing chain.   

Both complex and formatted data can be converted into different output formats.

Data export can serve many purposes, e.g.:

Export S-Matrix corresponds to a standard Save As... dialog with an additional panel to specify various export options. The export options are remembered when the dialog is closed. The Touchstone file format depends on the number of selected ports (Select Ports button). Touchstone files use the point as Dec. Separator; see Trace File Formats.

Remote control:

MMEMory:STORe:TRACe
MMEMory:STORe:TRACe:CHANnel

MMEMory:STORe:TRACe:CHANnel:PORTs


Select Ports

Defines the port assignment for the created Touchstone (*.s<n>p) file.

The following conditions must be met for a Touchstone file export:

Remote control:

MMEMory:STORe:TRACe:CHANnel:PORTs


Export Complex Data...

Calls up a dialog to store the active data or memory trace to a trace file. Trace files are ASCII files with selectable file format. See also Complex vs. Formatted Data.

Export Complex Data corresponds to a standard Save As... dialog with an additional panel to specify various export options. The export options are remembered when the dialog is closed. The Dec. Separator export option is not available for Matlab (*.dat) and Touchstone file export. The Export Complex Data dialog offers the *.s1p Touchstone file format for the active trace. Use Export S-Matrix to export several traces. Touchstone files use the point as Dec. Separator; see Trace File Formats.

The file header of the created Touchstone (*.s1p) file always contains the analyzer's 50 Ω reference impedance. This value may not correspond to the reference impedance of the active trace, in particular if differential or mixed mode S-parameters or wave quantities are exported. The analyzer displays a warning when creating a *.s1p file.  

The dialog provides the following export settings:

Selecting an appropriate file format

Use a Touchstone file format to export single-ended S-parameter data traces to a file that can be evaluated with applications such as Agilent's Microwave Design System (MDS) and Advanced Design System (ADS), and to convert mixed mode parameters back to single-ended parameters. The data must be acquired in a frequency sweep. Note the conditions for Touchstone file export in section Select Ports.  

Use the ASCII (*.csv) format if you want to do one of the following:

Use a the Matlab (*.dat) format if you want to import and process the trace data in Matlab.

For more information see Trace File Formats.

Remote control:

MMEMory:STORe:TRACe
MMEMory:STORe:TRACe:CHANnel

MMEMory:STORe:TRACe:CHANnel:PORTs


Export Formatted Data...

Calls up a dialog to store data or memory traces with their current trace format and stimulus values to a trace file. Trace files are ASCII files with selectable file format. Only the displayed values of the trace (e.g. the logarithmic magnitude, if trace format dB Mag is selected) are exported. Therefore the trace file doesn't necessarily contain the full (complex) information about the trace.

The exported formatted values correspond to the results in the marker info field. For trace formats involving Cartesian diagrams (dB Mag, Real, Imag...), the stimulus value and a single real response value is exported. For circular diagrams, both the real and imaginary part of the response value is exported. See also Complex vs. Formatted Data.

An exported formatted trace can be processed and evaluated in an external application. Re-import into the analyzer is only possible if the complex trace values are exported.

Export Formatted Data corresponds to a standard Save As... dialog with an additional panel to specify various export options. The Dec. Separator export option is not available for Matlab (*.dat) file export.

Touchstone files *.s<n>p contain either a single trace (*.s1p), system error corrected data, or the complete set of S-parameters of an n-port and use the point as Dec. Separator; see Trace File Formats; they are only available if complex trace values are exported (trace formats Polar, Smith, Inverted Smith). Moreover, Touchstone files cannot be used to export mathematical traces.

The following output options also depend on the trace format.

Selecting an appropriate file format

Use a Touchstone file format to export single-ended S-parameter data traces to a file that can be evaluated with applications such as Agilent's Microwave Design System (MDS) and Advanced Design System (ADS), and to convert mixed mode parameters back to single-ended parameters. The data must be acquired in a frequency sweep. Note the conditions for Touchstone file export in section Select Ports.  

Use the ASCII (*.csv) format if you want to do one of the following:

Use a the Matlab (*.dat) format if you want to import and process the trace data in Matlab.

For more information see Trace File Formats.

Remote control:

MMEMory:STORe:TRACe
MMEMory:STORe:TRACe:CHANnel


Trace File Formats

Trace files are ASCII files with selectable file format. The analyzer provides several types of trace files:

The trace file formats complement each other; see Selecting an appropriate file format.  


Touchstone files

All Touchstone files contain a header, a comment section, and the actual trace data:

#  HZ   S   RI   R     50.00

! Rohde & Schwarz ZVA8 4Ports - Version 2.79 - 1145.1010k10 SN: 100001

! Date: 2011-03-17 17:29:05

! Measurement: S21

!

 3.000000000000000E5     4.974100772242758E-1  -4.765769749721549E-2  

 4.029850000000000E7     4.993215759551635E-1  -4.876783852224179E-2  

 8.029700000000000E7     4.947516929605214E-1  -7.533998081687453E-2

 ...

The header consists of the following data elements:

# specifies beginning of header line (required at top of file).  <Frequency unit> HZ / KHZ / MHZ / GHZ allowed for imported files. The analyzer always uses HZ for exported data.   

<Data file type> at present: S for S-parameter files.   

<Data format> RI for Re/Im, MA for lin. Mag-Phase, DB for dB Mag-Phase. The data format for export files can be selected in the Export Data dialog.   

<Normalizing impedance> Impedance system in which the data was defined. The analyzer uses 50.0000 Ω.  

Comment lines start with the exclamation mark (!) and may contain any text used for documentation of the trace data file. Any number of comment lines may be inserted before or after the header line. A Touchstone file created by the network analyzer contains the comment lines shown above: Manufacturer of the network analyzer, properties of the instrument, current date and time, measured S-parameter(s).

The trace data section corresponds to a set of single-ended S-parameters. It depends on the number of ports <n> and the data format. For real and imaginary values (data format = Real-Imag) the trace data for each stimulus frequency is arranged as follows:

The stimulus frequencies are arranged in ascending order. If a lin. Mag-Phase (MA) or dB Mag-Phase (DB) data format is selected the real and imaginary S-parameter values Re(Sij), Im(Sij) are replaced by lin Mag(Sij), phase(Sij) or dB Mag(Sij), phase(Sij), respectively.

According to Touchstone file specifications, no more than four pairs of network data are allowed per data line. The entries in the data lines are separated by white space, and a data line is terminated by a new line character. All data sets are arranged in increasing order of frequency.

When exporting traces to a Touchstone file, it is recommended to set the analyzer to single sweep mode (Channel – Sweep – Single (All Chans)). This will ensure that a complete sweep is exported.


ASCII (*.csv) files

An ASCII file contains a header and the actual trace data:

freq;reTrc1_S21;imTrc1_S21;reMem2[Trc1]_S21;imMem2[Trc1]_S21;

300000.000000;0.000000;0.000000;0.000000;0.000000;

40499497.487437;0.000000;0.000000;0.000000;0.000000;

80698994.974874;0.494927;-0.065174;0.500833;-0.074866;

120898492.462312;0.497959;-0.111724;0.488029;-0.107375;

...

The header consists of the following data elements:

<Stimulus> stimulus variable: freq for Frequency sweep, power for Power sweep, time for Time sweep, trigger for CW Mode sweep.   

<reTrace1> first response value of first trace: re<Trace_Name>, mag<Trace_Name> or db<Trace_Name> for output format Re/Im, lin. Mag-Phase or dB Mag-Phase, respectively. The data format for export files can be selected in the Export Data dialog.   

<imTrace1>    second response value of first trace: im<Trace_Name> for output format Re/Im, ang<Trace_Name> for output formats lin. Mag-Phase or dB Mag-Phase. The data format for export files can be selected in the Export Data dialog.

<reTrace2>    first response value of second trace: re<Trace_Name>, mag<Trace_Name> or db<Trace_Name> for output format Re/Im, lin. Mag-Phase or dB Mag-Phase, respectively. The data format for export files can be selected in the Export Data dialog.

<imTrace2>...   second response value of second trace: im<Trace_Name> for output format Re/Im, ang<Trace_Name> for output formats lin. Mag-Phase or dB Mag-Phase. The data format for export files can be selected in the Export Data dialog. first response value of second trace. HZ / KHZ / MHZ / GHZ allowed for imported files. The analyzer alway uses HZ for exported data. second response value of first trace: im<Trace_Name> for output format Re/Im, ang<Trace_Name> for output formats lin. Mag-Phase or dB Mag-Phase. The data format for export files can be selected in the Export Data dialog.

The trace data is arranged as described in the header. Different values are separated by semicolons, commas or other characters, depending on the selected Decimal Separator in the Export ... Data dialogs. A semicolon is inserted before the end of each line.

The stimulus values are arranged in ascending order.


Shift Stimulus Value...

Shifts the active trace in horizontal direction, leaving the positions of all markers unchanged. The positive or negative offset value for the stimulus variable is entered into an input field. The unit depends on the sweep type.

Shift Stimulus Value can be used in Cartesian as well as in polar diagrams. The visible effect depends on the diagram type:

Use a negative offset value to reset a shifted trace to its original position.  

Remote control:

DISPlay:WINDow<Wnd>:TRACe<WndTr>:X:OFFset <numeric_value>


Shift Response Value...

Modifies all points of the active trace by means of an added and/or a multiplied complex constant. The constant complex values are entered in the four input fields of the Shift Response Value dialog.

The units of the constants are adjusted to the format of the active trace. Setting all values to zero (Clear All Values) restores the original trace.   

Effect of the constants

The trace points are modified according to the formula displayed in the lower part of the dialog:

The formula and the different constants are adjusted to the different display formats of a trace:

Shifting the trace by means of constant values is a simple case of trace mathematics. Use the Define Math dialog to define more complicated mathematical operations.  

Remote control:

DISPlay:WINDow<Wnd>:TRACe<WndTr>:Y:OFFset <Magnitude>[, <Phase>, <Real>, <Imag>]

Remote control:

CALCulate<Chn>:MATH:WUNit:STATe ON | OFF


Max Hold On, Min Hold On

Enables (if selected) or disables the max hold (peak hold) or min hold function for the active trace. With enabled max hold or min hold function, the displayed trace shows the maximum or minimum values that the analyzer acquired since the start of the measurement. The max hold and min hold trace is real, it is based on the magnitude of the trace values (the phase values are discarded).

The max hold or min hold process can be restarted any time using Restart Hold. It is also restarted automatically when the channel or trace settings are changed so that the previous measurement results are no longer compatible.

Depending on the selected export file format and trace format, a data export (Export Complex Data, Export Formatted Data) may require complex trace data. In such situations, the analyzer exports the last measured trace instead of the real max hold or min hold trace.
A memory trace is complex by definition. Therefore,
Data --> Mem stores the last measured trace instead of the real max hold or min hold trace.

Remote control:

CALCulate<Chn>:PHOLd MAX | OFF


Restart Hold

Restarts the max hold (peak hold) function for the active trace, discarding the old maximum measurement results. This softkey has no effect unless Max Hold On is active.

Remote control:

CALCulate<Chn>:PHOLd MAX | OFF