Process File Data for Analysis
This topic shows you how to process RF data for analysis. After you import your data, you can process it using one of the following methods:
Convert single-ended S-parameters to mixed-mode S-parameters.
Extract M-port S-parameters from N-Port S-parameters.
Cascade N-port S-parameters
Convert Single-Ended S-Parameters to Mixed-Mode S-Parameters
This section contains the following topics:
Functions for Converting S-Parameters
To convert between 4-port single-ended S-parameter data and 2-port differential-, common-, and cross-mode S-parameters, use one of these functions:
s2scc
— Convert 4-port, single-ended S-parameters to 2-port, common-mode S-parameters (Scc).s2scd
— Convert 4-port, single-ended S-parameters to 2-port, cross-mode S-parameters (Scd).s2sdc
— Convert 4-port, single-ended S-parameters to cross-mode S-parameters (Sdc).s2sdd
— Convert 4-port, single-ended S-parameters to 2-port, differential-mode S-parameters (Sdd).
To perform the above conversions all at once, or to convert larger data sets, use one of these functions:
Conversion functions support a variety of port orderings. For more information on these functions, see the corresponding reference pages.
Convert S-Parameters
In this example, use the toolbox to import 4-port single-ended S-parameter data from a file, convert the data to 2-port differential S-parameter data, and create a new circuit object to store the converted data for analysis.
At the MATLAB® prompt:
Type this command to import data from the file
default.s4p
:singleEnded4PortSparam = sparameters('default.s4p');
Type these commands to convert 4-port single-ended S-parameters to 2-port mixed-mode S-parameters:
differential2PortData = s2sdd(singleEnded4PortSparam.Parameters); differential2PortSparam = sparameters(differential2PortData, ... singleEnded4PortSparam.Frequencies,2*singleEnded4PortSparam.Impedance);
Type this command to create an
nport
object that stores the 2-port differential S-parameters for addition to a circuit orrfbudget
object:differential2Port = nport(differential2PortSparam);
Extract M-Port S-Parameters from N-Port S-Parameters
After you import file data (as described in Import Property Values from Data Files), you can extract a set of data with a smaller number of ports by terminating one or more ports with a specified impedance.
This section contains the following topics:
Extract S-Parameters
To extract M-port S-parameters from N-port S-parameters, use the snp2smp
function with the following syntax: To extract M-port S-parameter data from
N-port S-parameter data, use the snp2smp
.
The following figure illustrates how to specify the ports for the output data and the termination of the remaining ports.
For more details about the arguments to this function, see the snp2smp
reference page.
Extract S-Parameters from Imported File Data
In this example, use the toolbox to import 16-port S-parameter data from a
file, convert the data to 4-port S-parameter data by terminating the remaining
ports, and create a new sparameters
object to store the
extracted data for analysis.
At the MATLAB prompt:
Type this command to import data from the file
default.s16p
into ansparameters
object,singleEnded16PortData:singleEnded16PortSparam = sparameters('default.s16p');
Type these commands to convert 16-port S-parameters to 4-port S-parameters by using ports 1, 16, 2, and 15 as the first, second, third, and fourth ports, and terminating the remaining 12 ports with an impedance of 50 ohms:
N2M_index = [1 16 2 15]; fourPortData = snp2smp(singleEnded16PortSparam.Parameters, ... singleEnded16PortSparam.Impedance, N2M_index, 50); fourPortSparam = sparameters(fourPortData, ... singleEnded16PortSparam.Frequencies,singleEnded16PortSparam.Impedance);
Alternatively, apply the
snp2smp
function to thesparameters
object:fourPortSparam = snp2smp(singleEnded16PortSparam, N2M_index, 50);
Cascade N-Port S-Parameters
Cascade two or more networks of N-port S-parameters using the cascadesparams
function.
Import and Cascade N-Port S-Parameters
In this example, use the toolbox to import 16-port and 4-port S-parameter file data and
cascade the two S-parameter networks by connecting the last three ports of the
16-port network to the first three ports of the 4-port network. Then, create a
new sparameters
object to store the resulting network for
analysis.
At the MATLAB prompt:
Type these commands to import data from the files default.s16p and
default.s4p
, and create the 16- and 4-port networks of S-parameters:S_16Port = sparameters('default.s16p'); S_4Port = sparameters('default.s4p'); freq = [2e9 2.1e9]; sparams_16p = rfinterp1(S_16Port,freq); sparams_4p = rfinterp1(S_4Port,freq);
Type this command to cascade 16-port S-parameters and 4-port S-parameters by connecting ports 14, 15, and 16 of the 16-port network to ports 1, 2, and 3 of the 4-port network:
sparams_cascaded = ... cascadesparams(sparams_16p.Parameters, sparams_4p.Parameters,3);
cascadesparams
creates a 14-port network. Ports 1–13 are the first 13 ports of the 16-port network. Port 14 is the fourth port of the 4-port network.Type this command to create an
sparameter
object that stores the 14-port S-parameters for simulation:Ckt14 = sparameters(sparams_cascaded,freq);