# Why do I get the same PAPR effect with all modulation orders in MATLAB

I am using the basic way to calculate the PAPR of OFDM system using MATLAB, the strange thing I noticed that I get almost the same PAPR effect even when increasing the modulation order from 4 to 64. I couldn't explain the cause of that issue. Here is the code I use:

N = 256;
M = 4;

PAPR_ofdm = zeros(1, 10^5);  %initialize
for J = 1 : 10^5
J
bi = randi([0 M-1], N, 1);  %generate data
xi = qammod(bi, M , 'UnitAveragePower', true);  %Modulation
Xi_t = ifft(xi);
PAPR_ofdm(J) = 10*log10(max(abs(Xi_t.^2)) ./ mean(abs(Xi_t.^2)));
end

[cdf_ofdm, PAPR_ofdm] = ecdf(PAPR_ofdm);           % PAPR

figure(1);
semilogy(PAPR_ofdm, 1-cdf_ofdm, 'b:','LineWidth',2.0);hold on   %
grid on
legend('Conventional OFDM');


Here is the result I get with M = 4 and M = 64:

## 3 Answers

This is because the distribution for OFDM waveforms after the IFFT, prior to using additional crest factor reduction techniques, closely approach a Gaussian, regardless of modulation order. Therefore the PAPR will be very similar for all case. Assuming random data assignment to each subcarrier, the IFFT is a sum of independent and identically distributed random variables, which approaches a Gaussian as the FFT size grows consistent with the Central Limit Theorem]. If we had independent subcarriers that were each Gaussian noise (or any distribution) or simple binomial distributions (BPSK), the result would still approach a Gaussian distribution (as long as each are independent with similar standard deviations).

Here are plots from my own OFDM simulations shown PAPR versus modulation order for different FFT sizes. Notice that only in the case of the very small FFT size can you distinguish PAPR versus modulation order of the sub-carriers. Otherwise it is all consistent with the Central Limit Theorem (Gaussian), as expected. I included a simulation with Gaussian noise to show how that compares to the OFDM result.

• Yes, but ideally increasing the modulation order should increase the level of PAPR, is that right? I mean when I increase M from 4 to 64, I supposed to get higher PAPR not the same. Commented Mar 1, 2023 at 2:34
• @Fatima_Ali No, increasing the modulation order does not increase the level of PAPR. It will be the same, for larger FFT sizes it all approaches a Gaussian. I will add some of my own plots. Commented Mar 1, 2023 at 5:02
• @Fatima_Ali the Normal distribution of Xi_t (by the CLT) is unchanged regardless of modulation order M because you have normalized the constellations by xi = qammod(bi, M , 'UnitAveragePower', true); Commented Mar 1, 2023 at 9:19
• @AlexTP Even when I used xi = qammod(bi, M) , I get the same results. Or, you mean using another way to avoid the normalized constellation? Commented Mar 1, 2023 at 11:20
• @DanBoschen OK, thank you, I got it. However, what I was thinking before that the PAPR is upper bounded the the absolute summation square of N modulated data divided by the mean square , so when using higher M, the absolute value will be higher. Commented Mar 1, 2023 at 11:24

1.- Fatima is right: Increasing QAM order INCREASES PAPR, for a single QAM carrier

close all;clear all;clc

M = [2 4 16 64 256];       % qam modulation index

N = 256;   % length input signal


With a long enough time sequence there's no need to repeat J times or even calculate IFFT, to get PAPR

% for k = 1 :1 : J

T=zeros(1,4);

for k=1:1:numel(M)

x = randi([0 M(k)-1], N, 1);      % generate data

[ai,aq]= qmmod(x, M(k));         % qmmod produces W-gam [ai aq] pairs

Px_avg =  mean(ai.^2+aq.^2);
Px_peak = max(ai.^2+aq.^2);
PAPR=Px_peak/Px_avg;

Px_avg_dB=10*log10(Px_avg);
Px_peak_dB=10*log10(Px_peak);
PAPR_dB=10*log10(PAPR);

T=[T ; M(k) Px_avg_dB Px_peak_dB PAPR_dB];

end
T(1,:)=[];

T


Fatima is right, with N increasing, N being the QAM order or index, then PAPR_dB the first column from the right hand side, also increases.

