Main Content

PA and DPD Modeling for Dynamic EVM Measurement

This example shows how to use input and output modulated waveforms to extract a generalized memory polynomial model of a power amplifier (PA). You use a PA model to measure the PA dynamic error vector magnitude (EVM) using a standard-compliant 5G NR test model waveform, as defined in TS 38.141-1. You also measure the EVM in different operating conditions using digital predistortion (DPD).

The waveforms have been measured using Rohde & Schwarz instruments R&S®SMW200A and R&S®FSW. For more information, see Linearization of RF Amplifiers: Connecting simulation and measurements on physical devices.

This example guides you step-by-step through all the operations required to extract a PA model using measured data, verify the quality of the fitting, and simulate such model using Circuit Envelope blocks with and without DPD. Overview of this example as follows:

  • Import the PA characterization data. This example uses two different input/output complex modulated waveforms measured in different conditions to extract and verify the quality of the PA model.

  • Visualize the characterization data in different domains to make it suitable for fitting a memory polynomial PA model. The data might need manipulation, such as adjusting the input/output timing alignment. In this case, filter the data to reduce the characterization bandwidth.

  • Identify the PA model coefficients matrix using the characterization waveform with the largest dynamic range and then verify the quality of the fitting using the second waveform. At this stage, you can experiment by changing the harmonic order and memory depth of the model.

  • Define a simple RF Blockset circuit envelope testbench to verify that the extracted PA model is correctly configured for time domain simulation. This step is necessary to make sure that the simulation set up uses the desired port definition and time step.

  • Define a 5G Toolbox testbench to generate a 5G standard compliant waveform and measure the EVM and then integrate the RF Blockset circuit envelope model of the PA in this testbench using the rfsystem workflow.

  • Run the 5G EVM testbench with and without DPD algorithm in the loop and visualize results.

Read PA Input/Output Characterization Data

This data file collects the PA input and output waveforms measured using Rohde&Schwarz vector signal generator R&S®SMW200A in conjunction with the vector signal analyzer R&S®FSW. The file includes four different complex waveforms, measured at 2.6 GHz, with a sample time of 1.6276 ns.

The four waveforms provide two different sets of input/output characterization data. The first set (reference) is measured using a standard compliant 5G waveform. The second set is measured using a predistorted waveform generated by the R&S set up. This excitation waveform is created using the iterative direct DPD approach, and it provides a measure of the PA linearized performance that can be achieved in the field. In this example, we use one of these two sets of waveforms to extract the PA model, and the second to verify the quality of the fitting.

  • iq_in — original PA input data (reference)

  • iq_out — original PA output data (no DPD active)

  • iq_in_dpd — predistorted PA input signal (iterative direct DPD)

  • iq_out_dpd — PA output signal using pre-distorted input signal

load('K18m_PA_Data.mat');

Plot Spectrum of PA Characterization Data

Plot the spectrum of the data used to characterize the PA. You can see the effects of the filtering introduced by the measurement setup at the edges of the signal.

SpectAnalyzer = spectrumAnalyzer;
SpectAnalyzer.SampleRate = fs;
SpectAnalyzer.ShowLegend = true;
SpectAnalyzer.SpectralAverages = 32;
SpectAnalyzer.ReferenceLoad = 50;
SpectAnalyzer.RBWSource= "Property";
SpectAnalyzer.RBW = 1e5;
SpectAnalyzer.OverlapPercent = 50;
SpectAnalyzer([iq_in, iq_out, iq_out_dpd]);
SpectAnalyzer.ChannelNames = {'PA_in','PA_out','PA_out_w/DPD'};

Apply Resampling Filter to Remove Filter Effects

Apply a digital multirate FIR filter to resample the data and remove the effects of filtering introduced by the measurement setup. This step is recommended to improve the quality of the fitting of the PA model.

Set the filter parameters starting with the number of filter taps, interpolation and decimation factors, and overall length of the filter delay in number of samples.

filtLength = 48*2;
I = 6;
D = 8;
N = ceil(filtLength*((I/D)+1));

