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 rfckt object
to store the converted data for analysis.

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.

Extract S-Parameters

To extract M-port S-parameters from N-port S-parameters, use
the snp2smp function with the following syntax:

s_params_mp = snp2smp(s_params_np, z0, n2m_index, zt)

where

s_params_np is an array
of N-port S-parameters with a reference impedance z0.

s_params_mp is an array of M-port
S-parameters.

n2m_index is a vector of
length M specifying how the ports of the N-port
S-parameters map to the ports of the M-port S-parameters. n2m_index(i) is
the index of the port from s_params_np that
is converted to the ith port of s_params_mp.

zt is the termination impedance
of the ports.

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 rfckt object
to store the extracted data for analysis.

At the MATLAB prompt:

Type this command to import data from the file default.s16p into
an rfdata.data object, SingleEnded16PortData:

SingleEnded16PortData = read(rfdata.data,'default.s16p');

Type this command 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:

Cascade N-Port S-Parameters

To cascade networks of N-port S-parameters, use the cascadesparams function
with the following syntax:

s_params = cascadesparams(s1_params,s2_params,...,sn_params,nconn)

where

s_params is an array of cascaded
S-parameters.

s1_params,s2_params,...,sn_params are
arrays of input S-parameters.

nconn is a positive scalar
or a vector of size n-1 specifying how many connections
to make between the ports of the input S-parameters. cascadesparams connects
the last port(s) of one network to the first port(s) of the next network.

For more details about the arguments to this function, see the cascadesparams reference page.

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 rfckt 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: