Main Content

nport

Create linear n-port circuit element

Description

The nport object creates an n-port element. You can add this element to an rfbudget object for RF Budget Analysis. You can input a n-port S-parameters and define it is an nport object.

Creation

Description

nport_obj = nport(filename) creates an n-port object and sets the FileName property.

example

nport_obj = nport(netparamobj) creates an n-port object and sets the NetworkData.

example

nport_obj = nport(___,name) creates an n-port object and sets the Name property. Specify the name-value argument after any of the input argument combinations in the previous syntaxes.

nport_obj = nport(Name=Value) sets the Properties of an nport object using one or more name-value arguments. For example, nport_obj = nport(FileName='passive.s2p') creates an nport object from passive.s2p. Properties you do not specify retain their default values.

Properties

expand all

Touchstone file, specified as a string scalar or character vector.

Note

The Touchstone file must be passive at all specified frequencies. To make n-port S-parameters passive, use the makepassive function.

Data Types: char | string

Number of ports, specified as a scalar.

Example: 2

Since R2023b

Input port number of a multiport (n-port) element in RF budget, specified as a scalar. Use this property to designate a port in a multiport element as an input port.

The Input, Output, and Termination properties enable you to treat a multiport (n-port) element as a two-port element. You can use the resulting two-port element in an rfbudget object to calculate the RF budget results for a chain of two-port elements.

Note

If you set the Input property to the same port number as the Output property, the nport object assigns a new port number to the Output property through a circular right-shift. For example, in a three-port element, if you set the Input and Output property to 2, then the nport object sets the Output property to 3. (since R2024a)

Example: 1

Since R2023b

Output port number of a multiport (n-port) element in an RF budget, specified as a scalar. Use this property to designate a port in a multiport element as the output port.

The Input, Output, and Termination properties enable you to treat a multiport (n-port) element as a two-port element. You can use the resulting two-port element in an rfbudget object to calculate the RF budget results for a chain of two-port elements.

Note

If you set the Output property is set to the same port number as the port number of the Input property, the nport object assigns a new port number to the Input property using a circular left-shift. For instance, in a three-port element, if you set the Input and Output property to 2, the nport object sets the Input property to 1. (since R2024a)

Example: 3

Since R2023b

Impedance to terminate unused ports of multiport elements in an RF budget, specified as a real nonnegative scalar or real nonnegative vector of length NumPorts in ohms. When you do not specify an impedance, the object terminates the unused ports by assigning them to NetworkData.Impedance. To create a:

  • Short-circuit termination — Set Termination to 0

  • Open-circuit termination — Set Termination to Inf

The Input, Output, and Termination properties enable you to treat a multiport (n-port) element as a two-port element. You can use this two-port element in an rfbudget object to calculate the RF budget results for a chain of two-port elements.

Note

  • When you set the Termination property to [], the nport element is no longer treated as a two-port element and the Input and Output properties will not appear in the property list. (since R2024a)

    • Delete the rfbudget object before setting the Termination to [] when the nport object is an input to the rfbudget object.

  • When the nport object is specified with an Input, Output, and Termination, the resulting S-parameters are equivalent to snp2smp(n.NetworkData,[n.Input n.Output],n.Termination), where n represents the number of ports.

Example: 75

Network data, specified as a scalar. Network data can be of S, Z, Y, ABCD, h, or g-parameters.

Noise data of the two-port element, specified as a noiseParameters object. The noiseParameter object contains a frequency-dependent noise figure loaded from a two-port Touchstone file or built at the MATLAB® command line. To reset the two-port element to noiseless, set the NoiseData to [].

When Numports is greater than 2 set the NoiseData property alongside the NetworkData property.

Example: NoiseData=np

Name of nport object, specified as a scalar.

Example: nportobj

Port names, stored as a cell vector. This property is a read only.

Example: {’p1’ ‘p2’}

Terminal names, stored as a cell vector. There are two terminals per port. The positive terminal names are listed first ('p1+', 'p2+'...) followed by the negative terminal ('p1–', 'p2–'...). This property is read only.

Parent circuit nodes connected to n-port object terminals, stored as a vector of integers. ParentNodes is same length as Terminals. This property is read only and appears only after you add the n-port data.

Full path of the circuit to which the n-port object belongs, stored as character vector. This property is read only and appear only after you add the n-port object is added to the circuit.

Object Functions

smithplotPlot impedance transformation for selected matching network on Smith Chart
cloneCreate copy of existing circuit element or circuit object

Examples

collapse all

Create and display N-port data object.

npass = nport('passive.s2p')
npass = 
  nport: N-port element

       FileName: 'passive.s2p'
    NetworkData: [1x1 sparameters]
           Name: 'Sparams'
       NumPorts: 2

Add a N-port object to a circuit. Display the object.

nobj = nport('passive.s2p');
ckt = circuit('example');
add(ckt,[1 2],nobj)
disp(nobj)
  nport: N-port element

       FileName: 'passive.s2p'
    NetworkData: [1x1 sparameters]
           Name: 'Sparams'
       NumPorts: 2
    ParentNodes: [1 2 0 0]
     ParentPath: 'example'

Since R2023b

Input a three-port Touchstone file to the nport object. To treat a three-port element as a two-port element, specify the input and output ports. This example assigns the port 1 as the input port and the port 3 as the output port. The object terminates port 2 with NetworkData.Impedance.

nport_obj = nport('default.s3p',Input=1,Output=3);

Create two-port elements to add them to the RF budget chain.

a = amplifier(Gain=4);
m = modulator(OIP3=13);
r = rfelement(Gain=10);

Add the n-port element and other two-elements to an RF budget chain and compute the budget results for the chain of two-port elements.

b = rfbudget([a m r nport_obj],2e9,-30,1e3)
b = 
  rfbudget with properties:

               Elements: [1x4 rf.internal.rfbudget.Element]
         InputFrequency:   2 GHz
    AvailableInputPower: -30 dBm
        SignalBandwidth:   1 kHz
                 Solver: Friis      
             AutoUpdate: true

   Analysis Results
        OutputFrequency: (GHz) [  2    3    3       3]
            OutputPower: (dBm) [-26  -26  -16  -16.32]
         TransducerGain: (dB)  [  4    4   14   13.68]
                     NF: (dB)  [  0    0    0       0]
                   IIP2: (dBm) []                     
                   OIP2: (dBm) []                     
                   IIP3: (dBm) [Inf    9    9       9]
                   OIP3: (dBm) [Inf   13   23   22.68]
                    SNR: (dB)  [114  114  114     114]

Version History

Introduced in R2013b

expand all