T =
2.0000         0         0         0
4.0000   11.3731   12.5527    1.1796
16.0000   17.5468   19.9123    2.3654
64.0000   20.3468   23.8382    3.4914
256.0000   22.2019   26.5321    4.3302


Ignore the 1st line of T, qmmod.m is a work in progress.

Note I use qmmod instead of the Communications Toolbox qammod because I am working on a QAM modulation function that includes as input the actual signal power, any power level, this feature not shown in the following qmmod.m

function [ai aq]=qmmod(x,M)   % ,P)
% QAM generation of I and Q values on constellation
% M : QAM index
% 1st release : Only square constellations : M can only be one of these [2 4 16 64 256]
%
% P : signal power, by default QAM is built
% M=2 : [-1 1]
% M=4 : [-1 1] x [-1 -1]
% M=8 : [-3 -1 1 3] x [-3 -1 1 3]
% ..
% P[W] adjusting signal amplitudes to match P
%
% next version: M range [2 4 12 16 28 32 60 64 124 128 252 256]
% next version: custom assignment of constellation points, suggesting best fit

log2M=log2(M);
A=1;
x=A*x(:);

s=0;   % switch case, 0 not assigned

% set s and tc
if M==2 s=1; end  % no Q
if M>2 s=2; end

ai=zeros(numel(x),1);
aq=zeros(numel(x),1);

switch s
case 1   % M=2; [-1 1]; Q null
ai=2*x-1;

case 2   % M>2

x2=x+1;
[I Q]=meshgrid(-(2*log2M-1):2:(2*log2M-1));
Q=flip(Q);

for k=1:1:numel(x2)
ai(k)=I(x2(k));
aq(k)=Q(x2(k));
end

otherwise

end

% power adjustment: working on it

end


2.- X2(f)=ifft(x) and x(t) are basically the same signal, so X2 and x have same power

As shown in T, increasing N increases PAPR,

but this is for 1 isolated QAM carrier.

ifft is used to keep many QAM carriers very close in frequency without interfering one other, avoiding spectral regrowth typical of analog TV PAL Secam NSTC AM FM SSB analog modulations need consistent empty spectrum between adjacent channels that render them not efficient in comparison to OFDM based wireless systems.

Even ADSL uses OFDM to cover the last mile in analog telephony, now being replaced with Fiber-to-home, gradually.

X2=ifft(x) so both x and X2 have the same power because both X2 and x are the same signal.

3.- Dan is also right, OFDM keeps PAPR almost constant

OFDM based signals are superior to single carriers because a lot more data/Hz can be sent/received.

With much higher data rates, besides more raw larger payload, more sophisticated coding is possible.

4.- Input signal stats alone may force single QAM carrier power and PAPR to change, even abruptly

This

is, in general terms, a single QAM carrier.

The same way that one cab driver most of time doesn't have, and doesn't want to have a clue who is going to be the next customer, but the public transport of a city can and do model quite accurately traffic volumes, for a single we can shape g but a b are unknown.

However when having 2000/8000 QAM carriers (DVB-T) nicely interleaved using IFFT then stats of a and b can be shaped.

Using a single carrier a b

• Perhaps are going to push outer symbols to carry most of the 'weight' thus increasing the mean power of this carrier and reducing PPAR.

• OR a b show really low mean values, reaching seldom reaching to the outer constellation, causing high PAPR.

OFDM 'randomizes' the input stream with coding that adds enough bytes to shift mean values of a b to keep PPAR steady.

5.-English alphabet stats alone hardly apply to internet traffic statistics

Don't get me wrong, English is The lingua franca, but bare English text, or for the matter any human language text, all together are a tiny percentage of the internet traffic therefore their stats hardly shape telecommunications stats. Internet is machine-to-machine traffic, and trending.

The following histogram may be considered a really basic probability distribution of the A-Z alphabet for the English language

at least according to 'Cryptological Mathematics' author : Robert E. Lewand, 2000.

Don't have the book so I captured values directly on the publicly available graph

A=imread('002.jpg');
A2=A(:,:,1);
A3=~imbinarize(A2);
figure;
ax=gca
imshow(A3);

sprintf('click on X axis')
[x_x_axis,y_x_axis]=ginput(1);  % y_x_axis is p=0

sprintf('click on top graph frame p=0.08')  % p=.08
[x08,y08]=ginput(1)

sprintf('now click once on top of each bar')
[xabc,yabc]=ginput(26);

P=(y_x_axis-yabc)/(y_x_axis-y08)*.08-.011717171717172/26

sum(P)


P neither include numbers, nor capital characters, or any punctuation, .. not really useful, is it?

Let alone the contents of HTML CSS JS files sent over exceeds bare language texts. And then volumes of imagery traded over the internet are simply put staggering in comparison.

The only way to control a and b is through coding; not once modulated, and least of all attempting Automatic Gain Control once in band, that AGC are used, but the signal on transmitting antenna has to be as stable as possible, In a way to speak : Once in production everything tends to roll downhill pretty fast.

Often such coding is proprietary, or it takes time to get to it, and understand it: always that missing function, or not publicly updated, ..

Compression and encryption help disguise the actual statistics of source files.

Controlling power levels allows accurate coverage calculations.

As soon big mobile communications understood the advantages of OFDM over single carrier systems they all decided to upgrade, at double.

6.- Concise OFDM simulation, in MATLAB

I just found a really nice and concise OFDM simulation script, in MATLAB that may be of help in this question.

OFDM Simulation Using MATLAB Author : G. Acosta, August, 2000, at the Smart Antenna Research Laboratory at what I guess is the University of Chicago Faculty Advisor: PhD M. A. Ingram

Highly recommended to Fatima, if developing OFDM simulation in MATLAB, to read the published text available here

The following lines are just a part, just transmission

%DVB-T 2K Transmission
%The available bandwidth is 8 MHz
%2K is intended for mobile services

close all;clear all;clc

