Main Content

EVM Measurement of 5G NR PDSCH Waveforms

This example measures the error vector magnitude (EVM) of NR test model (NR-TM) or fixed reference channel (FRC) waveforms. The example adds impairments including phase noise and memoryless nonlinearity.


For base station RF testing, the 3GPP 5G NR standard defines a set of downlink test model (NR-TM) waveforms. For user equipment (UE) testing, the standard defines a set of fixed reference channel (FRC) waveforms. The NR-TMs and FRCs for frequency range 1 (FR1) are defined in TS 38.141-1 while the NR-TMs and FRCs for frequency range 2 (FR2) are defined in TS 38.141-2.

This example shows how to generate an NR waveform (TM or FRC) and add impairments. Here we consider phase noise and memoryless nonlinearities. We then calculate the EVM of the resulting signal. We plot the RMS and peak EVMs per OFDM symbol, slot, and subcarrier. We also calculate the overall EVM (RMS EVM averaged over the complete waveform). Annex B and Annex C of TS 38.104 define an alternative method for computing the EVM in FR1 and FR2, respectively. The figure below shows the processing chain implemented in this example

Simulation parameters

Each NR-TM or FRC waveform is defined by a combination of:

  • NR-TM/FRC name

  • Channel bandwidth

  • Subcarrier spacing

  • Duplexing mode

% Select one of the Release 15 NR-TMs for FR1 and FR2 among:
% "NR-FR1-TM1.1","NR-FR1-TM1.2","NR-FR1-TM2",
% "NR-FR1-TM2a","NR-FR1-TM3.1","NR-FR1-TM3.1a",
% "NR-FR1-TM3.2","NR-FR1-TM3.3","NR-FR2-TM1.1",
% "NR-FR2-TM2","NR-FR2-TM3.1"

% or
% Select one of the Release 15 FRCs for FR1 and FR2 among:

rc = "NR-FR1-TM3.2"; % Reference channel(NR-TM or FRC)

% Select the NR waveform parameters
bw = "10MHz"; % Channel bandwidth
scs = "30kHz"; % Subcarrier spacing
dm = "FDD"; % Duplexing mode

For TMs, the generated waveform may contain more than one PDSCH. The chosen PDSCH to analyse is based on the RNTI. By default, the following RNTIs are considered for EVM calculation:

  • NR-FR1-TM2: RNTI = 2 (64QAM EVM)

  • NR-FR1-TM2a: RNTI = 2 (256QAM EVM)

  • NR-FR1-TM3.1: RNTI = 0 and 2 (64QAM EVM)

  • NR-FR1-TM3.1a: RNTI = 0 and 2 (256QAM EVM)

  • NR-FR1-TM3.2: RNTI = 1 (16QAM EVM)

  • NR-FR1-TM3.3: RNTI = 1 (QPSK EVM)

  • NR-FR2-TM2: RNTI = 2 (64QAM EVM)

  • NR-FR2-TM3.1: RNTI = 0 and 2 (64QAM EVM)

As per the specifications (TS 38.141-1, TS 38.141-2), these TMs are not designed to perform EVM measurements: NR-FR1-TM1.1, NR-FR1-TM1.2, NR-FR2-TM1.1. However, if you generate these TMs, the example measures the EVM for the following RNTIs.

  • NR-FR1-TM1.1: RNTI = 0 (QPSK EVM)

  • NR-FR1-TM1.2: RNTI = 2 (QPSK EVM)

  • NR-FR2-TM1.1: RNTI = 0 (QPSK EVM)

For FRCs, by default, RNTI 0 is considered for EVM calculation.

The example calculates the EVM for the RNTIs listed above. To override the default RNTIs, specify the targetRNTIs vector

targetRNTIs = [];

To print EVM statistics on the command window, set displayEVM to true. To disable the prints, set displayEVM to false.

displayEVM = true;

To plot EVM statistics, set plotEVM to true. To disable the plot, set plotEVM to false.

plotEVM = true;
if displayEVM
    fprintf('Reference Channel = %s\n', rc);
Reference Channel = NR-FR1-TM3.2

To measure EVM as defined in TS 38.104, Annex B(FR1) / Annex C(FR2), set evm3GPP to true.

evm3GPP = false;

Create waveform generator object and generate the waveform

tmwavegen = hNRReferenceWaveformGenerator(rc,bw,scs,dm);
[txWaveform,tmwaveinfo,resourcesinfo] = generateWaveform(tmwavegen,tmwavegen.Config.NumSubframes);

Impairment: Phase Noise and Nonlinearity

This example considers two impairments: phase noise and memoryless nonlinearity. Enable or disable impairments by toggling the flags phaseNoiseOn and nonLinearityModelOn.

phaseNoiseOn = true;
nonLinearityModelOn = true;

Normalize the waveform to fit the dynamic range of the nonlinearity.

txWaveform = txWaveform/max(abs(txWaveform));

The waveform consists of one frame for FDD and two for TDD. Repeat the signal twice. We will remove the first half of the resulting waveform to avoid the transient introduced by the phase noise model.

txWaveform = repmat(txWaveform,2,1);

