Engee documentation

sparameters

Calculates S-parameters for radio frequency data, networks, circuits, and related objects.

Library

EngeeRF

Syntax

Function call

  • sobj = sparameters(filename) — creates an object of S-parameters sobj by importing data from the Touchstone file specified in filename.

  • sobj = sparameters(data, freq) — creates an S-parameter object based on the S-parameter data data and frequencies freq.

  • sobj = sparameters(data, freq, Z0) — creates an S-parameter object based on the S-parameter data data and frequencies freq with a given design impedance Z0.

  • sobj = sparameters(rfobj, freq) — calculates the S-parameters of a radio frequency object, such as a filter, circuit, transmission line, serial or RLC shunt object, attenuator, or radio frequency antenna with a calculated default impedance.

  • sobj = sparameters(rfobj, freq, Z0) — calculates the S-parameters of a radio frequency object, such as a filter, circuit, or transmission line, with a given design impedance Z0.

  • sobj = sparameters(netparamobj) — transforms an object of network parameters netparamobj to the S-parameter object with the calculated impedance by default.

  • sobj = sparameters(netparamobj, Z0) — transforms an object of network parameters netparamobj into an S-parameter object with a specified design impedance Z0.

  • sobj = sparameters(rfdataorckt) — extracts network data from rfdataobj or rfcktobj and converts them into an object of S-parameters.

  • sobj = sparameters(mnobj) — returns the S-parameters of the best matching circuit calculated for a list of frequencies based on load resistance and source resistance.

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

  • sobj = sparameters(mnobj, freq, Z0) — returns the S-parameters of the best matching circuit at each specified frequency freq and the characteristic resistance Z0.

  • sobj = sparameters(_, circuitindices) — returns an array of S-parameter objects, one object for each chain specified in circuitindices. Use this option with any combination of input arguments from the previous syntaxes.

Arguments

Input arguments

# filename — Touchstone file

+ line | character vector

Details

A Touchstone data file specified as a character vector containing data about network parameters.

# data — S-parameter data
an array of complex numbers

Details

S-parameter data, specified as an array of complex numbers of the size on on .

# freq — frequencies of S-parameters

+ positive real vector

Details

The frequencies of the S-parameters are defined as a vector of positive real numbers sorted from smallest to largest.

# Z0 is the calculated impedance, ohms

+ 50 | positive real scalar | positive real vector

Details

The calculated impedance in ohms is set using one of the following methods:

  • A positive real scalar, if you want to set the same calculated impedance for all network ports.

  • A positive real vector of length if you want to set a different design impedance for each port in - the port network.

  • A positive real vector of length if you want to set a different design impedance for each of the frequencies in the data.

If the calculated impedance is a vector, and the number of ports is is equal to the number of data frequencies , , then the function sparameters assigns each element of the vector to each network port. To set the calculated impedance for each frequency in this case, specify Z0 as a three-dimensional vector of size 1 by 1 on .

Argument Z0 it cannot be specified when importing S-parameter data from a file. Argument Z0 is optional, and the function stores the resistance in the property Impedance the object sobj.

# rfobj — radio frequency object

+ RF object

Details

A radio frequency (RF) object, specified as one of the following:

  • The object of the electrical circuit diagram circuit.

  • RF Filter Object: rffolter and lcladder.

  • Transmission Line object: txlineCoaxial, txlineCPW, txlineMicrostrip, txlineParallelPlate, txlineRLCGLine, txlineLumped, txlineTwoWire, txlineEquationBased, txlineDelayLossless, txlineDelayLossy, txlineElectricalLength, txlineStripline.

  • Sequential and shunting RLC facilities: seriesRLC and shuntRLC.

  • Attenuator Object attenuator.

  • RF Antenna Object rfantenna.

  • The phase shift object phaseshift.

  • The IMT mixer object mixerIMT.

  • RF Divider object rfdivider.

  • Mutual inductance object mutualInductor.

# netparamobj — object of network parameters

+ the object of network parameters

Details

An object of network parameters of the following types: sparameters, yparameters, zparameters, gparameters, hparameters, abcdparameters and tparameters.

# rfdataorktt — RF data object or schema

+ RF data object | RF network object

Details

An RF data object or schema. Specify rfdataobj as an object rfdata.data or rfdata.network, or specify rfcktobj like any analyzed object of the type rfckt For example, rfckt.amplifier or rkckt.cascade.

# mnobj — matching circuit

+ the object of the matching scheme

Details

Matching scheme specified as an object matchingnetwork.

Типы данных

String, Char

# circuitindices — index of the matching circuit

+ scalar

Details

The index of the matching scheme, set as a scalar.

Типы данных

Float64

Output arguments

# sobj — S-parameter data

+ the S-parameter object

Details

S-parameter data returned as an object. The object contains the following properties:

  • NumPorts — the number of ports as an integer. The function calculates this value automatically when creating an object.

  • Frequencies — frequencies of S-parameters in the form of a vector of size There are 1 positive real numbers sorted from smallest to largest. The function sets this property based on the arguments filename or freq.

  • Parameters — S-parameter data in the form of an array of complex numbers of the size on on . The function sets this property based on the arguments filename or data.

  • Impedance — the calculated impedance in ohms in the form of a positive real scalar. The function sets this property based on the arguments filename or Z0. If the calculated impedance is not specified, the function uses the default value. 50.

Examples

Calculation of S-parameters for a schema object

Details

Create a resistor R50 and add it to the schema object. example1. Calculate the S-parameters for example1 and output the properties of the S-parameter object.

using EngeeRF
hR1 = resistor(50,"R50")
hckt1 = circuit("example1")
add(hckt1,[1 2],hR1)
setports(hckt1, [1 0],[2 0])
freq = range(1e3, 2e3, length=100)
S = sparameters(hckt1,freq,100)

println("NumPorts - ", S.NumPorts)
println("Parameters - ", summary(S.Parameters))
println("Frequencies - ", summary(S.Frequencies))
println("Impedance - ", S.Impedance)
NumPorts - 2
Parameters - 2×2×100 Array{Float64, 3}
Frequencies - 100-element StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}
Impedance - 100