Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

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:

  • Specify format as Real to compute the real part of the selected parameter.

  • Specify format as 'none' to return the parameter values unchanged.

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 of the parameters in data. freq is a vector of frequencies at which the parameters are known.

Note

Before calling calculate, you must use the analyze method to perform a frequency domain analysis for the circuit object.

[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, 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 (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:

  • When you calculate large-signal S-parameters as a function of input power, you can specify frequency points of interest using condition/value pairs.

  • When you calculate large-signal S-parameters as a function of frequency, you can specify input power levels of interest using condition/value pairs.

  • When you calculate parameters as a function of an operating condition, you can specify both frequency and input power values using condition/value pairs.

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:

  • ydata — The calculated values of the specified parameter.

  • params — The names of the parameters in xdata and ydata.

  • xdata — The xparameter values at which the specified parameters are known.

    Note

    For compatibility reasons, if xdata contains only one vector or if all xdata values are equal, then xdata is a numeric vector rather than a cell of a single vector.

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

  • If you do not specify any operating conditions as arguments to the calculate method, then the method returns the parameter values based on the currently selected operating condition.

  • If one or more operating conditions are specified, the calculate method returns the parameter values based on those operating conditions.

  • When an operating condition is used for the xparameter input argument, the xdata cell array returned by the calculate method contains the operating condition values in ascending order.

Examples

Calculate S-Parameters of Transmission Line

Analyze a general tranmission line of impedance, 50 ohms, phase velocity of 299792458 m/s, and line length of 0.01 meters for frequencises 1.0 GHz to 3.0 GHz.

trl = rfckt.txline;
f = 1e9:1.0e7:3e9;
analyze(trl,f)
ans = 

   rfckt.txline with properties:

        LineLength: 0.0100
          StubMode: 'NotAStub'
       Termination: 'NotApplicable'
              Freq: 1.0000e+09
                Z0: 50.0000 + 0.0000i
                PV: 299792458
              Loss: 0
          IntpType: 'Linear'
             nPort: 2
    AnalyzedResult: [1x1 rfdata.data]
              Name: 'Transmission Line'

Calculate the S11 and S22 parameters in dB.

[data,params,freq] = calculate(trl,'S11','S22','dB')
data =

  1x2 cell array

    {201x1 double}    {201x1 double}


params =

  1x2 cell array

    {'S_{11}'}    {'S_{22}'}


freq =

   1.0e+09 *

    1.0000
    1.0100
    1.0200
    1.0300
    1.0400
    1.0500
    1.0600
    1.0700
    1.0800
    1.0900
    1.1000
    1.1100
    1.1200
    1.1300
    1.1400
    1.1500
    1.1600
    1.1700
    1.1800
    1.1900
    1.2000
    1.2100
    1.2200
    1.2300
    1.2400
    1.2500
    1.2600
    1.2700
    1.2800
    1.2900
    1.3000
    1.3100
    1.3200
    1.3300
    1.3400
    1.3500
    1.3600
    1.3700
    1.3800
    1.3900
    1.4000
    1.4100
    1.4200
    1.4300
    1.4400
    1.4500
    1.4600
    1.4700
    1.4800
    1.4900
    1.5000
    1.5100
    1.5200
    1.5300
    1.5400
    1.5500
    1.5600
    1.5700
    1.5800
    1.5900
    1.6000
    1.6100
    1.6200
    1.6300
    1.6400
    1.6500
    1.6600
    1.6700
    1.6800
    1.6900
    1.7000
    1.7100
    1.7200
    1.7300
    1.7400
    1.7500
    1.7600
    1.7700
    1.7800
    1.7900
    1.8000
    1.8100
    1.8200
    1.8300
    1.8400
    1.8500
    1.8600
    1.8700
    1.8800
    1.8900
    1.9000
    1.9100
    1.9200
    1.9300
    1.9400
    1.9500
    1.9600
    1.9700
    1.9800
    1.9900
    2.0000
    2.0100
    2.0200
    2.0300
    2.0400
    2.0500
    2.0600
    2.0700
    2.0800
    2.0900
    2.1000
    2.1100
    2.1200
    2.1300
    2.1400
    2.1500
    2.1600
    2.1700
    2.1800
    2.1900
    2.2000
    2.2100
    2.2200
    2.2300
    2.2400
    2.2500
    2.2600
    2.2700
    2.2800
    2.2900
    2.3000
    2.3100
    2.3200
    2.3300
    2.3400
    2.3500
    2.3600
    2.3700
    2.3800
    2.3900
    2.4000
    2.4100
    2.4200
    2.4300
    2.4400
    2.4500
    2.4600
    2.4700
    2.4800
    2.4900
    2.5000
    2.5100
    2.5200
    2.5300
    2.5400
    2.5500
    2.5600
    2.5700
    2.5800
    2.5900
    2.6000
    2.6100
    2.6200
    2.6300
    2.6400
    2.6500
    2.6600
    2.6700
    2.6800
    2.6900
    2.7000
    2.7100
    2.7200
    2.7300
    2.7400
    2.7500
    2.7600
    2.7700
    2.7800
    2.7900
    2.8000
    2.8100
    2.8200
    2.8300
    2.8400
    2.8500
    2.8600
    2.8700
    2.8800
    2.8900
    2.9000
    2.9100
    2.9200
    2.9300
    2.9400
    2.9500
    2.9600
    2.9700
    2.9800
    2.9900
    3.0000

Introduced before R2006a

Was this topic helpful?