Introduce phase noise distortion. The generated figure shows the phase noise characteristic. The carrier frequency considered depends on the frequency range. We use values of 4 GHz and 28 GHz for FR1 and FR2 respectively. The phase noise characteristic is generated with the pole/zero model described in R1-163984, "Discussion on phase noise modeling".

if phaseNoiseOn
    sr = tmwaveinfo.Info.SamplingRate;

    % Carrier frequency
    if tmwavegen.Config.FrequencyRange == "FR1" % carrier frequency for FR1
        fc = 4e9;
    else % carrier frequency for FR2
        fc = 28e9;

    % Calculate the phase noise level.
    foffsetLog = (3:0.1:log10(sr/2)); % model offset from 1e3Hz to sr/2
    foffset = 10.^foffsetLog;    % linear freq offset
    PN_dBc_Hz = hPhaseNoisePoleZeroModel(foffset,fc,'A');
    figure; semilogx(foffset,PN_dBc_Hz); xlabel('Frequency offset (Hz)'); ylabel('dBc/Hz'); title('Phase noise model'); grid on

    % Apply phase noise to waveform
    pnoise = comm.PhaseNoise('FrequencyOffset',foffset,'Level',PN_dBc_Hz,'SampleRate',sr);
    rxWaveform = pnoise(txWaveform);
    rxWaveform = txWaveform; %#ok<*UNRCH>

Introduce nonlinear distortion. We use the Rapp model in this example. The figure shows the nonlinearity introduced. Set the parameters for the Rapp model to match the characteristics of the memoryless model from TR 38.803 (Memoryless polynomial model - Annex A.1).

if nonLinearityModelOn
    rapp = comm.MemorylessNonlinearity('Method','Rapp model');
    rapp.Smoothness = 1.55;
    rapp.OutputSaturationLevel = 1;

    % Plot non-linear characteristic

    % Apply nonlinearity
    rxWaveform = rapp(rxWaveform);

The signal was previously repeated twice. We now remove the first half of this signal. This avoids any transient introduced by the impairment models.

if dm == "FDD"
    nFrames = 1;
else % TDD
    nFrames = 2;
rxWaveform(1:nFrames*tmwaveinfo.Info.SamplesPerSubframe*10) = [];

Perform Measurements

The 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 (i.e. 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 vs per OFDM symbol, slot, subcarrier, and overall EVM. Each plot displays the peak vs RMS EVM.

% Compute and display EVM measurements
cfg = struct();
cfg.Evm3GPP = evm3GPP;
cfg.TargetRNTIs = targetRNTIs;
cfg.PlotEVM = plotEVM;
cfg.DisplayEVM = displayEVM;
cfg.Label = tmwavegen.ConfiguredModel{1};
[evmGrid,eqSym,refSym,plots] = hNRPDSCHEVM(tmwavegen.Config,rxWaveform,cfg,resourcesinfo.WaveformResources);
 RMS EVM, Peak EVM, slot 0: 4.007 20.148%
 RMS EVM, Peak EVM, slot 1: 3.854 12.988%
 RMS EVM, Peak EVM, slot 2: 3.782 14.258%
 RMS EVM, Peak EVM, slot 3: 3.748 14.297%
 RMS EVM, Peak EVM, slot 4: 4.158 18.071%
 RMS EVM, Peak EVM, slot 5: 4.176 17.451%
 RMS EVM, Peak EVM, slot 6: 3.999 15.321%
 RMS EVM, Peak EVM, slot 7: 4.141 16.396%
 RMS EVM, Peak EVM, slot 8: 3.859 14.277%
 RMS EVM, Peak EVM, slot 9: 3.896 12.688%
 RMS EVM, Peak EVM, slot 10: 4.039 15.034%
 RMS EVM, Peak EVM, slot 11: 3.701 15.019%
 RMS EVM, Peak EVM, slot 12: 3.897 12.996%
 RMS EVM, Peak EVM, slot 13: 3.959 17.131%
 RMS EVM, Peak EVM, slot 14: 3.866 12.698%
 RMS EVM, Peak EVM, slot 15: 3.917 17.618%
 RMS EVM, Peak EVM, slot 16: 3.808 15.598%
 RMS EVM, Peak EVM, slot 17: 4.022 15.583%
 RMS EVM, Peak EVM, slot 18: 3.905 21.075%
 RMS EVM, Peak EVM, slot 19: 3.976 12.555%
Averaged overall RMS EVM: 3.938%
Peak EVM = 21.0751%

Local functions

function plotNonLinearCharacteristic(memoryLessNonlinearity)
% Plot the non linear characteristic of the power amplifier (PA) impairment
% represented by memoryLessNonlinearity system object. This input parameter
% is a comm.MemorylessNonlinearity system object.

% Input samples
x = complex((1/sqrt(2))*(-1+2*rand(1000,1)),(1/sqrt(2))*(-1+2*rand(1000,1)));

% Non linearity
yRapp = memoryLessNonlinearity(x);
% Release object so we can feed it different number of samples

% Plot characteristic
figure; plot(10*log10(abs(x).^2),10*log10(abs(x).^2)); hold on; grid on
xlabel('Input power (dBW)'); ylabel('Output power (dBW)'); title('Nonlinearity impairment')
legend('Linear characteristic', 'Rapp nonlinearity','Location','Northwest');


Related Topics