Main Content

Specify or Import Component Data

RF Object Properties

Object properties specify the behavior of an object. You can specify object properties, or you can import them from a data file. To learn about properties that are specific to a particular type of circuit, data, or model object, see the reference page for that type of object.

Note

The RF Circuit Objects, RF Data Objects,RF Model Objects sections list the available types of objects and provide links to their reference pages.

Set Property Values

You can specify object property values when you construct an object or you can modify the property values of an existing object.

This section contains the following topics:

Specify Property Values at Construction

To set a property when you construct an object, include a comma-separated list of one or more property/value pairs in the argument list of the object construction command. A property/value pair consists of the arguments 'PropertyName',PropertyValue, where:

  • PropertyName is a character vector specifying the property name. The name is case-insensitive. In addition, you need only type enough letters to uniquely identify the property name. For example, 'st' is sufficient to refer to the StubMode property.

    Note

    You must use single quotation marks around the property name.

  • PropertyValue is the value to assign to the property.

Include as many property names in the argument list as there are properties you want to set. Any property values that you do not set retain their default values. The circuit and data object reference pages list the valid values as well as the default value for each property.

This section contains examples of how to perform the following tasks:

Construct Components with Specified Properties.  The following code creates a coaxial transmission line circuit object to represent a coaxial transmission line that is 0.05 meters long. Notice that the toolbox lists the available properties and their values.

t1 = rfckt.coaxial('LineLength',0.05)

t1 =
 
              Name: 'Coaxial Transmission Line'
             nPort: 2
    AnalyzedResult: []
        LineLength: 0.0500
          StubMode: 'NotAStub'
       Termination: 'NotApplicable'
       OuterRadius: 0.0026
       InnerRadius: 7.2500e-004
               MuR: 1
          EpsilonR: 2.3000
         LossTangent: 0
         SigmaCond: Inf

Construct Networks of Specified Components.  To combine a set of RF components and existing networks to form an RF network, you create a network object with the Ckts property set to an array containing the handles of all the circuit objects in the network.

Suppose you have the following RF components:

t1 = rfckt.coaxial('LineLength',0.05);
a1 = rfckt.amplifier;
t2 = rfckt.coaxial('LineLength',0.1);

The following code creates a cascaded network of these components:

casc_network = rfckt.cascade('Ckts',{t1,a1,t2});

Change Property Values of an Existing Object

There are two ways to change the properties of an existing object:

  • Using the set command

  • Using structure-like assignments called dot notation

This section discusses the first option. For details on the second option, see Reference Properties Directly Using Dot Notation.

To modify the properties of an existing object, use the set command with one or more property/value pairs in the argument list. The general syntax of the command is