%DVB-T Parameters
Tu=224e-6; %useful OFDM symbol period
T=Tu/2048; %baseband elementary period
G=0; %choice of 1/4, 1/8, 1/16, and 1/32
delta=G*Tu; %guard band duration
Ts=delta+Tu; %total OFDM symbol period
Kmax=1705; %number of subcarriers
Kmin=0;
FS=4096; %IFFT/FFT length
q=10; %carrier period to elementary period ratio
fc=q*1/T; %carrier frequency
Rs=4*fc; %simulation period
t=0:1/Rs:Tu;
%Data generator (A)
M=Kmax+1;
rand('state',0);
a=-1+2*round(rand(M,1)).'+i*(-1+2*round(rand(M,1))).';
A=length(a);
info=zeros(FS,1);
info(1:(A/2)) = [ a(1:(A/2)).']; %Zero padding
info((FS-((A/2)-1)):FS) = [ a(((A/2)+1):A).'];
%Subcarriers generation (B)
carriers=FS.*ifft(info,FS);
tt=0:T/2:Tu;
figure(1);
subplot(211);
stem(tt(1:20),real(carriers(1:20)));

subplot(212);
stem(tt(1:20),imag(carriers(1:20)));
figure(2);
f=(2/T)*(1:(FS))/(FS);
subplot(211);
plot(f,abs(fft(carriers,FS))/FS);
subplot(212);
pwelch(carriers,[],[],[],2/T);
% D/A simulation
L = length(carriers);
chips = [ carriers.';zeros((2*q)-1,L)];
p=1/Rs:1/Rs:T/2;
g=ones(length(p),1); %pulse shape
figure(3);
stem(p,g);
dummy=conv(g,chips(:));
u=[dummy(1:length(t))]; % (C)
figure(4);
subplot(211);
plot(t(1:400),real(u(1:400)));
subplot(212);
plot(t(1:400),imag(u(1:400)));
figure(5);
ff=(Rs)*(1:(q*FS))/(q*FS);
subplot(211);
plot(ff,abs(fft(u,q*FS))/FS);
subplot(212);
pwelch(u,[],[],[],Rs);
[b,a] = butter(13,1/20); %reconstruction filter
[H,F] = freqz(b,a,FS,Rs);
figure(6);
plot(F,20*log10(abs(H)));
uoft = filter(b,a,u); %baseband signal (D)
figure(7);
subplot(211);
plot(t(80:480),real(uoft(80:480)));
subplot(212);
plot(t(80:480),imag(uoft(80:480)));
figure(8);
subplot(211);
plot(ff,abs(fft(uoft,q*FS))/FS);
subplot(212);
pwelch(uoft,[],[],[],Rs);

%Upconverter
s_tilde=(uoft.').*exp(1i*2*pi*fc*t);
s=real(s_tilde); %passband signal (E)
figure(9);
plot(t(80:480),s(80:480));
figure(10);
subplot(211);

%plot(ff,abs(fft(((real(uoft).').*cos(2*pi*fc*t)),q*FS))/FS);
%plot(ff,abs(fft(((imag(uoft).').*sin(2*pi*fc*t)),q*FS))/FS);
plot(ff,abs(fft(s,q*FS))/FS);
subplot(212);
%pwelch(((real(uoft).').*cos(2*pi*fc*t)),[],[],[],Rs);
%pwelch(((imag(uoft).').*sin(2*pi*fc*t)),[],[],[],Rs);
pwelch(s,[],[],[],Rs);


This script allows now to go for OFDM signal power calculations measuring in-channel power directly on the spectrum of the signal, which is how in general all operators do it because it's what the operator essentially pays for:

On-Air Signal power reaching subscribers.

If you now play with the the input signal, you can directly simulate mean and peak OFDM power, not on just a single QAM carrier, that as explained above relies heavily on the statistical nature of the input signal, while the Coding behind OFDM && OFDM many carriers both hand-in-hand, harden the system against any incoming statistical behaviour.

In my opinion this is a good start point to achieving reliable OFDM PAPR and CCDF simulations.

Note that mobile comms operators use variations and upgrades of the OFDM DVB-T system here explained: Mobile comms operators removed a lot of armour to maximise payload, tower-mobile distances are most of times far shorter than broadcast antenna to roof antenna. And because cells hugely vary, mobile comms signal levels are also far more disperse, even on base station antenna and indeed down to the hard-working subscription payers.

• Thank you for the details you provided, but I have some points couldn't get them, 1- In your first point, you are using qmmod to produce the constellation without normalization, but I see the output is little bit strange. for example when using [a b] = qmmod(bi,4); which is equivalent to M = 4; I real part a all equal to -3 and b is a logic mapping signal. in that case T is logic as you are increasing he amplitude of a 2- Is the output of the function you use equivalent to qammod(x, M(k)) ?, I mean the same function of MATLAB toolbox but without normalizing the power. Commented Mar 2, 2023 at 0:56
• If so, the OFDM PAPR also will be the same for all levels of M according to the results of MATLAB. In your point 2, you mentioned that X2 and x(t) are the same, what you mean by x(t), is it x? I agree they have the same average power as the Fourier matrix is unitary, but I think they are different in ofdm as X2 might include the summation of all signals x inserted to different subcarriers, right? Finally, what do you mean by single QAM carrier? Is it single carrier modulation? Commented Mar 2, 2023 at 0:57
• To Fatima, I have posted a 2nd answer that complements the 1st one answering the questions you have asked as comments, questions that are closely related to the initial question. Commented Mar 2, 2023 at 10:04

ADDITIONAL COMMENTS

Hi Fatima, the following comments answer the additional questions closely related to this post question :

1.- In your first point, you are using qmmod to produce the constellation without normalization, but I see the output is little bit strange. for example when using [a b] = qmmod(bi,4); which is equivalent to M = 4; I real part a all equal to -3 and b is a logic mapping signal. in that case T is logic as you are increasing he amplitude of a

T is just a table showing results: T left column is M : the QAM index or order.

T furthest right column is PAPR in dB : PAPR_dB

If you hold same signal power constant while putting more constellation points, the BER is going to suffer, BER goes up, the quality of the signal then goes down, and the bitrate goes down.

Bitrate is what all operators need as high as possible to maximise revenue.

When smartphones start losing traffic, apps stop working, customers drop subscriptions. No money : bad.

High bit rates : money up, good.

To compare the PAPR of 2 carriers, one against the other, whatever carriers, 2 single QAM carriers, 2 OFDM carriers .. my understanding is that the bitrate has to be the same.

Let's say smartphones using 100Mbps all ok with PAPR=10dB.

The operator thinks : To keep those 100Mbps do I really need to pay for a 15W base station? or can I reduce it to 10W WHILE HOLDING BITRATE meaning the average power has to be there, doing the work of supplying enough Eb/N0 to keep BER low enough.

Does the operator really need peak power to go much higher than average power?

This means, can the operator reduce PAPR thus saving a lot across thousands of base stations lowering peak powers WHILE KEEPING same Quality of Service?

The sought PAPR reduction is to lower peaks..

The PAPR analysis should include BER(Eb/N0) checks, to make sure that BER remains constant, when increasing/decreasing M the QAM modulation index.

It's not just increase M and see what happens, but the other way round, with M decreasing does the operator still make lots of money?

Solely to such purpose : does BER remain where I have it satisfying customers?

The purpose of comparing is that for same quality = same error probability = keep constant spacing between adjacent constellation points, then how does PAPR behave. And the point you don't mention, does BER hold?

2.1.- Is the output of the function you use equivalent to qammod(x, M(k)) ?, I mean the same function of MATLAB toolbox but without normalizing the power

2.2.- If so, the OFDM PAPR also will be the same for all levels of M according to the results of MATLAB.

Don't think so, no to both 2.1 and 2.2.

Answering 2.1 : You use qammod with the option

qammod(bi,M,'UnitAveragePower',true)

This means that with M increasing (adding points in QAM constellation) you force qammod to constrain more points within same constellation square.

This also means closer constellation points, that causes BER go up, QoS down: bad. You have to keep QoS as high and as CONSTANT as possible BOTH AT THE SAME TIME.

Below certain signal power BER is no longer constant, you don't want that, AVERAGE Power levels have to remain above certain thresholds, or you start losing money.

This means constellation points cannot come too close : but this is what you do with qammod option setting modulation power to the only power value that qammod can constrain to : 1W.

Try command genqammod general QAM modulation.

I haven't tried, not going to. Perhaps genqammod can set different power levels SO THAT Eb/N0 and BER remain constant.

Even with not so good QoS, if you as operator guarantee 95% time year QoS of 95% mobiles above and acceptable threshold, your customers will remain with you, and more customers will subscribe because you have a stable network, an network that has to be as invisible as possible to your customers on all sides of the network.

If for instance the QoS you offer is wonderful on weekends but during the week smartphones cannot check emails because of dropped packets and while watching real time videos and listening real time audio, such streams start buffering, that's a no-really-no way, a don't-go-there situation.

To 2.2 : You have asked for OFDM PAPR but you still have not generated an OFDM signal. The code you supplied in your question generates many many times 1 and only 1 QAM carrier.

Yes from the signal power point of view some literture shows with maths that because OFDM carriers are not correlated, with K carriers then the OFDM signal has K times the power of a single carrier.

But although P_OFDM is approximately K*P_QAM, the carriers are sharing data from the same stream, that is coded, encrypted, and is made as mean flat as possible, BUT they do share the same a and b, the a+1j*b QAM envelope that I call ai aq .

If you jam 1/5th of all QAM carriers inside an OFDM carrier, completely, bang, SNR flat on 1/5th of the OFDM channel the BER doesn't go up, there's no data loss, not at all. This is because data is somehow repeated across the QAM carriers within 1 OFDM carrier.

IF you want to measure OFDM signals, generate OFDM signals.

If you want to simulate OFDM signals, build OFDM signals.

This is what I answered to your question supplying working MATLAB code written by Costas, a good start point to simulate DVB-T OFDM signals.

I know, DVB-T is no longer the fashion OFDM on stage, now it's about mobile comms, but it's the one I know best.

I am sure that with a bit of research you can find 3G 4G 5G OFDM simulations in MATLAB, or any other coding language, that build signals that in turn allow you to measure signal avg power, peak power, PAPR, Eb/N0, BER.

OFDM used in mobile comms OFDM have many signalling channels that are not needed in DVB-T.

DVB-T is a on-way motor way for data. Tower-to-customer, although there are DVB variations that have return channels, in real time, not necessarily through same network. Nowadays there's a lot more money and work in mobile comms thank in broadcast.

Mobile comms also use shorter radio links and the towers provide 'soft' hand-shakes that have evolved to mobile phones pulling/pushing data from multiple towers around them. Towers generate beans that focus energy and mobile phones use multiple towers to precisely keep (QoS high && constant) as possible = Keep BER as (low && constant) as possible.

When I briefly installed some NB for 3G, one of the tasks closing installations was either leave a BER meter plugged to the indoor base station equipment, left overnight, to collect and validate BER ok. Or some base stations wouldn't need BER meter, but they were left 'data looped back' in the configuration menu, feeding back all data received, back to a service SIM card that would be driven around while recording and checking BER stable across some points considered very good or very bad within that cell, from the BER point of view.

3.1.- In your point 2, you mentioned that X2 and x(t) are the same, what you mean by x(t), is it x?

Yes x(t) is x . x(t) is not actually MATLAB code, that it can be, but not here.

You use xi and Xi_t . I considered xi to be confusing because I use ai for In-phase and aq for Quadrature so I put a 2 next to capital X for the result of FFT transforms.

FFT and IFFT are not that different; yes FFT goes from time to frequency and IFFT from f to t.

But to a computer or program, computationally speaking, these 2 operations are not that different.

Mind the gap, the 1/N factor may change when changing amounts of time samples and amounts of frequencies.

3.2.- I agree they have the same average power as the Fourier matrix is unitary, but I think they are different in ofdm as X2 might include the summation of all signals x inserted to different subcarriers, right?

In your code, at least in the question, the way you use ifft does not produce an OFDM signal, it produces an FFT of a single QAM carrier.

You are actually doing IFFT not FFT, but I deliberately say FFT so you understand that IFFT itself only generates OFDM when you do

ifft(sum([x1 x2 x3 .. x998 x999 x1000]))

small x-ith being the individual QAM carriers x1(t) x2(t) x3(t) ... x1000(t) necessary to build 1 OFDM carrier .

Each xi(t) has a different frequency, and although mathematically orthogonal, and thus we can put them very close one another, in reality their spectral presence affects nearby carriers. Noise is always there. Even the outer space that everybody says it's completely empty, it has 2.7 Kelvin noise temperature.

The simulated OFDM signal that I show closing my answer, the brick of 2000 carriers, the real signals usually have between SNR 20dB and 25dB peak-to-shoulder as per requirements of operators. SNR measurement peak-to-shoulder is done on lowest and highest carriers, to ground noise level. In DVB-T those 2 'edge' carriers are pilots that do not carry payload data.

The simulation shows SNR 80dB peak-to-shoulder that never happens in reality.

This is only a simulation: Without amplitude noise, without phase noise, without 200 phones nearby, and 15 nearby towers producing similar signals.

4.- Finally, what do you mean by single QAM carrier? Is it single carrier modulation?

qammod and qmmod generate 1 QAM carrier, only one.

Your code generates just 1 QAM carrier.

I start with a single carrier, to explain something, to then generate 1 OFDM carrier, a signal that comprises many carriers on different frequencies sharing coded data.

The MATLAB lines supplied in your question does not generate an OFDM signal.

5.- OFDM is a group of many carriers, quite close each other, but with frequencies and power levels such there's little or no interference throughout the channel or against adjacent channels. OFDM carriers can be configured to be all N-QAM but depending upon the standard other modulations different than QAM can be used. QAM is among the most efficient single-carrier modulations from the data_rate/Hz = bps/Hz bps: bits/second. This is why often is the preferred choice, but not always.

Correct again.

There's a lot of interference, doppler, ..

So

ifft((ai1+1j*b1)*g*exp(1j*w1*t))


is not the same as

ifft((ai1+1j*b1)*g*exp(1j*w1*t) + (ai2+1j*b2)*g*exp(1j*w2*t) + ...
(ai1+1j*b1)*g*exp(1j*w3*t) + (ai2+1j*b1)*g*exp(1j*w4*t) + ...
...
(ai7997+1j*b7997)*g*exp(1j*w7997*t) + (ai7998+1j*b7998)*g*exp(1j*w7998*t) + ...
(ai7999+1j*b7999)*g*exp(1j*w7999*t) + (ai8000+1j*b8000)*g*exp(1j*w8000*t) + ...)


add just a little bit of noise and you will see the difference.

Wireless channels sometimes are really really noisy to the point of completely jamming some of QAM carriers building 1 OFDM carrier.

OFDM coding (kind-of) repeats coded data across carriers so there's no actual loss of data in the event of partial channel interference, thus not causing 'send again' requests.

Keep BER low && stable.

I hope this explanation helps, all the best, thanks for your attention.$$`$$