Home > Mobile >  How to generate QPSK signal in MATLAB?
How to generate QPSK signal in MATLAB?

Time:05-06

I am trying to generate the QPSK signal in MATLAB with average transmit power of 1. I had got certain links that uses inbuilt pskmod function in MATLAB, but it do not include average transmit power of 1.

This is the code I use to generate the QPSK signal:

Mod = 4;
N = 256;
x_n = randi([0 Mod-1],N,1);

s_n = pskmod(x_n,Mod,pi/Mod);

I don't know where the signal constellation power factors in.

CodePudding user response:

As can be observed from the various sample graphs in pskmod documentation, the generated symbols have a magnitude of 1. So unless you are using a different basis function than the typical sine/cosine, it should already be providing you with a signal with an average transmit power of 1.

That said, if you would like a different average power simply scale the output of pskmod with the square-root of the desired average power as follows:

Mod = 4;
N = 256;
x_n = randi([0 Mod-1],N,1);

P = 2; % Set desired constellation power
s_n = sqrt(P) * pskmod(x_n,Mod,pi/Mod);
  • Related