Compute the oversampling factor and sample time of the resampled waveforms.

ovs = I/D;
Tstep = 1/fs/ovs;

Create a filter object with the given parameters.

FIR_bw = designMultirateFIR(I,D,filtLength,'SystemObject',true);

Apply the filter to all four characterization waveforms.

inDataPA1   = FIR_bw(iq_in);
inDataPA2   = FIR_bw(iq_in_dpd);
outDataPA1  = FIR_bw(iq_out);
outDataPA2  = FIR_bw(iq_out_dpd);

Remove the filter transient at the beginning of the waveforms and store the data in two matrices:one for the input waveforms, and one for the output waveforms. The first column in both matrices represents the original data, and the second column represents the data measured using the iterative direct DPD approach.

in(:,1)     = inDataPA1(N:end);
in(:,2)     = inDataPA2(N:end);
out(:,1)    = outDataPA1(N:end);
out(:,2)    = outDataPA2(N:end);
numDataPts  = length(in(:,1));

Plot PA Waveforms in Time and Frequency Domain

Visualize the input and output characterization data with and without iterative direct DPD.

In the figures below, you plot the first 500 ns of data. The data is well aligned in time, and the effects of nonlinearity are barely visible on the peaks of the output signals. For direct comparison you multiply the data times the PA gain.

g = 10^(g0/20);
for i = 1:2
    figure;
    plot((1:numDataPts)*Tstep, abs(in(:,i))*g,                               ...
        (1:numDataPts)*Tstep, abs(out(:,i)))
    legend('Abs(In)','Abs(Out)','Location','northeast')
    xlabel('Time (s)')
    xlim([0 0.5e-6]); ylim([0 2.1]);
    ylabel('Voltage (V)')
    if i==1
        title('Absolute Values of Original Input/Output Voltage Signals');
    else
        title('Absolute Values of Input/Output Voltage Signals with Direct DPD');
    end
end

Also, plot the power gain transfer function. This plot is helpful to visualize memory effects as well as the PA nonlinearity. The power transfer function of a perfectly linear device without any memory effect is a straight line, so any deviation from it is due to nonidealities. From the comparison of the two plots, you can verify that the characterization data measured with the iterative direct DPD approach has a larger dynamic range.

for i = 1:2
    figure;
    TransferPA = abs(out(:,i)./in(:,i));
    plot(abs(in(:,i)),20*log10(TransferPA),'.');
    xlabel('Input Voltage Absolute Value(V)')
    ylabel('Magnitude Power Gain (dB)')
    if i==1
        title('Power Gain Transfer Function')
    else
        title('Power Gain Transfer Function with Direct DPD')
    end
end

Plot the power spectrum of the output signal and verify that the resampling filter delivers the desired results. The characterization data can be used to identify a memory polynomial model. With the given measurement bandwidth, you can capture the spectral regrowth up to the fifth order of nonlinearity.

SpectAnalyzer = spectrumAnalyzer;
SpectAnalyzer.SampleRate = fs*ovs;
SpectAnalyzer.ShowLegend = true;
SpectAnalyzer.SpectralAverages = 32;
SpectAnalyzer.ReferenceLoad = 50;
SpectAnalyzer.RBWSource= "Property";
SpectAnalyzer.RBW = 1e5;
SpectAnalyzer.OverlapPercent = 50;
SpectAnalyzer(out(:,1:2));
SpectAnalyzer.ChannelNames = {'PA_out','PA_out_w/DPD'};

Determine PA Model Coefficient Matrix from Measured Input/Output Signals

Identify a generalized memory polynomial model, using a memory length of five and a degree of nonlinearity of three

memLen = 5;
degLen = 3;
modType = 'memPoly';

To compute the model coefficient matrix, use a predistorted waveform as it has a larger dynamic range. The coefficient matrix is used to verify the quality of the fitted model.

fitCoefMat = helperPACharMemPolyModel('coefficientFinder', in(:,2), out(:,2), ...
    memLen,degLen,modType);
