Main Content

sparameters

Calculate S-parameters for RF data, network, circuit, and matching network objects

Description

example

sobj= sparameters(filename)creates an S-parameter objectsobjby importing data from the Touchstone file specified byfilename.

sobj= sparameters(data,freq)creates an S-parameter object from the S-parameter data,data, and frequencies,freq.

sobj= sparameters(data,freq,Z0)creates an S-parameter object from the S-parameter data,data, and frequencies,freq, with a given reference impedanceZ0.

sobj= sparameters(rfobj,freq)calculates the S-parameters of a RF object such as a filter object, circuit object, transmission line object, series RLC object, shunt RLC object, attenuator object or RF antenna object with the default reference impedance.

example

sobj= sparameters(rfobj,freq,Z0)calculates the S-parameters of a RF object such as a filter object, circuit object or transmission line object with a given reference impedanceZ0.

sobj= sparameters(netparamobj)converts the network parameter object,netparamobj, to S-parameter object with the default reference impedance.

example

sobj= sparameters(netparamobj,Z0)converts the network parameter object,netparamobj, to S-parameter object with a given reference impedance,Z0.

example

sobj= sparameters(rfdataorckt)extracts network data fromrfdataobjorrfcktobjand converts it into S-parameter object.

sobj= sparameters(mnobj)returns the S-parameters of the best created matching network, evaluated at a frequency list constructed from source and load impedance.

sobj= sparameters(mnobj,freq)returns the S-parameters of the best created matching network at each specified frequency.

sobj= sparameters(mnobj,freq,Z0)returns the S-parameters of the best created matching network at each specified frequency and characteristic impedance,Z0.

example

sobj= sparameters(___,circuitindices)returns an array of S-parameter objects, one object for each circuit indicated incircuitindices. Use this option with any of the input argument combinations in the previous syntaxes.

Examples

collapse all

Extract S-parameters from filedefault.s2pand plot it.

S = sparameters('default.s2p'); disp(S)
sparameters: S-parameters object NumPorts: 2 Frequencies: [191x1 double] Parameters: [2x2x191 double] Impedance: 50 rfparam(obj,i,j) returns S-parameter Sij

Plot the extracted S-parameters data.

rfplot(S)

Figure contains an axes object. The axes object contains 4 objects of type line. These objects represent dB(S_{11}), dB(S_{21}), dB(S_{12}), dB(S_{22}).

Create a resistor element R50 and add it to a circuit objectexample2. Calculate the S-parameters ofexample2.

hR1 = resistor(50,'R50'); hckt1 = circuit('example2'); add(hckt1,[1 2],hR1) setports (hckt1, [1 0],[2 0]) freq = linspace (1e3,2e3,100); S = sparameters(hckt1,freq,100); disp(S)
sparameters: S-parameters object NumPorts: 2 Frequencies: [100x1 double] Parameters: [2x2x100 double] Impedance: 100 rfparam(obj,i,j) returns S-parameter Sij

Extract Y-parameters from file default.s2p. Convert the resulting Y-parameters to S-parameters.

Y1 = yparameters('default.s2p'); S1 = sparameters(Y1,100); disp(Y1)
yparameters: Y-parameters object NumPorts: 2 Frequencies: [191x1 double] Parameters: [2x2x191 double] rfparam(obj,i,j) returns Y-parameter Yij
disp(S1)
sparameters: S-parameters object NumPorts: 2 Frequencies: [191x1 double] Parameters: [2x2x191 double] Impedance: 100 rfparam(obj,i,j) returns S-parameter Sij
file ='default.s2p'; h = read(rfdata.data, file); S = sparameters(h)
S = sparameters: S-parameters object NumPorts: 2 Frequencies: [191x1 double] Parameters: [2x2x191 double] Impedance: 50.0000 + 0.0000i rfparam(obj,i,j) returns S-parameter Sij

This example shows how to calculate the S-Parameters for a newly created matching network for the auto-generated circuit #2 with a reference impedance of 100 Ohm.

n = matchingnetwork('LoadImpedance', 100,'Components',3); freq = linspace(n.CenterFrequency-n.Bandwidth/2,n.CenterFrequency+n.Bandwidth/2); RefZ0 = 100; ckt_no = 2; s = sparameters(n,freq,RefZ0,ckt_no)
s = sparameters: S-parameters object NumPorts: 2 Frequencies: [100x1 double] Parameters: [2x2x100 double] Impedance: 100 rfparam(obj,i,j) returns S-parameter Sij

Create an RLCG transmission line using the these specifications:

  • Resistor : 100 ohms

  • Capacitor : 1 pF

rlcglinetxline = txlineRLCGLine('R', 100,'C',1e-12)
rlcglinetxline = txlineRLCGLine: RLCGLine element Name: 'RLCGLine' Frequency: 1.0000e+09 R: 100 L: 0 C: 1.0000e-12 G: 0 IntpType: 'Linear' LineLength: 0.0100 Termination: 'NotApplicable' StubMode: 'NotAStub' NumPorts: 2 Terminals: {'p1+' 'p2+' 'p1-' 'p2-'}

Calculate the S-parameters of the transmission line at 1 GHz.

sparam = sparameters(rlcglinetxline,1e9);

Input Arguments

collapse all

S-parameter data, specified as an array of complex numbers, of sizeN-by-N-by-K.

RF object, specified as one of the following:

Circuit object circuit
RF Filter object rffilterandlcladder.
Transmission line objects
Series and Shunt RLC objects seriesRLC, andshuntRLC
Attenuator object attenuator
RF antenna object rfantenna
Phase shift object phaseshift
IMT mixer object mixerIMT

Network parameter object. The network parameter objects are of the type:sparameters,yparameters,zparameters,gparameters,hparameters,abcdparameters, andtparameters.

Example:S1 = sparameters(Y1,100).Y1is a parameter object. This example converts Y-parameters to S-parameters at100ohms.

Touchstone data file, specified as a character vector, that contains network parameter data.filenamecan be the name of a file on the MATLAB®path or the full path to a file.

Example:sobj = sparameters('defaultbandpass.s2p');

S-parameter frequencies, specified as a vector of positive real numbers, sorted from smallest to largest.

Reference impedance in ohms, specified as a positive real scalar. You cannot specifyZ0if you are importing data from a file. The argument Z0 is optional and is stored in theImpedanceproperty.

RF data or circuit object. Specifyrfdataobjas eitherrfdata.data, orrfdata.networkobject or specifyrfcktobjas any analyzedrfckttype object, such asrfckt.amplifier,rkckt.cascadeobject.

Matching network, specified as amatchingnetworkobject.

Data Types:char|string

Index of the matching network circuit, specified as a scalar.

Data Types:double

Output Arguments

collapse all

S-parameter data, returned as an object.disp(sobj)returns the properties of the object:

  • NumPorts— Number of ports, specified as an integer. The function calculates this value automatically when you create the object.

  • Frequencies——指定为一个参数频率K-by-1 vector of positive real numbers sorted from smallest to largest. The function sets this property from thefilenameorfreqinput arguments.

  • Parameters— S-parameter data, specified as anN-by-N-by-Karray of complex numbers. The function sets this property from thefilenameordatainput arguments.

  • Impedance— Reference impedance in ohms, specified as a positive real scalar. The function sets this property from thefilenameorZ0input arguments. If no reference impedance is provided, the function uses a default value of50.

Version History

Introduced in R2012a