Main Content

plot

Plot circuit object parameters on X-Y plane

Description

example

plot(h,circuitPara) plots the circuit parameters specified in circuitPara from the RFCKT or RF data object h on the X-Y plane in the default format. You can specify one or more circuit parameters in circuitPara.

example

plot(h,circuitPara,xAxisPara,xAxisFmt) plots the circuit parameters on the X-Y plane along with the variables xAxisPara and their corresponding format xAxisFmt.

Derive xAxisPara and xAxisFmt for the RFCKT or RF data object h using the listparam(h) and listformat(h,'xAxisPara') commands, respectively.

example

plot(h,circuitPara,xAxisPara,xAxisFmt,opCon,opVal) plots the circuit parameters on the X-Y plane with operating conditions opCon and operating values opVal.

Derive operating conditions for the RFCKT or RF data object h using the getop(h) command.

example

plot(___,Name,Value) plots the circuit parameters with name-value arguments. Specify the name-value argument after any of the input argument combinations in the previous syntaxes.

plot(h,'budget',___) plots budget data on the X-Y plane from the rfckt.cascade object h. Specify any of the input argument combinations in the previous syntaxes after 'budget' .

example

plot(h,'mixerspur',k,pin,fin) plots the spur power of the rfckt.mixer object or rfckt.cascade object h that contains one or more mixers. For more information on plotting mixer spur power, see the Visualize Mixer Spurs example.

Note

For all circuit objects except those that contain data from a data file, you must perform a frequency domain analysis with the analyze function before calling plot.

plot(___,format) plots the data in the specified format.

example

lineseries = plot(___) returns a column vector of handles to lineseries objects with one handle per line. This output is the same as the output returned by the MATLAB® plot function.

Examples

collapse all

Create an RFCKT amplifier object.

 amp = rfckt.amplifier;

Plot the S11 and S12 parameters on the X-Y plane.

 plot(amp,'S11','S21')

Figure contains an axes object. The axes object with xlabel Freq [GHz], ylabel Magnitude (decibels) contains 2 objects of type line. These objects represent S_{11}, S_{21}.

Create an amplifier object from a P2D file.

ckt1 = read(rfckt.amplifier,'default.p2d');

Plot the output power of the amplifier in the X-Y plane.

plot(ckt1,'Pout','Freq','GHz')

Figure contains an axes object. The axes object with xlabel Freq [GHz], ylabel dBm contains 3 objects of type line. These objects represent P_{out}(P_{in}=0[dBm];Bias=1.5), P_{out}(P_{in}=9.52872[dBm];Bias=1.5), P_{out}(P_{in}=19[dBm];Bias=1.5).

Create an amplifier object from a P2D file.

ckt1 = read(rfckt.amplifier,'default.p2d');

Plot the output power of the amplifier with the bias set to 1.5 v.

plot(ckt1,'Pout','Freq','GHz','bias',1.5)

Figure contains an axes object. The axes object with xlabel Freq [GHz], ylabel dBm contains 3 objects of type line. These objects represent P_{out}(P_{in}=0[dBm];Bias=1.5), P_{out}(P_{in}=9.52872[dBm];Bias=1.5), P_{out}(P_{in}=19[dBm];Bias=1.5).

Create an amplifier object from a P2D file.

ckt1 = read(rfckt.amplifier, 'default.p2d');

Plot the output power of the amplifier when the input power is 18 dBm.

plot(ckt1,'Pout','Freq','GHz','bias',1.5,'Pin',18)

Figure contains an axes object. The axes object with xlabel Freq [GHz], ylabel dBm contains an object of type line. This object represents P_{out}(P_{in}=18[dBm];Bias=1.5).

Create two amplifiers by specifying an rfdata.network object as an input to an rfckt.amplifier object.

ai1 = rfckt.amplifier('NetworkData', ...
    rfdata.network('Type','S','Freq',2.1e9,'Data',[0,0;3.98,0]), ...
    'NoiseData',2,'NonlinearData',35);
ai2 = rfckt.amplifier('NetworkData', ...
    rfdata.network('Type','S','Freq',2.1e9,'Data',[0,0;31.66,0]), ...
    'NoiseData',8,'NonlinearData',37);

Create a microstrip transmission line with an rfckt.microstrip object.

tx1 = rfckt.microstrip('Thickness',0.0075e-6);

Cascade the circuit using an rfckt.cascade object.

c = rfckt.cascade('Ckts',{ai1 ai2 tx1});

Analyze the cascaded circuit and plot the 3-D S11 and S21 plot.

analyze(c,linspace(2.08e9,2.12e9,100));
plot(c,'budget','S11','S21','Freq','GHz')

Figure contains an axes object. The axes object with xlabel Freq [GHz], ylabel Stage of cascade contains 2 objects of type line. These objects represent S_{11}, S_{21}.

Create an rfckt.microstrip object.

tx1 = rfckt.microstrip;

Analyze and plot the S11 parameter of the microstrip transmission line from 1– 2.4 GHz

analyze(tx1,1e9:0.4e9:2.4e9);
lineseries = plot(tx1,'S11')
lineseries = 
  Line (S_{11}) with properties:

              Color: [0 0.4470 0.7410]
          LineStyle: '-'
          LineWidth: 0.5000
             Marker: 'none'
         MarkerSize: 6
    MarkerFaceColor: 'none'
              XData: [1 1.4000 1.8000 2.2000]
              YData: [-55.0369 -50.9945 -47.8763 -45.4391]

  Use GET to show all properties