% Alternatively, you can use a subset of the data range to fit the model
% fitCoefMat = helperPACharMemPolyModel('coefficientFinder', in(14e4:15e4,2), out(14e4:15e4,2), ...
%     memLen,degLen,modType);

Verify the quality of the PA model by computing the RMS error of the fitting, as well as plotting the fitted and measured waveforms in the time domain, the power transfer function, the spectrum, and the ACLR spectral measurement.

First, verify the quality of the fitted model by comparing the measurement and the prediction using the original data.

helperPAVerifyMemPolyModel(in(:,1), out(:,1), fitCoefMat, modType, fs*ovs);
Signal standard deviation = 7.8385%
ACPR data = -36.9763 -37.6772
ACPR fit  = -37.4842 -38.3254

Then, verify the quality of the model using the measured data with the iterative direct DPD approach. This data has also been used to identify the PA model.

helperPAVerifyMemPolyModel(in(:,2), out(:,2), fitCoefMat, modType, fs*ovs);
Signal standard deviation = 3.3434%
ACPR data = -38.0929 -38.5962
ACPR fit  = -38.5555 -38.8375

Finally, save the PA model and relevant parameters for later use.

close all;
save('PA_model', 'Tstep','degLen','memLen','modType','fitCoefMat', 'g0');

Use PA Model for Simulink Circuit Envelope Simulation

This simple Simulink testbench shows how to use the PA model for circuit envelope simulation and compare the predicted results with the characterization data. The top branch uses the PA original characterization data, while the bottom branch uses the PA data including the iterative direct DPD linearization. The spectrum analyzer directly compares the measured and predicted waveforms, and additionally shows the spectrum of the difference between the two.

model = 'verificationPA';
open_system(model)
sim(model,numDataPts*Tstep/3);

This second Simulink testbench shows how to linearize the PA model, including an adaptive digital predistortion algorithm. The output signal is compared with the measured waveforms including iterative direct DPD and the original data.

model = 'DPD';
open_system(model)
sim(model,numDataPts*Tstep/3);

Setup 5G NR PDSCH Waveforms for EVM Measurement

Measure the PA 3GPP dynamic EVM with and without DPD. The EVM is measured as defined in TS 38.104, Annex B(FR1) / Annex C(FR2).

The GenerateNRTMWaveform script generates a standard-compliant 5G NR test model 3.1 (NR-TM3.1) waveform for frequency range 1 (FR1), as defined in TS 38.141-1. To generate a different NR test model, open the 5G Waveform Generator (5G Toolbox) app, choose your preferred configuration and click on Export MATLAB script.

GenerateNRTMWaveform

% Set the simulation parameters.
targetRNTIs = [];
displayEVM = true;
plotEVM = true;
evm3GPP = true;

Increase the amplitude of the input signal to excite the PA nonlinearity. At this stage, make sure that the input signal is within the characterization range of the PA model.

txWaveform_5G = waveform*9;
disp(['Maximum input voltage = ' num2str(max(abs(txWaveform_5G)))])
Maximum input voltage = 0.51318

As the 5G signal has a sample rate that is different from the one used for the PA characterization, you need to interpolate the signal like before. Here you create an interpolation filter to increase the simulation bandwidth.

[I,D] = rat((1/info.ResourceGrids.Info.SampleRate)/Tstep);
filtLength = 120;
FIR_tx = designMultirateFIR(I,D,filtLength,180,'SystemObject',true);
N1 = ceil(filtLength*(I/D))+1;

Apply the filter to the 5G baseband waveform.

txWaveform_RF = FIR_tx(txWaveform_5G);

Load the RF system object and inspect the associated Simulink model with PA and DPD. For more information see, rfsystem.

load RF_system;
open_system(rf_dpd)

Simulate PA Model with 5G Waveforms

First simulate the PA model without DPD. Make sure that the manual switch is set in the up position. This simulation takes a few minutes as it is actually testing one entire frame (10 ms) of 5G data.

set_param('rf_dpd_model/switch','sw','1')
rxWaveform_RF = rf_dpd(txWaveform_RF);

As a second step, simulate the PA including DPD by toggling the manual switch towards the down position.

