calculate - Calculate specified parameters for circuit object

Syntax

[data,params,freq] = calculate(h,'parameter1',...,'parametern', 'format')
[ydata,params,xdata] = calculate(h,'parameter1',...,'parametern', 'format',xparameter,xformat, 'condition1',value1,...,'conditionm',valuem, 'freq',freq,'pin',pin)

Description

[data,params,freq] = calculate(h,'parameter1',...,'parametern', 'format') calculates the specified parameters for the object h and returns them in the n-element cell array data.

The input h is the handle of a circuit object.

parameter1,..., parametern is the list of parameters to be calculated. Use the listparam method to get a list of the valid parameters for a circuit object.

format is the format of the output data. The format determines if RF Toolbox™ software converts the parameter values to a new set of units, or operates on the components of complex parameter values.

For example:

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

The output params is an n-element cell array containing the names, as strings, of the parameters in data. freq is a vector of frequencies at which the parameters are known.

[ydata,params,xdata] = calculate(h,'parameter1',...,'parametern', 'format',xparameter,xformat, 'condition1',value1,...,'conditionm',valuem, 'freq',freq,'pin',pin) calculates the specified parameters at the specified operating conditions for the object h.

xparameter is the independent parameter for which to calculate the specified parameters. Several xparameter values are available for all objects. When you import rfckt.amplifier, rfckt.mixer, or rfdata.data object specifications from a .p2d or .s2d file, you can also specify any operating conditions from the file that have numeric values, such as bias.

The following table shows the most commonly available parameters and the corresponding xparameter values. The default settings listed in the table are used if xparameter is not specified.

Parameter Namexparameter values
Pout, Phase, LS11, LS12, LS21, LS22Pin (default), Freq
S11, S12, S21, S22, NF, 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 (default, and only available value)

xformat is the format to use for the specified xparameter. No xformat specification is needed when xparameter is an operating condition.

The following table shows the xformat values that are available for the xparameter values listed in the preceding table, along with the default settings that are used if xformat is not specified.

xparameter valuesxformat values
PindBm (default), mW, W, dBW
Freq

THz, GHz, MHz, KHz, Hz

By default, xformat is chosen to provide the best scaling for the given xparameter values.

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

condition1,value1,..., conditionm,valuem are the optional condition/value pairs at which to calculate the specified parameters. These pairs are usually operating conditions from a .p2d or .s2d file. For some parameters, you can specify a set of frequency or input power values at which to calculate the specified parameter.

For example:

freq is the optional frequency value at which to calculate the specified parameters.

pin is the optional input power value at which to calculate the specified parameters.

The method returns the following n-element cell arrays:

If h has multiple operating conditions, such as from a .p2d or .s2d file, the calculate method operates as follows:

Examples

Analyze a general transmission line, trl, with the default characteristic impedance of 50 ohms, phase velocity of 299792458 meters per second, and line length of 0.01 meters for frequencies of 1.0 GHz to 3.0 GHz. Then, calculate the S11 and S22 parameters in decibels.

trl = rfckt.txline;
f = [1e9:1.0e7:3e9];
analyze(trl,f);
[data,params,freq] = calculate(trl,'S11','S22','dB')

data = 
    [201x1 double]    [201x1 double]
params = 
    'S_{11}'    'S_{22}'

freq = 1.0e+009 *

    1.0000
    1.0100
    1.0200
		...

The params output is formatted so you can use it as a plot legend. The first few elements of data{1} look like

ans =

 1.0e+003 *

   -6.4661
   -0.3372
   -0.3432
   -0.3432
   -0.3432
  ...

See Also

analyze
extract
getz0
listformat
listparam
loglog
plot
plotyy
polar
semilogx
semilogy
smith
read
restore
write

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS