Main Content

EVM Measurement of 5G NR Downlink Waveforms with RF Impairments

This example shows how to measure the error vector magnitude (EVM) of NR test model (NR-TM) or fixed reference channel (FRC) waveforms. The example also shows how to add RF impairments, including phase noise, in-phase and quadrature (I/Q) imbalance, filter effects, and memoryless nonlinearity.

Introduction

For base station RF testing, the 3GPP 5G NR standard defines a set of NR-TM waveforms. For user equipment (UE) testing, the standard defines a set of 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), add RF impairments, such as, phase noise, I/Q imbalance, filter effects, and memoryless nonlinearities, and calculate the EVM of the resulting signal. The example plots the RMS and peak EVMs per orthogonal frequency division multiplexing (OFDM) symbol, slot, and subcarrier and also calculates 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. This figure 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-TM2a","NR-FR2-TM3.1","NR-FR2-TM3.1a"

% or
% Select one of the Release 15 FRCs for FR1 and FR2 among:
% "DL-FRC-FR1-QPSK","DL-FRC-FR1-64QAM",
% "DL-FRC-FR1-256QAM","DL-FRC-FR2-QPSK",
% "DL-FRC-FR2-16QAM","DL-FRC-FR2-64QAM"

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 physical data shared channel (PDSCH). The chosen PDSCH to analyse is based on the radio network temporary identifier (RNTI). By default, these 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-TM2a: RNTI = 2 (256QAM EVM)

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

  • NR-FR2-TM3.1a: RNTI = 0 and 2 (256QAM 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 PDSCH FRCs and physical downlink control channel (PDCCH), by default, RNTI 0 is considered for EVM calculation.

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

targetRNTIs = [];

To print EVM statistics, set displayEVM to true. To disable the prints, set displayEVM to false. To plot EVM statistics, set plotEVM to true. To disable the plots, set plotEVM to false

displayEVM = true;
plotEVM = true;
if displayEVM
    fprintf('Reference Channel = %s\n', rc);
end
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 is disabled by default. evm3GPP is disabled for PDCCH EVM measurement.

evm3GPP = false;

This example considers the most typical impairments that distort the waveform when passing through an RF transmitter or receiver: phase noise, I/Q imbalance, filter effects and memoryless nonlinearity. Enable or disable impairments by toggling the flags phaseNoiseOn, IQImbalanceON, filterOn, and nonLinearityModelOn.

phaseNoiseOn = true;
IQImbalanceON = true;
filterOn = true;
nonLinearityModelOn = true;

To model wideband filter effects, specify a higher waveform sample rate. You can increase the sample rate by multiplying the waveform bandwidth with the oversampling factor, OSR. To use the nominal sample rate, set OSR to 1.

OSR = 5; % oversampling factor

% Create waveform generator object
tmwavegen = hNRReferenceWaveformGenerator(rc,bw,scs,dm);

% Waveform bandwidth
bandwidth = tmwavegen.Config.ChannelBandwidth*1e6;

if OSR > 1
    % The |Config| property in |tmwavegen| specifies the configuration of
    % the standard-defined reference waveform. It is a read-only property.
    % To customize the waveform, make the |Config| property writable.
    tmwavegen = makeConfigWritable(tmwavegen);

    % Increase the sample rate by multiplying the waveform bandwidth by
    % |OSR|
    tmwavegen.Config.SampleRate = bandwidth*OSR;
end

% Generate the waveform and get the waveform sample rate
[txWaveform,tmwaveinfo,resourcesinfo] = generateWaveform(tmwavegen,tmwavegen.Config.NumSubframes);
sr = tmwaveinfo.Info.SamplingRate; % waveform sample rate

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

txWaveform = txWaveform/max(abs(txWaveform),[],'all');

The waveform consists of one frame for frequency division duplex (FDD) and two for time division duplex (TDD). Repeat the signal twice. Remove the first half of the resulting waveform to avoid the transient introduced by the phase noise model.

txWaveform = repmat(txWaveform,2,1);

RF Impairments

This section shows how to model these RF impairments: phase noise, I/Q imbalance, filter effects, and nonlinearity.

Introduce phase noise distortion. The figure shows the phase noise characteristic. The carrier frequency that is considered in the example depends on the frequency range. This example uses the center frequency 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
    % Carrier frequency
    if tmwavegen.Config.FrequencyRange == "FR1" % carrier frequency for FR1
        fc = 4e9;
    else % carrier frequency for FR2
        fc = 30e9;
    end

    % Calculate the phase noise level
    foffsetLog = (4:0.1:log10(sr/2)-0.001); % model offset from 1e3Hz to
                                            % almost sr/2. To avoid
                                            % aliasing, the sample rate
                                            % must be greater than twice
                                            % the largest value specified
                                            % by FrequencyOffset
    foffset = 10.^foffsetLog;    % linear frequency offset
    PN_dBc_Hz = hPhaseNoisePoleZeroModel(foffset,fc,'C');
    figure; semilogx(foffset,PN_dBc_Hz);
    xlabel('Frequency offset (Hz)');
    ylabel('dBc/Hz');
    title('Phase noise model'); grid on

    % Apply phase noise to the waveform
    pnoise = comm.PhaseNoise('FrequencyOffset',foffset,'Level',PN_dBc_Hz,'SampleRate',sr);
    pnoise.RandomStream = "mt19937ar with seed";
    rxWaveform = pnoise(txWaveform);
    release(pnoise);
else
    rxWaveform = txWaveform; %#ok<UNRCH>
end

Introduce I/Q imbalance. Apply a 0.2 dB amplitude imbalance and a 0.5 degree phase imbalance to the waveform. You can also increase the amplitude and phase imbalances by setting amplitudeImbalance and phaseImbalance to higher values.

if IQImbalanceON
    amplitudeImbalance = 0.2;
    phaseImbalance = 0.5;
    rxWaveform = iqimbal(rxWaveform,amplitudeImbalance,phaseImbalance);
end

Introduce filter effects. To filter the baseband waveform, use a low-pass filter. If the use of the current passband and stopband frequencies, PassbandFrequency and StopbandFrequency, results in high EVM values for a certain waveform bandwidth and OSR, use a wider filter by increasing PassbandFrequency and StopbandFrequency. To use a narrower filter, reduce PassbandFrequency and StopbandFrequency. You can also modify the passband ripple and the stopband attenuation. This figure shows the magnitude response of the low-pass filter.

if filterOn
    % Create low-pass filter object
    LPF = dsp.LowpassFilter('SampleRate',sr, ...
                            'FilterType','IIR', ...
                            'PassbandFrequency',sr/2-(sr/2*0.6), ...
                            'StopbandFrequency',sr/2-(sr/2*0.5), ...
                            'PassbandRipple',0.7, ...
                            'StopbandAttenuation',60);

    % Plot the magnitude response of the low-pass filter
    [h,w] = freqz(LPF);
    figure
    plot(w/pi,mag2db(abs(h)));
    axis('tight');
    grid;
    title('Magnitude Response of the LPF')
    xlabel('Normalized Frequency (x \pi rad/sample)');
    ylabel('Magnitude (dB)');

    % Filter the waveform
    rxWaveform = LPF(rxWaveform);
    release(LPF);
end

Introduce nonlinear distortion. For this example, use the Rapp model. This figure shows the nonlinearity that is introduced by Rapp model. Set the parameters for the Rapp model to match the characteristics of the memoryless model from TR 38.803 Annex A.1.

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

    % Plot nonlinear characteristic
    plotNonLinearCharacteristic(rapp);

    % Apply nonlinearity
    rxWaveform = rapp(rxWaveform);
    release(rapp);
end

Plot the spectrum of the waveform before and after adding the RF impairments

scope = spectrumAnalyzer('SampleRate',sr,'SpectralAverages',5, ...
    'ChannelNames',{'Non-distorted waveform','Distorted waveform'}, ...
    'YLimits', [-60 0],'Title', 'Waveform before and after adding nonlinearities');
scope([txWaveform,rxWaveform]);
release(scope);

The signal was previously repeated twice. 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;
end

rxWaveform(1:nFrames*tmwaveinfo.Info.SamplesPerSubframe*10,:) = [];

Measurements

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

  • Coarse frequency offset estimation and correction

  • Integer frequency offset estimation and correction

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

  • OFDM demodulation of the received waveform

  • Fine frequency offset estimation and correction

  • Channel estimation

  • Equalization

  • Common Phase error (CPE) estimation and compensation

  • 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)).

  • PDCCH EVM computation

