Power Amplifier Functions¶
calculateCompression.m¶
Path: src\support\PAFunctions\calculateCompression.m
Description:
This function calculates peak RF performance metrics from power amplifier (PA) measurement data, including saturation power, peak gain, peak drain efficiency (DE), peak power-added efficiency (PAE), and -1 dB and -3 dB compression points.
Input Parameters
app - The application object containing the PA measurement data table.
idx - Logical or numeric index used to filter the rows of the PA data table for analysis.
Output Parameters
Psat - Table containing the maximum RF output power (Psat) per frequency and corresponding gain.
peakGain - Table of peak small-signal gain values per frequency.
peakDE - Table of maximum drain efficiency per frequency.
peakPAE - Table of maximum power-added efficiency per frequency.
compression1dB - Table containing the -1 dB gain compression points per frequency.
compression3dB - Table containing the -3 dB gain compression points per frequency.
calculateGainEfficiency.m¶
Path: src\support\PAFunctions\calculateGainEfficiency.m
Description:
This function calculates the RF Gain, Drain Efficiency (DE), and Power Added Efficiency (PAE) based on the specified input and output RF power and the DC power supplied to the drain.
Output Parameters
DCDrainPower - DC power supplied to the drain (in W).
Gain - RF Gain (dB).
DE - Drain Efficiency (%).
PAE - Power Added Efficiency (%).
createPAParametersTable.m¶
Path: src\support\PAFunctions\createPAParametersTable.m
Description:
This function generates a complete parameter sweep table for Power Amplifier (PA) testing. It creates all possible combinations of frequency, RF input power, voltage, and current based on the sweep settings defined in the application for each active PSU channel. The resulting table is used to drive automated PA characterization across various operating conditions, it contains the following columns:
Frequency (Hz)
RF Input Power (dBm)
Voltage (V) and Current (A) per active PSU channel
Input Parameters
app - App object containing configuration parameters for frequency, RF input power, and power supply settings.
Output Parameters
ParametersTable - The resulting parameters table containing all combinations of PA test settings.
createPAResultsTable.m¶
Path: src\support\PAFunctions\createPAResultsTable.m
Description:
This function initializes an empty results table for Power Amplifier (PA) measurements, with columns dynamically generated based on the number of active PSU channels configured in the application. The table is pre-allocated to the specified number of measurements and channels. For n channels:
Frequency (MHz)
Channel 1 Voltage (V) (if n = 1)
…
Channel n Voltages (V)
RF Input Power (dBm)
RF Output Power (dBm)
Gain
Channel 1 DC Current (A) (if n = 1)
…
Channel n DC Current (A)
Channel 1 DC Power (W) (if n = 1)
…
Channel n DC Power (W)
Total DC Drain Current (A)
Total DC Gain Current (A)
Total DC Drain Power (W)
Total DC Gate Power (W)
DE (%)
PAE (%)
Input Parameters
app - The app object containing configuration details, including active PSU channels.
totalMeasurements - Total number of rows to preallocate in the results table.
Output Parameters
ResultsTable - An empty table with predefined variable names and types for storing PA test results.
deembedPA.m¶
Path: src\support\PAFunctions\deembedPA.m
Description:
This function de-embeds Power Amplifier (PA) measurements by removing the effects of passive and active devices. It generates calibration factors for both the input and output of the PA, which are applied to the measured RF power values in order to obtain the corrected PA input and output RF power. The calibration factors are computed based on the selected calibration mode and available data on the app. An array of test frequencies can be passed and the calibration factors will be given for each value. The function supports the following calibration modes:
None: No calibration is applied, and both input and output calibration factors are set to 0.
Fixed Attenuation: The function directly applies the attenuation values set in the application for both input and output.
Small Signal: Uses fixed attenuation values combined with interpolated Sparameters from the provided Sparameter file for both input and output.
Small + Large Signal: Same behavior as Small Signal but also integrates driver gain data. The driver gain is interpolated based on both the test frequency and RF input power, which is then subtracted from the input calibration factor.
Input Parameters
app - The application object containing configuration settings and attenuation values for the PA setup.
testFrequency - The measurement frequency (Hz) at which the calibration and de-embedding should be performed.
RFInputPower - The measured RF input power (dBm) at the specified frequency.
Output Parameters
inCal - The input attenuation calibration factor (dB). Subtracts this from the input RF power to obtain the corrected PA input power.
outCal - The output attenuation calibration factor (dB). Adds this to the measured output power to get the corrected PA output power.
enablePSUChannels.m¶
Path: src\support\PAFunctions\enablePSUChannels.m
Description:
This function enables or disables the specified channels on two power supply units (PSU A and PSU B) based on the provided state (1 for enabling, 0 for disabling). Channels are grouped by PSU (PSU A or PSU B) and then enabled or disabled accordingly. The order in which the channels are processed depends on the state: gate biases are controlled before drain supplies when enabling, and drain supplies are turned off before gate biases when disabling.
Input Parameters
app - The application object containing the power supplies and the channel-to-device mapping.
channels - A cell array of channel names (e.g., {‘CH1’, ‘CH2’}).
state - Channel state (1 for enable, 0 for disable).
Output Parameters
None
measureCW.m¶
Path: src\support\PAFunctions\measureCW.m
Description:
This function measures the RF power, DC drain power, and DC gate power based on the specified input RF power and test frequency. Calls the de-embedding function to get corrected input and output RF power
Input Parameters
app - The application object containing instrument configurations.
frequency - The test frequency for measurement.
Output Parameters
DCDrainPower - The DC power delivered to the drain (W).
DCGatePower - The DC power delivered to the gate (W).
measureModulated.m¶
Path: src\support\PAFunctions\measureModulated.m
Description:
This function measures the RF power spectrum, DC drain power, and DC gate power based on the specified input RF power and test frequency. Calls the de-embedding function to get corrected input and output RF power
Input Parameters
app - The application object containing instrument configurations.
frequency - The test frequency for measurement.
Output Parameters
DCDrainCurrent - The DC current delivered to the drain from each PSU (A)
DCGateCurrent - The DC current delivered to the gate from each PSU (A)
DCDrainPower - The DC power delivered to the drain (W).
DCGatePower - The DC power delivered to the gate (W).
TODO:
The calibration for channel power measurements assumes a narrowband device where the losses of
the signal bandwidth can be approximated to the center frequency
plotCalibration.m¶
Path: src\support\PAFunctions\plotCalibration.m
Description:
plotCalibration Plots the Input and Output Calibration Detailed explanation goes here
plotPADCMeasurement.m¶
Path: src\support\PAFunctions\plotPADCMeasurement.m
Description:
This function plots DC performance metrics from a frequency sweep Power Amplifier (PA) measurement, including drain currents (IDD) and drain DC power. It filters the PA dataset using user-selected supply voltages and generates the plots with styled axes and markers for clarity:
Supply Current vs. Output Power for each frequency
DC Supply Power vs. Output Power for each frequency
Peak Drain Current vs. Frequency
Peak DC Supply Power vs. Frequency
Input Parameters
app - Application object containing PA measurement data and plotting components.
Output Parameters
None
plotPAModulatedMeasurement.m¶
Path: src\support\PAFunctions\plotPAModulatedMeasurement.m
Description:
This function plots results of modulated power amplifier (PA) measurements at a selected frequency and supply voltages. The function generates multiple plots in the app interface to visualize gain, efficiency, output spectrum, occupied bandwidth, and adjacent channel power ratio (ACPR). Specifically:
Average Gain and Efficiency Plot:
Left Y axis: Average Gain (dB)
Right Y axis: Average Drain Efficiency (DE) and Power Added Efficiency (PAE) (%)
Output Spectrum Plot:
Frequency offset (MHz) versus Power Spectral Density (dBm/Hz)
Plots averaged power spectrum for each channel output power
Occupied Bandwidth Plot:
Channel Power (dBm) versus Input/Output Occupied Bandwidth (MHz)
Channel Power and ACPR Plot:
Channel Power (dBm) versus ACPR (dBc)
Plots both input and output ACPR for all channels
Input Parameters
app - Application object containing PA measurement data, user-selected frequency, supply voltages, and plotting handles.
Output Parameters
None
NOTES:
Clears existing axes before plotting.
Filters measurement data based on selected frequency and supply voltages.
Uses local helper function
assignACPRVariablesto standardize ACPR table column names.Automatically adjusts legends and axis appearance using
improveAxesAppearance.
plotPASingleMeasurement.m¶
Path: src\support\PAFunctions\plotPASingleMeasurement.m
Description:
This function plots gain, drain efficiency (DE), and power-added efficiency (PAE) versus RF output power for a single frequency measurement. Also overlays peak values such as Psat, -1 dB and -3 dB compression points. This function generates a dual y-axis plot:
Left Y axis: Gain (dB)
Green X: Psat (saturation output power)
Red X: -1 dB gain compression point
Blue X: -3 dB gain compression point
Right Y axis: DE and PAE (%)
Input Parameters
app - Application object containing PA measurement data, user-selected frequency, supply voltages, and plotting handles.
Output Parameters
None
plotPASweepMeasurement.m¶
Path: src\support\PAFunctions\plotPASweepMeasurement.m
Description:
This function plots RF performance metrics from a frequency sweep Power Amplifier (PA) measurement, including gain, saturation power (Psat), efficiency (DE and PAE), and gain compression points (-1 dB, -3 dB). It filters the PA dataset using user-selected supply voltages and generates four annotated plots with styled axes and markers for clarity:
Peak Gain vs. Frequency
Peak Drain Efficiency (DE) and PowerAdded Efficiency (PAE) vs. Frequency
Psat, 1 dB, and 3 dB compression points vs. Frequency
Input Parameters
app - Application object containing PA measurement data and plotting components.
Output Parameters
None
populatePSUChannels.m¶
Path: src\support\PAFunctions\populatePSUChannels.m
Description:
This function evaluates the configuration of power supply channels and identifies which channels are “filled,” meaning they have complete user-defined parameters (voltage, current, etc.) and are ready for use. These filled channels are stored in the app object for future processing or interaction with the PSU units.
Input Parameters
app - The application object containing the channel configurations and channel-to-device mapping.
Output Parameters
None
resetPSUChannels.m¶
Path: src\support\PAFunctions\resetPSUChannels.m
Description:
This function resets all power supply unit (PSU) channels to their default settings, including setting voltage and current values to 0 and configuring each channel to ‘Single’ mode. It also refreshes the GUI to reflect these changes and ensures the PA side of the application returns to its initial state.
Input Parameters
app - The application object containing the channel configurations.
Output Parameters
None
runPAMeasurement.m¶
Path: src\support\PAFunctions\runPAMeasurement.m
Description:
This function performs a full RF Power Amplifier (PA) measurement sweep. On error, the instruments are safely turned off, and the error message is displayed in the app and logged to the user path. The function process includes: TODO:
Generating test parameter combinations and initializing the output results table.
Configuring the signal analyzer and initializing the measurement loop.
For each test point:
Sets frequency and signal levels
Configures PSU voltages and currents
Measures RF output power and DC power
Applies calibration factors (de-embedding)
Calculates Gain, DE (Drain Efficiency), and PAE (Power Added Efficiency)
Stores results in a structured table
Providing a progress UI dialog with estimated time updates.
Saving the results and loading them back into the application.
Verify if gate PSU data is saved to results table in individual PSU channel columns
Input Parameters
app - Application object containing hardware interfaces, user settings, and UI components.
Output Parameters
None (Results are saved to the user’s machine and updated in the application UI).
setPSUChannels.m¶
Path: src\support\PAFunctions\setPSUChannels.m
Description:
This function sets the voltage and current for a specific power supply channel based on the application’s channel-to-device mapping. It determines the correct physical channel and PSU (A or B), and applies the specified settings via SCPI commands. The function handles numeric or string inputs for voltage and current values, ensuring compatibility with SCPI command formatting.
Input Parameters
app - App object containing power supply configurations and the channel-to-device mapping.
deviceChannel - Logical channel name (e.g., ‘CH1’) as defined in the mapping structure.
voltage - Desired voltage for the channel (numeric or string).
current - Desired current limit for the channel (numeric or string).
Output Parameters
None
validatePSUChannels.m¶
Path: src\support\PAFunctions\validatePSUChannels.m
Description:
This function validates PSU channel configuration based on the selected mode. It checks:
That devices are connected.
That the mode matches available devices.
That enough channels are configured.
That channel count does not exceed mode limits.
Input Parameters
app - App object with mode, device, and channel info
Output Parameters
isValid - True if configuration is valid; otherwise false