set(h,Property1',value1,'Property2',value2,...)

where

  • h is the handle of the object.

  • 'Property1',value1,'Property2',value2,... is the list of property/value pairs.

For example, the following code creates a default coaxial transmission line object and changes it to a series stub with open termination.

t1 = rfckt.coaxial;
set(t1,'StubMode','series','Termination','open')

Note

You can use the set command without specifying any property/value pairs to display a list of all properties you can set for a specific object. This example lists the properties you can set for the coaxial transmission line t1:

set(t1)

ans = 
     LineLength: {}
       StubMode: {}
    Termination: {}
    OuterRadius: {}
    InnerRadius: {}
            MuR: {}
       EpsilonR: {}
      LossTangent: {}
      SigmaCond: {}

Import Property Values from Data Files

RF Toolbox™ software lets you import industry-standard data files, MathWorks® AMP files, and Agilent® P2D and S2D files into specific objects. This import capability lets you simulate the behavior of measured components.

You can import the following file formats:

  • Industry-standard file formats — Touchstone SNP, YNP, ZNP, HNP, and GNP formats specify the network parameters and noise information for measured and simulated data.

    For more information on Touchstone files, see https://ibis.org/connector/touchstone_spec11.pdf.

  • Agilent P2D file format — Specifies amplifier and mixer large-signal, power-dependent network parameters, noise data, and intermodulation tables for several operating conditions, such as temperature and bias values.

    The P2D file format lets you import system-level verification models of amplifiers and mixers.

  • Agilent S2D file format — Specifies amplifier and mixer network parameters with gain compression, power-dependent S21 parameters, noise data, and intermodulation tables for several operating conditions.

    The S2D file format lets you import system-level verification models of amplifiers and mixers.

  • MathWorks amplifier (AMP) file format — Specifies amplifier network parameters, output power versus input power, noise data and third-order intercept point.

    For more information about .amp files, see AMP File Data Sections.

This section contains the following topics:

Objects Used to Import Data from a File

One data object and three circuit objects accept data from a file. The following table lists the objects and any corresponding data format each supports.

ObjectDescriptionSupported Format(s)
rfdata.dataData object containing network parameter data, noise figure, and third-order intercept pointTouchstone, AMP, P2D, S2D
rfckt.amplifierAmplifierTouchstone, AMP, P2D, S2D
rfckt.mixerMixerTouchstone, AMP, P2D, S2D
rfckt.passiveGeneric passive componentTouchstone

How to Import Data Files

To import file data into a circuit or data object at construction, use a read command of the form:

obj = read(obj_type,'filename');

where

  • obj is the handle of the circuit or data object.

  • obj_type is the type of object in which to store the data, from the list of objects that accept file data shown in Objects Used to Import Data from a File.

  • filename is the name of the file that contains the data.

For example,

ckt_obj=read(rfckt.amplifier, 'default.amp');

imports data from the file default.amp into an rfckt.amplifier object.

You can also import file data into an existing circuit object. The following commands are equivalent to the previous command:

ckt_obj=rfckt.amplifier;
read(ckt_obj, 'default.amp');

Note

When you import component data from a .p2d or .s2d file, properties are defined for several operating conditions. You must select an operating condition to specify the object behavior, as described in Specify Operating Conditions.

Use Data Objects to Specify Circuit Properties

To specify a circuit object property using a data object, use the set command with the name of the data object as the value in the property/value pair.

For example, suppose you have the following rfckt.amplifier and rfdata.nf objects:

amp = rfckt.amplifier
f = 2.0e9;
nf = 13.3244;
nfdata = rfdata.nf('Freq',f,'Data',nf)

The following command uses the rfdata.nf data object to specify the rfckt.amplifier NoiseData property:

set(amp,'NoiseData',nfdata)

Set Circuit Object Properties Using Data Objects

In this example, you create a circuit object. Then, you create three data objects and use them to update the properties of the circuit object.

  1. Create an amplifier object. This circuit object, rfckt.amplifier, has a network parameter, noise data, and nonlinear data properties. These properties control the frequency response of the amplifier, which is stored in the AnalyzedResult property. By default, all amplifier properties contain values from the default.amp file. The NetworkData property is an rfdata.network object that contains 50-ohm S-parameters. The NoiseData property is an rfdata.noise object that contains frequency-dependent spot noise data. The NonlinearData property is an rfdata.power object that contains output power and phase information.

    amp = rfckt.amplifier
    

    The toolbox displays the following output:

    amp =
     
                  Name: 'Amplifier'
                 nPort: 2
        AnalyzedResult: [1x1 rfdata.data]
              IntpType: 'Linear'
           NetworkData: [1x1 rfdata.network]
             NoiseData: [1x1 rfdata.noise]
         NonlinearData: [1x1 rfdata.power]
    
  2. Create a data object that stores network data. Type the following set of commands at the MATLAB® prompt to create an rfdata.network object that stores the 2-port Y-parameters at 2.08 GHz, 2.10 GHz, and 2.15 GHz. Later in this example, you use this data object to update the NetworkData property of the rfckt.amplifier object.

    f = [2.08 2.10 2.15]*1.0e9;
    y(:,:,1) = [-.0090-.0104i, .0013+.0018i; ...
                              -.2947+.2961i, .0252+.0075i];
    y(:,:,2) = [-.0086-.0047i, .0014+.0019i; ...
                              -.3047+.3083i, .0251+.0086i];
    y(:,:,3) = [-.0051+.0130i, .0017+.0020i; ...
                              -.3335+.3861i, .0282+.0110i];
    
    netdata = rfdata.network('Type','Y_PARAMETERS',...
                             'Freq',f,'Data',y)
    

    The toolbox displays the following output:

    netdata =
     
        Name: 'Network parameters'
        Type: 'Y_PARAMETERS'
        Freq: [3x1 double]
        Data: [2x2x3 double]
          Z0: 50
    
  3. Create a data object that stores noise figure values. Type the following set of commands at the MATLAB prompt to create a rfdata.nf object that contains noise figure values, in dB, at seven different frequencies. Later in this example, you use this data object to update the NoiseData property of the rfckt.amplifier object.

    f = [1.93 2.06 2.08 2.10 2.15 2.30 2.40]*1.0e9;
    nf=[12.4521 13.2466 13.6853 14.0612 13.4111 12.9499 13.3244];
    
    nfdata = rfdata.nf('Freq',f,'Data',nf)
    

    The toolbox displays the following output:

    nfdata =
     
        Name: 'Noise figure'
        Freq: [7x1 double]
        Data: [7x1 double]
    
  4. Create a data object that stores output third-order intercept points. Type the following command at the MATLAB prompt to create a rfdata.ip3 object that contains an output third-order intercept point of 8.45 watts, at 2.1 GHz. Later in this example, you use this data object to update the NonlinearData property of the rfckt.amplifier object.

    ip3data = rfdata.ip3('Type','OIP3','Freq',2.1e9,'Data',8.45)
    

    The toolbox displays the following output:

    ip3data =
     
        Name: '3rd order intercept'
        Type: 'OIP3'
        Freq: 2.1000e+009
        Data: 8.4500
    
  5. Update the properties of the amplifier object. Type the following set of commands at the MATLAB prompt to update the NetworkData, NoiseData, and NonlinearData properties of the amplifier object with the data objects you created in the previous steps:

    amp.NetworkData = netdata;
    amp.NoiseData = nfdata;
    amp.NonlinearData = ip3data;
    

Retrieve Property Values

You can retrieve one or more property values of an existing object using the get command.

This section contains the following topics:

Retrieve Specified Property Values

To retrieve specific property values for an object, use the get command with the following syntax:

PropertyValue = get(h,PropertyName)

where

  • PropertyValue is the value assigned to the property.

  • h is the handle of the object.

  • PropertyName is a character vector specifying the property name.

For example, suppose you have the following coaxial transmission line:

h2 = rfckt.coaxial;

The following code retrieves the value of the inner radius and outer radius for the coaxial transmission line:

ir = get(h2,'InnerRadius')
or = get(h2,'OuterRadius')

ir =
  7.2500e-004

or =
    0.0026

Retrieve All Property Values

To display a list of properties associated with a specific object as well as their current values, use the get command without specifying a property name.

For example:

get(h2)
              Name: 'Coaxial Transmission Line'
             nPort: 2
    AnalyzedResult: []
        LineLength: 0.0100
          StubMode: 'NotAStub'
       Termination: 'NotApplicable'
       OuterRadius: 0.0026
       InnerRadius: 7.2500e-004
               MuR: 1
          EpsilonR: 2.3000
       LossTangent: 0
         SigmaCond: Inf

Note

This list includes read-only properties that do not appear when you type set(h2). For a coaxial transmission line object, the read-only properties are Name, nPort, and AnalyzedResult. The Name and nPort properties are fixed by the toolbox. The AnalyzedResult property value is calculated and set by the toolbox when you analyze the component at specified frequencies.

Reference Properties Directly Using Dot Notation

An alternative way to query for or modify property values is by structure-like referencing. The field names for RF objects are the property names, so you can retrieve or modify property values with the structure-like syntax.

  • PropertyValue = rfobj.PropertyName stores the value of the PropertyName property of the rfobj object in the PropertyValue variable. This command is equivalent to PropertyValue = get(rfobj,'PropertyName').

  • rfobj.PropertyName = PropertyValue sets the value of the PropertyName property to PropertyValue for the rfobj object. This command is equivalent to set(rfobj,'PropertyName',PropertyValue).

For example, typing

ckt = rfckt.amplifier('IntpType','cubic');
ckt.IntpType

gives the value of the property IntpType for the circuit object ckt.

ans =
		Cubic

Similarly,

ckt.IntpType = 'linear';

resets the interpolation method to linear.

You do not need to type the entire field name or use uppercase characters. You only need to type the minimum number of characters sufficient to identify the property name uniquely. Thus entering the commands

ckt = rfckt.amplifier('IntpType','cubic');
ckt.in

also produces

ans =
		Cubic

See Also