The example measures and outputs various EVM related statistics per symbol, per slot, and per frame peak EVM and RMS EVM. The example displays EVM for each slot and frame. 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.

cfg = struct();
cfg.Evm3GPP = evm3GPP;
cfg.TargetRNTIs = targetRNTIs;
cfg.PlotEVM = plotEVM;
cfg.DisplayEVM = displayEVM;
cfg.Label = tmwavegen.ConfiguredModel{1};

% Compute and display EVM measurements
[evmInfo,eqSym,refSym] = hNRDownlinkEVM(tmwavegen.Config,rxWaveform,cfg);
EVM stats for BWP idx : 1
PDSCH RMS EVM, Peak EVM, slot 0: 3.205 9.146%
PDSCH RMS EVM, Peak EVM, slot 1: 3.391 11.180%
PDSCH RMS EVM, Peak EVM, slot 2: 3.151 8.405%
PDSCH RMS EVM, Peak EVM, slot 3: 3.404 9.276%
PDSCH RMS EVM, Peak EVM, slot 4: 3.278 8.705%
PDSCH RMS EVM, Peak EVM, slot 5: 3.600 9.407%
PDSCH RMS EVM, Peak EVM, slot 6: 3.209 8.773%
PDSCH RMS EVM, Peak EVM, slot 7: 3.538 9.288%
PDSCH RMS EVM, Peak EVM, slot 8: 3.408 8.871%
PDSCH RMS EVM, Peak EVM, slot 9: 3.473 10.226%
PDSCH RMS EVM, Peak EVM, slot 10: 3.304 8.580%
PDSCH RMS EVM, Peak EVM, slot 11: 3.244 10.277%
PDSCH RMS EVM, Peak EVM, slot 12: 3.478 9.901%
PDSCH RMS EVM, Peak EVM, slot 13: 3.293 8.626%
PDSCH RMS EVM, Peak EVM, slot 14: 3.168 8.169%
PDSCH RMS EVM, Peak EVM, slot 15: 3.325 10.670%
PDSCH RMS EVM, Peak EVM, slot 16: 3.385 9.432%
PDSCH RMS EVM, Peak EVM, slot 17: 3.478 9.492%
PDSCH RMS EVM, Peak EVM, slot 18: 3.668 12.690%
PDCCH RMS EVM, Peak EVM, slot 0: 2.502 5.287%
PDCCH RMS EVM, Peak EVM, slot 1: 2.192 4.188%
PDCCH RMS EVM, Peak EVM, slot 2: 2.105 4.601%
PDCCH RMS EVM, Peak EVM, slot 3: 2.185 4.808%
PDCCH RMS EVM, Peak EVM, slot 4: 2.376 5.421%
PDCCH RMS EVM, Peak EVM, slot 5: 2.123 5.042%
PDCCH RMS EVM, Peak EVM, slot 6: 2.841 5.607%
PDCCH RMS EVM, Peak EVM, slot 7: 1.905 4.456%
PDCCH RMS EVM, Peak EVM, slot 8: 1.987 4.152%
PDCCH RMS EVM, Peak EVM, slot 9: 2.316 5.783%
PDCCH RMS EVM, Peak EVM, slot 10: 1.416 3.405%
PDCCH RMS EVM, Peak EVM, slot 11: 1.989 4.395%
PDCCH RMS EVM, Peak EVM, slot 12: 2.005 4.069%
PDCCH RMS EVM, Peak EVM, slot 13: 2.322 4.265%
PDCCH RMS EVM, Peak EVM, slot 14: 2.106 5.076%
PDCCH RMS EVM, Peak EVM, slot 15: 1.946 3.701%
PDCCH RMS EVM, Peak EVM, slot 16: 2.265 5.670%
PDCCH RMS EVM, Peak EVM, slot 17: 2.208 3.945%
PDCCH RMS EVM, Peak EVM, slot 18: 2.110 4.470%
Averaged overall PDSCH RMS EVM: 3.372%
Overall PDSCH Peak EVM = 12.6895%
Averaged overall PDCCH RMS EVM: 2.170%
Overall PDCCH Peak EVM = 5.7826%

Local functions

function plotNonLinearCharacteristic(memoryLessNonlinearity)
    % Plot the nonlinear characteristic of the power amplifier (PA) impairment
    % represented by the input parameter memoryLessNonlinearity, which is a
    % comm.MemorylessNonlinearity Communications Toolbox(TM) System object.

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

    % Nonlinearity
    yRapp = memoryLessNonlinearity(x);

    % Release object to feed it a different number of samples
    release(memoryLessNonlinearity);

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

Related Topics