Change the color of the S11 plot.

set(lineseries,'Color',[0.7 0.3 0.35])

Figure contains an axes object. The axes object with xlabel Freq [GHz], ylabel Magnitude (decibels) contains an object of type line. This object represents S_{11}.

Input Arguments

collapse all

RF circuit or data object, specified as an RFCKT or RF data object. For a complete list of RFCKT and RF data objects, see RF Circuit Objects and RF Data Objects, respectively.

Data Types: char | string

Valid circuit parameters of the RFCKT or RF data object, specified as a character vector or string scalar.

Use listparam(h) for a list of valid parameters for the circuit or data object h. You can also use listformat(h,parameter) to see the valid formats for a specific parameter. For more information, see listparam.

Independent variable to plot with the circuit parameters circuitPara, values specified in the table given. This table shows the circuitPara and their corresponding xAxisPara values. The function uses the default values listed in the table if you do not specify xAxisPara.

circuitPara ValuexAxisPara Value
Pout, Phase, LS11, LS12, LS21, LS22Pin (default), Freq
S11, S12, S21, S22, NF, IIP3, OIP3, GroupDelay, VSWRIn, VSWROut, GammaIn, GammaOut, FMIN, GammaOPT, RN, TF1, TF2, Gt, Ga, Gp, Gmag, Gmsg, GammaMS, GammaML, K, Delta, Mu, MuPrimeFreq
AM/AM, AM/PMAM

xAxisPara format, specified as a character vector or string scalar. You do not need to specify xAxisFmt when xAxisPara is an operating condition.

This table shows the commonly used xAxisPara values and their corresponding xAxisFmt values. The function uses the default values listed in the table if you do not specify xAxisFmt .

xAxisPara ValuexAxisFmt Value
PindBm (default), mW, W, dBW
Freq

THz, GHz, MHz, KHz, Hz

If you do not specify xAxisFmt, the function chooses the xAxisFmt value that provides the best scaling for the given xAxisPara value.

AMMagnitude (decibels) (default), Magnitude (linear)

Example: plot(h,'Pout','Pin','mW') plots data on the X-Y plane for the circuit object h with xAxisPara set to 'Pin' and xAxisFmt set to 'mW'.

Operating conditions derived from a P2D or S2D file, specified as a string scalar or a character vector.

For some circuit parameters, you can specify a set of frequency or input power values at which the function plots the specified parameter.

For example:

  • When plotting large-signal S-parameters as a function of input power, you can specify frequency points of interest using opCon and opVal arguments.

  • When plotting large-signal S-parameters as a function of frequency, you can specify input power levels of interest using opCon and opVal arguments.

  • When plotting parameters as a function of an operating condition, you can specify both frequency and input power values using opCon and opVal arguments.

Enter the getop(h) command at the command line to get the operating conditions for the RF circuit object h.

Value of the operating conditions in the opCon argument, specified as a scalar.

Example: plot(h,'Pout','Pin','mW','bias',1.5) plots the data on the X-Y plane for circuit object h with opCon set to 'bias' and value set to 1.5.

Budget parameter of an rfckt.cascade object, specified as a budget parameter object handle.

The following table summarizes the parameters and formats that are available for a budget plot.

Parameter

Format

S11, S12, S21, S22, Sij

Magnitude (decibels)
Magnitude (linear)
Angle (degrees)
Real
Imaginary

OIP3

dBm
dBW
W
mW

NF

Magnitude (decibels)
Magnitude (linear)

Format of data, specified as a string scalar or character vector. The format determines if RF Toolbox™ converts the parameter values to a new set of units or operates on the components of complex parameter values. For example:

  • Specify format as 'Real' to plot the real part of the circuit parameter.

  • Specify format as 'None' to plot the unchanged parameter values.

Use the listformat function to get a list of the valid formats for a particular parameter.

Index of the circuit object to plot spur power, specified as an integer or 'all'. This value creates a budget plot of the spur power for h. Use 0 to plot the power at the input of h.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: plot(h,'Pout','Pin','Freq',2.1e9)

Frequency, specified as a positive scalar in Hz.

Input power level, specified as a positive scalar in dBm.

Input frequency value, specified as a positive scalar in Hz to plot the spur power. The default value of fin varies based on h.

  • If h is an rfckt.mixer object, the default value of fin is the input frequency at which the magnitude of the S21 parameter of the mixer, in decibels, is highest.

  • If h is an rfckt.cascde object, the default value of fin is the input frequency at which the magnitude of the S21 parameter of the first mixer in the cascade is highest.

Note

When you create a spur plot for an object, the previous input frequency value is used for subsequent plots until you specify a different value.

Output Arguments

collapse all

lineseries object, returned as a column vector of object handles.

Tips

  • Use the Property Editor (propertyeditor) or the MATLAB set function to change Line Properties. For more information and complete description of object properties, see figure, axes, and text.

  • Use the MATLAB plot function to plot network parameters specified as vector data and not as part of a circuit (rfckt) object or data (rfdata) object.

Alternatives

rfplotThe function creates magnitude-frequency plots for RF Toolbox S-parameter objects.

Version History

Introduced before R2006a