set_param('rf_dpd_model/switch','sw','0')
rxWaveform_DPD = rf_dpd(txWaveform_RF);

Compare the results by visualizing the output waveforms with and without DPD.

First, visualize results in the time domain.

figure; hold on
plot((1:length(rxWaveform_RF))*Tstep, abs(rxWaveform_RF));
plot((1:length(rxWaveform_RF))*Tstep, abs(rxWaveform_DPD));
legend('Output without DPD','Ouput with DPD','Location','northeast')
xlabel('Time (s)')
xlim([1e-6 2e-6])
ylabel('Voltage (V)')
title('Absolute Values of Input and Output Voltage Signals');

Second, visualize the power gain transfer function.

figure; hold on;
TransferPA = abs(rxWaveform_RF./txWaveform_RF);
plot(abs(txWaveform_RF), 20*log10(TransferPA), 'o')
TransferPA_dpd = abs(rxWaveform_DPD./txWaveform_RF);
plot(abs(txWaveform_RF), 20*log10(TransferPA_dpd), '.')
ylim([0 40])
xlabel('Input Voltage Absolute Value(V)')
ylabel('Magnitude Power Gain (dB)')
title('Power Gain Transfer Function')
legend({'Output without DPD', 'Ouput with DPD'})

Finally, plot the spectrum of the output signals.

SpectAnalyzer = spectrumAnalyzer;
SpectAnalyzer.SampleRate = 1/Tstep;
SpectAnalyzer.ShowLegend = true;
SpectAnalyzer.ChannelNames = {'Output without DPD', 'Ouput with DPD'};
SpectAnalyzer.RBWSource ="Property";
SpectAnalyzer.RBW = 1e5;
SpectAnalyzer.SpectralAverages = 32;
SpectAnalyzer.ReferenceLoad = 50;
SpectAnalyzer([rxWaveform_RF rxWaveform_DPD]);

Before computing the EVM, you need to decimate the output waveforms. Create a decimation filter to resample the signals with the original sample time.

FIR_rx = designMultirateFIR(D,I,filtLength,180,'SystemObject',true);
N2 = ceil(filtLength*(D/I))+1;

Apply the decimation filter to the output waveforms and remove the transient introduced by the filter.

M = floor(length(rxWaveform_RF)/I);
rxWaveform_5G = FIR_rx(rxWaveform_RF(1:M*I));
rxWaveform_5G = rxWaveform_5G(N2:end);
rxWaveform_5G_DPD = FIR_rx(rxWaveform_DPD(1:M*I));
rxWaveform_5G_DPD = rxWaveform_5G_DPD(N2:end);

Perform 3GPP Dynamic EVM Measurements

The helper function hNRPDSCHEVM, performs these steps to decode and analyze the waveform:

  • Synchronization using the DM-RS over one frame for FDD (two frames for TDD)

  • OFDM demodulation of the received waveform

  • Channel estimation

  • Equalization

  • PDSCH EVM computation (enable the switch evm3GPP, to process according to the EVM measurement requirements specified in TS 38.104, Annex B(FR1) / Annex C(FR2))

The example measures and outputs various EVM related statistics (that is per symbol, per slot, and per frame peak EVM and RMS EVM). The example displays EVM for each slot and frame on the command window. It also displays the overall EVM averaged over the entire input waveform. The example produces a number of plots: EVM versus per OFDM symbol, slot, subcarrier, and overall EVM. Each plot displays the peak versus the RMS EVM.

Compute and display EVM measurements for the waveform without DPD.

