snp2smp

Convert single-ended N-port S-parameters to single-ended M-port S-parameters

Syntax

s_params_mp = snp2smp(s_params_np)
s_params_mp = snp2smp(s_params_np, Z0, n2m_index, ZT)

Description

s_params_mp = snp2smp(s_params_np) converts the single-ended N-port S-parameters, s_params_np, into the single-ended M-port S-parameters, s_params_mp. s_params_np is a complex NxNxK array representing K N-port S-parameters, and s_params_mp is a complex M-by-M-by-K array representing K M-port S-parameters. K is the number of points in the S-parameter data. Each data point usually corresponds to a different frequency, so K is usually the number of frequency points. M must be less than or equal to N.

s_params_mp = snp2smp(s_params_np, Z0, n2m_index, ZT) converts the S-parameter data using the optional arguments Z0, n2m_index, and ZT that control the conversion.

Z0 is the reference impedance of s_params_np and s_params_mp. The default is 50 ohms.

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. The default value of n2m_index is [1, 2]. This means M is 2 and the first two ports of the N-port S-parameters become the ports of the M-port parameters. Any additional ports are terminated with the impedances that are specified by ZT.

ZT is a scalar, vector, or cell array specifying the termination impedance of the ports. If M is less than N, snp2smp terminates the N-M ports that are not listed in n2m_index using the values in ZT. By default, ZT is the same as Z0. If ZT is a scalar, all N-M ports that are not listed by n2m_index are terminated by the same impedance ZT. If ZT is a vector of length K, ZT[i] is the impedance used to terminate all N-M ports of the ith frequency point that are not listed in n2m_index. If ZT is a cell array of length N, ZT{j} is the impedance used to terminate the jth port of the N-port S-parameters. Impedances related to the ports listed in n2m_index are ignored. Each ZT{j} can be a scalar or a vector of length K.

The following figure illustrates how to use the optional input arguments to specify the ports for the output data and the termination of the remaining ports.

Examples

The following examples show how to use the snp2smp function to perform S-parameter conversions.

Example 1

Type the following command at the MATLAB® prompt to convert 3-port S-parameters s3p, which have a reference impedance of Z0, to 3-port S-parameters with port indexes swapped from [1 2 3] in the original S-parameters to [2 3 1] in the output S-parameters:

ckt = read(rfckt.passive, 'default.s3p');
s3p = ckt.NetworkData.Data;
Z0 = ckt.NetworkData.Z0;
s3p_new = snp2smp(s3p, Z0, [2 3 1])

Example 2

Type the following command at the MATLAB prompt to convert 3-port S-parameters s3p, which have a reference impedance of Z0, to 2-port S-parameters by terminating port 3 with an impedance of Z0:

ckt = read(rfckt.passive, 'default.s3p');
s3p = ckt.NetworkData.Data;
Z0 = ckt.NetworkData.Z0;
s2p = snp2smp(s3p, Z0, [1 2], Z0);

Example 3

Type the following command at the MATLAB prompt to convert 16-port S-parameters s16p, which have a reference impedance of Z0, 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 Z0:

ckt = read(rfckt.passive, 'default.s16p');
s16p = ckt.NetworkData.Data;
Z0 = ckt.NetworkData.Z0;
s4p = snp2smp(s16p, Z0, [1 16 2 15], Z0)

Example 4

Type the following command at the MATLAB prompt to convert 16-port S-parameters s16p, which have a reference impedance of Z0, to 4-port S-parameters by using ports 1, 16, 2, and 15 as first, second, third, and fourth ports, terminating port 4 with an impedance of 100 ohms, and terminating the remaining 11 ports with an impedance of 50 ohms:

ckt = read(rfckt.passive, 'default.s16p');
s16p = ckt.NetworkData.Data;
Z0 = ckt.NetworkData.Z0;
ZT = {}; 
ZT(1:16) = {50};
ZT{4} = 100;
s4p = snp2smp(s16p, Z0, [1 16 2 15], ZT)

See Also

freqresp
rfmodel.rational
s2tf
timeresp
writeva

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS