Main Content

Process File Data for Analysis

Convert Single-Ended S-Parameters to Mixed-Mode S-Parameters

After you import file data (as described in Import Property Values from Data Files), you can convert a matrix of single-ended S-parameter data to a matrix of 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:

  • s2smm — Convert 4N-port, single-ended S-parameters to 2N-port, mixed-mode S-parameters.

  • smm2s — Convert 2N-port, mixed-mode S-parameters to 4N-port, single-ended S-parameters.

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.

At the MATLAB® prompt:

  1. Type this command to import data from the file default.s4p:

    SingleEnded4Port = read(rfdata.data,'default.s4p');
    

  2. Type this command to convert 4-port single-ended S-parameters to 2-port mixed-mode S-parameters:

    DifferentialSParams = s2sdd(SingleEnded4Port.S_Parameters);

    Note

    The S-parameters that you specify as input to the s2sdd function are the ones the toolbox stores in the S_Parameters property of the rfdata.data object.

  3. Type this command to create an rfckt.passive object that stores the 2-port differential S-parameters for simulation:

    DifferentialCkt = rfckt.passive('NetworkData', ...
        rfdata.network('Data', DifferentialSParams, 'Freq', ...
        SingleEnded4PortData.Freq));

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:

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.

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:

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

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

  2. 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:

    N2M_index = [1 16 2 15];
    FourPortSParams = snp2smp(SingleEnded16PortData.S_Parameters, ...
        SingleEnded16PortData.Z0, N2M_index, 50);

    Note

    The S-parameters that you specify as input to the snp2smp function are the ones the toolbox stores in the S_Parameters property of the rfdata.data object.

  3. Type this command to create an rfckt.passive object that stores the 4-port S-parameters for simulation:

    FourPortChannel = rfckt.passive('NetworkData', ...
        rfdata.network('Data', FourPortSParams, 'Freq', ...
        SingleEnded16PortData.Freq));

Cascade N-Port S-Parameters

After you import file data (as described in Import Property Values from Data Files), you can cascade two or more networks of 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:

  1. 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 = read(rfdata.data,'default.s16p');
    S_4Port = read(rfdata.data,'default.s4p');
    freq = [2e9 2.1e9];
    analyze(S_16Port, freq);
    analyze(S_4Port, freq);
    sparams_16p = S_16Port.S_Parameters;
    sparams_4p = S_4Port.S_Parameters;
    

  2. 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, sparams_4p,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.

  3. Type this command to create an rfckt.passive object that stores the 14-port S-parameters for simulation:

    Ckt14 = rfckt.passive('NetworkData', ...
        rfdata.network('Data', sparams_cascaded, 'Freq', ...
        freq));

For more examples of how to use this function, see the cascadesparams reference page.

Related Topics