cfg = struct();
cfg.Evm3GPP = evm3GPP;
cfg.TargetRNTIs = targetRNTIs;
cfg.PlotEVM = plotEVM;
cfg.DisplayEVM = displayEVM;
cfg.Label = cfgDLTM.Label;
[evmGrid,eqSym,refSym] = hNRPDSCHEVM(cfgDLTM,rxWaveform_5G,cfg);
EVM stats for BWP idx : 1
Low edge RMS EVM, Peak EVM, slot 0: 1.207 3.898%
High edge RMS EVM, Peak EVM, slot 0: 1.207 3.898%
Low edge RMS EVM, Peak EVM, slot 1: 1.306 4.950%
High edge RMS EVM, Peak EVM, slot 1: 1.306 4.960%
Low edge RMS EVM, Peak EVM, slot 2: 1.333 4.309%
High edge RMS EVM, Peak EVM, slot 2: 1.333 4.302%
Low edge RMS EVM, Peak EVM, slot 3: 1.261 4.269%
High edge RMS EVM, Peak EVM, slot 3: 1.261 4.291%
Low edge RMS EVM, Peak EVM, slot 4: 1.228 3.836%
High edge RMS EVM, Peak EVM, slot 4: 1.228 3.824%
Low edge RMS EVM, Peak EVM, slot 5: 1.256 4.080%
High edge RMS EVM, Peak EVM, slot 5: 1.256 4.019%
Low edge RMS EVM, Peak EVM, slot 6: 1.280 4.414%
High edge RMS EVM, Peak EVM, slot 6: 1.279 4.413%
Low edge RMS EVM, Peak EVM, slot 7: 1.211 4.268%
High edge RMS EVM, Peak EVM, slot 7: 1.210 4.287%
Low edge RMS EVM, Peak EVM, slot 8: 1.219 3.971%
High edge RMS EVM, Peak EVM, slot 8: 1.219 3.960%
Low edge RMS EVM, Peak EVM, slot 9: 1.247 4.275%
High edge RMS EVM, Peak EVM, slot 9: 1.247 4.282%
Low edge RMS EVM, Peak EVM, slot 10: 1.246 4.072%
High edge RMS EVM, Peak EVM, slot 10: 1.246 4.027%
Low edge RMS EVM, Peak EVM, slot 11: 1.280 4.044%
High edge RMS EVM, Peak EVM, slot 11: 1.280 4.036%
Low edge RMS EVM, Peak EVM, slot 12: 1.245 4.222%
High edge RMS EVM, Peak EVM, slot 12: 1.245 4.229%
Low edge RMS EVM, Peak EVM, slot 13: 1.359 5.075%
High edge RMS EVM, Peak EVM, slot 13: 1.359 5.068%
Low edge RMS EVM, Peak EVM, slot 14: 1.272 4.397%
High edge RMS EVM, Peak EVM, slot 14: 1.272 4.384%
Low edge RMS EVM, Peak EVM, slot 15: 1.238 4.216%
High edge RMS EVM, Peak EVM, slot 15: 1.237 4.219%
Low edge RMS EVM, Peak EVM, slot 16: 1.244 4.400%
High edge RMS EVM, Peak EVM, slot 16: 1.244 4.382%
Low edge RMS EVM, Peak EVM, slot 17: 1.274 4.360%
High edge RMS EVM, Peak EVM, slot 17: 1.274 4.364%
Low edge RMS EVM, Peak EVM, slot 18: 1.253 4.406%
High edge RMS EVM, Peak EVM, slot 18: 1.253 4.411%
Averaged overall RMS EVM: 1.262%
Overall Peak EVM = 5.0746%

Compute and display EVM measurements for the waveform with DPD.

