### Where To Find This Example

#### AWR Version 14

This example was removed in V14.

#### AWR Version 13

Select **Help > Open Examples...** from the menus and type either the example name listed above or one of the keywords below.

Or in Version 13 you can open the project directly from this page using this button.

### Design Notes

**User Defined Measurements**

This project shows how users can define their own measurements to manipulate AWR Design Environment simulation data. The example measurement looks at a power sweep and computes the output 1 dB compression point and saturation power for both a single and multiple frequency sweeps.

**Overview**

The first measurement shown in this project takes in two vectors, power in and power out and computes the 1 dB compression point. There are two cases, one where there is only a single frequency and one where there are multiple frequencies. The second measurement shown takes in one vector, power out and finds the value where the power saturates

User defined measurements are done with the AWR Design Environment Visual Basic Scripting Editor. These measurements are available to be used as "Output Equations." Their returned values can be viewed on graphs like regular measurements, like the "Single_Frequency_P1dB" graph or directly on the **Output Equations** page.

To start the Visual Basic Scripting Editor, click on the **Scripting Editor** Button on the tool bar.

The user defined measurements are under the "Code Module" node of the second "Script" node (which corresponds to scripts for this project only) in a module called "Equations."

Double clicking on "Equations", you will see two functions, psat and p1db().

**Single_Frequency Schematic**

This schematic "Single_Frequency" has a single FET and a swept power port. The "Single_Frequency_Pin vs Pout" graph shows the FET compressing as the input power is raised. The frequency for this schematic is set to 10 GHz.

**Multiple_Frequency Schematic**

This schematic "Multiple_Frequency" is identical to the "Single_Frequency" except it is setup to sweep from 5 to 15 GHz.

**Output Equations**

The output equations page is where the user defined measurement is used. First, two vectors are defined, one for the input power and one for the output power. Next, the p1db() measurement is called. The function looks like:

<output> = P1dB(<input_power>, <output_power>, <compression_point>) where,

<output> = single value or vector returned from this function

<input_power> = variable containing a vector of input power numbers

<output_power> = variable containing a vector of output power numbers

<compression_point> = integer number of compression point to find (e.g., 1dB, 2dB, etc).

The psat() function is called next. The function looks like:

<output> = psat(<output_power>, <tolerance>)

where,

<output> = single value or vectorreturned from this function

<output_power> = variable containing a vector of output power numbers

<tolerance> = value to determine when saturation has happened. When the difference between values in the <output_power> vector are less than this value, the psat value has been found.

The outputs of the measurements are displayed directly on the Output Equations page using the ":" character to display a variable's values.

There are a second set of equations for the multiple frequency case. .

**Graphs**

See the graphs in the project for both the single frequency and multiple frequency cases. At the original bias point (1 V), the markers on the "Single_Frequency_Power Gain"** **graph find the input power where the gain drops by 1 dB. Then the "Single_Frequency_Pout vs Pin" graph has a marker showing the output power at the p1dB input power. This value matches the value returned from the output Equations.

**Tuning and Optimizing**

The supply voltage for the "Single_Frequency" schematic has been setup for tuning and optimization. First, turn off the graphs for the multiple frequency cases to speed up the simulations. Open the tuner (**Simulate > Tune** from the menus) and slide the supply power and watch all the graphs change. Then you can start the optimizer (**Simulate > Optimize ** and click start) to watch the software find the right supply voltage to achieve a P1dB of 16 dBm. The supply voltage on the schematic should be approximately 6 volts.

## Schematic - Multiple_Frequency

## Graph - Load_Pull

## Graph - Single_Frequency_P1dB_and_PSAT

## Graph - Single_Frequency_Pin vs Pout