main content

calculate s-凯发k8网页登录

calculate s-parameters for rf data, network, circuit, and matching network objects

description

example

sobj = sparameters(filename) creates an s-parameter object sobj by importing data from the touchstone file specified by filename.

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 impedance z0.

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 impedance z0.

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 from rfdataobj or rfcktobj and 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 in circuitindices. use this option with any of the input argument combinations in the previous syntaxes.

examples

extract s-parameters from file default.s2p and 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 with xlabel frequency (ghz), ylabel magnitude (db) 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 object example2 . calculate the s-parameters of example2 .

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
  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 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);

define a data set and a vector of frequencies.

data = reshape(complex(1:12,13:24),2,2,[]);
freq = (1:3)*10^9;

define the reference impedance of each port of the data.

z0 = [50 100];

build the s-parameters object of the data at the given frequencies freq with the vector z0 of reference impedances. this will allow you to specify different reference impedance for each port.

s = sparameters(data,freq,z0)
s = 
  sparameters: s-parameters object
       numports: 2
    frequencies: [3x1 double]
     parameters: [2x2x3 double]
      impedance: [50 100]
  rfparam(obj,i,j) returns s-parameter sij

input arguments

s-parameter data, specified as an array of complex numbers, of size n-by-n-by-k.

rf object, specified as one of the following:

circuit objectcircuit
rf filter object and .
transmission line objects
series and shunt rlc objects, and
attenuator object
rf antenna object
phase shift object
imt mixer object
rf divider object (since r2023a)
mutual inductor object (since r2023a)

network parameter object. the network parameter objects are of the type: sparameters, , , , , , and .

example: s1 = sparameters(y1,100) . y1 is a parameter object. this example converts y-parameters to s-parameters at 100 ohms.

touchstone data file, specified as a character vector, that contains network parameter data. filename can 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 one of the following:

  • positive real scalar when you want to specify the same the reference impedance for all ports in the network.

  • positive real vector of length n when you want to specify a different reference impedance for each port in the n-port network. (since r2023a)

  • positive real vector of length k when you want to specify a different reference impedance for each in the k frequencies in the data. (since r2023a)

if the reference impedance is a vector and the number of ports n equals the number of data frequencies k, n == k, then the sparameters object will assign each element of the vector to each port of the network. to specify reference impedances for each frequency in this case, specify z0 as a 3-d vector of length 1-by-1-by-k .

you cannot specify the z0 argument if you are importing the s-parameters data from a file. the z0 argument is optional and the function stores the impedance in the impedance property of the sparameters object.

rf data or circuit object. specify rfdataobj as either rfdata.data, or rfdata.network object or specify rfcktobj as any analyzed rfckt type object, such as rfckt.amplifier, rkckt.cascade object.

matching network, specified as a matchingnetwork object.

data types: char | string

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

data types: double

output arguments

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 — s-parameter frequencies, specified as a k-by-1 vector of positive real numbers sorted from smallest to largest. the function sets this property from the filename or freq input arguments.

  • parameters — s-parameter data, specified as an n-by-n-by-k array of complex numbers. the function sets this property from the filename or data input arguments.

  • impedance — reference impedance in ohms, specified as a positive real scalar. the function sets this property from the filename or z0 input arguments. if no reference impedance is provided, the function uses a default value of 50.

version history

introduced in r2012a

see also

| | | | | | | | |

topics

    网站地图