Products & Services Solutions Academia Support User Community Company

Learn more about RF Toolbox   

Specifying or Importing 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.

Setting 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:

Specifying 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

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:

Constructing 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

Constructing 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});

Changing Property Values of an Existing Object

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

This section discusses the first option. For details on the second option, see Direct Property Referencing 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

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')

Importing 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:

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

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');

Using 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)

Example — Setting 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;
    

Retrieving Property Values

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

This section contains the following topics:

Retrieving Specified Property Values

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

PropertyValue=get(h,PropertyName)

where

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

Retrieving 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

Direct Property Referencing 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 % gets property value
rfobj.PropertyName = PropertyValue % sets property value

These commands are respectively equivalent to

PropertyValue = get(rfobj,'PropertyName')
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
  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

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