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
Syntax
Description
nport_obj = nport(
creates an n-port object and sets the NetworkData.netparamobj
)
nport_obj = nport(___,
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.name
)
sets the Properties of an
nport_obj
= nport(Name=Value)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
FileName
— Touchstone file
string scalar | character vector
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
NumPorts
— Number of ports
scalar
Number of ports, specified as a scalar.
Example: 2
Input
— Input port number of multiport element in RF budget
1
(default) | scalar
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
Output
— Output port number of multiport element in RF budget
2
(default) | scalar
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
Termination
— Impedance to terminate unused ports of multiport elements in RF budget
NetworkData.Impedance
(default) | real nonegative scalar | real nonnegative vector
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
to0
Open-circuit termination — Set
Termination
toInf
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[]
, thenport
element is no longer treated as a two-port element and theInput
andOutput
properties will not appear in the property list. (since R2024a)Delete the
rfbudget
object before setting theTermination
to[]
when thenport
object is an input to therfbudget
object.
When the
nport
object is specified with anInput
,Output
, andTermination
, the resulting S-parameters are equivalent tosnp2smp(n.NetworkData,[n.Input n.Output],n.Termination)
, wheren
represents the number of ports.
Example: 75
NetworkData
— Network data
scalar
Network data, specified as a scalar. Network data can be of S, Z, Y, ABCD, h, or g-parameters.
NoiseData
— Noise Data of two-port element
noiseParameter
object | []
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
— Name of nport
object
scalar
Name of nport
object, specified as a scalar.
Example: nportobj
Ports
— Port names
cell vector
Port names, stored as a cell vector. This property is a read only.
Example: {’p1’ ‘p2’}
Terminals
— Terminal names
cell vector
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.
ParentNodes
— Parent circuit nodes connected to n-port object terminals
vector of integers.
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.
ParentPath
— Full path of circuit to which n-port object belongs
character vector
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
Examples
Create N-port Object
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 N-Port Object to Circuit
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'
Treat Three-Port Element As Two-Port Element
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 R2013bR2024a: Updates to Input
, Output
, and Termination
properties
The updates to the Input
, Output
, and
Termination
properties are as follows:
If you set the
Input
property to the same port number as theOutput
property, thenport
object assigns a new port number to theOutput
property through a circular right-shift.If you set the
Output
property to the same port number as theInput
property, thenport
object assigns a new port number to theInput
property using a circular left-shift.If you input the
nport
object to anrfbudget
object or a two-portNoiseData
is provided as an input to annport
object, you cannot set theTermination
property to[]
. In such cases, specify theTermination
property as a real nonnegative scalar or nonnegative vector.
R2023b: Treat multiport n-port element as two-port element
Use the Input
, Output
, and
Termination
properties of the nport
object
to treat a multiport n-port element as 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.
R2023b: Recommended over rfckt.passive
and rfdata.noise
nport
is recommend over rfckt.passive
and
rfdata.noise
because it enables you to:
Create passive RF S-parameter components and networks that are characterized by passive network parameter data.
Model a passive RF S-parameter components in an RF chain created using an
rfbudget
object or the RF Budget Analyzer app.Export the passive RF S-parameter components to RF Blockset™ or to
rfsystem
System object™ for circuit envelope or idealized baseband analysis.Build a n-port element with the noise data, specified as a
noiseParameters
object. ThenoiseParameter
object contains a frequency-dependent noise figure loaded from a two-port Touchstone file or built at the MATLAB® command line.
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)