cfg = struct();
cfg.Evm3GPP = evm3GPP;
cfg.TargetRNTIs = targetRNTIs;
cfg.PlotEVM = plotEVM;
cfg.DisplayEVM = displayEVM;
cfg.Label = cfgDLTM.Label;
[evmGrid_DPD,eqSym_DPD,refSym_DPD] = hNRPDSCHEVM(cfgDLTM,rxWaveform_5G_DPD,cfg);
EVM stats for BWP idx : 1
Low edge RMS EVM, Peak EVM, slot 0: 0.349 1.383%
High edge RMS EVM, Peak EVM, slot 0: 0.349 1.365%
Low edge RMS EVM, Peak EVM, slot 1: 0.690 2.984%
High edge RMS EVM, Peak EVM, slot 1: 0.690 3.037%
Low edge RMS EVM, Peak EVM, slot 2: 0.551 2.102%
High edge RMS EVM, Peak EVM, slot 2: 0.551 2.091%
Low edge RMS EVM, Peak EVM, slot 3: 0.925 4.299%
High edge RMS EVM, Peak EVM, slot 3: 0.924 4.300%
Low edge RMS EVM, Peak EVM, slot 4: 0.339 1.510%
High edge RMS EVM, Peak EVM, slot 4: 0.337 1.536%
Low edge RMS EVM, Peak EVM, slot 5: 0.460 2.244%
High edge RMS EVM, Peak EVM, slot 5: 0.460 2.244%
Low edge RMS EVM, Peak EVM, slot 6: 0.583 2.659%
High edge RMS EVM, Peak EVM, slot 6: 0.583 2.646%
Low edge RMS EVM, Peak EVM, slot 7: 0.333 1.226%
High edge RMS EVM, Peak EVM, slot 7: 0.333 1.252%
Low edge RMS EVM, Peak EVM, slot 8: 0.312 1.261%
High edge RMS EVM, Peak EVM, slot 8: 0.310 1.182%
Low edge RMS EVM, Peak EVM, slot 9: 0.371 1.286%
High edge RMS EVM, Peak EVM, slot 9: 0.371 1.303%
Low edge RMS EVM, Peak EVM, slot 10: 0.405 1.752%
High edge RMS EVM, Peak EVM, slot 10: 0.405 1.768%
Low edge RMS EVM, Peak EVM, slot 11: 0.665 2.747%
High edge RMS EVM, Peak EVM, slot 11: 0.664 2.749%
Low edge RMS EVM, Peak EVM, slot 12: 0.456 2.024%
High edge RMS EVM, Peak EVM, slot 12: 0.455 2.000%
Low edge RMS EVM, Peak EVM, slot 13: 0.733 4.093%
High edge RMS EVM, Peak EVM, slot 13: 0.734 4.034%
Low edge RMS EVM, Peak EVM, slot 14: 0.380 1.718%
High edge RMS EVM, Peak EVM, slot 14: 0.379 1.718%
Low edge RMS EVM, Peak EVM, slot 15: 0.354 1.405%
High edge RMS EVM, Peak EVM, slot 15: 0.354 1.447%
Low edge RMS EVM, Peak EVM, slot 16: 0.329 1.247%
High edge RMS EVM, Peak EVM, slot 16: 0.328 1.249%
Low edge RMS EVM, Peak EVM, slot 17: 0.591 2.447%
High edge RMS EVM, Peak EVM, slot 17: 0.591 2.505%
Low edge RMS EVM, Peak EVM, slot 18: 0.364 1.412%
High edge RMS EVM, Peak EVM, slot 18: 0.363 1.369%
Averaged overall RMS EVM: 0.512%
Overall Peak EVM = 4.2987%

Helper Functions

Explore the following helper functions used by this example:

References

[1] Morgan, Dennis R., Zhengxiang Ma, Jaehyeong Kim, Michael G. Zierdt, and John Pastalan. "A Generalized Memory Polynomial Model for Digital Predistortion of Power Amplifiers." IEEE Transactions on Signal Processing 54, no. 10 (October 2006): 3852–60. https://doi.org/10.1109/TSP.2006.879264.

[2] Gan, Li, and Emad Abd-Elrady. "Digital Predistortion of Memory Polynomial Systems Using Direct and Indirect Learning Architectures." In Proceedings of the Eleventh IASTED International Conference on Signal and Image Processing (SIP) ed. F. Cruz-Roldán and N. B. Smith, No. 654-802. Calgary, AB: ACTA Press, 2009.

[3] Lörner Markus, Florian Ramian, and Giorgia Zucchelli. "Linearization of RF amplifiers." Application note. Version 1e.09.2021. https://www.rohde-schwarz.com/us/applications/linearization-of-rf-amplifiers-application-note_56280-1110210.html.

[4] 3GPP TS 38.141-1. "NR; Base Station (BS) conformance testing Part 1: Conducted conformance testing." 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

See Also

Related Topics