1

QPSK Modulation its supposed to use 2 bits for each symbol, but wheter I use pskmod or comm.QPSKModulator, I'm still getting the same amount of symbols as bits. Am i doing something wrong? Is something wrong with the function? Thanks in advance.

M=4;
n=64;
m=log2(M);
x=round(rand(n*m,1));
mod = comm.QPSKModulator;
xmod1 = mod(x);
xmod=pskmod(x,M,pi/M,'gray');

Variables in Workspace

Luis Mendo
  • 110,752
  • 13
  • 76
  • 147

1 Answers1

0

The pskmod function expects an input consisting of symbols as numbers in the range 0, ..., M-1, not bits. That is, it modulates the symbols into complex values, but doesn't do the mapping from bits to symbols. This is also the default behaviour of the comm.QPSKModulator object.

To include the bit-to-symbol mapping as part of the modulator, and thus use input in the form of bits, set the BitInput property of the comm.QPSKModulator object to true. This can be done directly when creating the object, by passing the inputs 'BitInput', true to the constructor:

modQPSK = comm.QPSKModulator('BitInput', true);
xmod1 = modQPSK(x);

Also, note that I've changed the name of the object to avoid shadowing the built-in function mod.

Luis Mendo
  • 110,752
  • 13
  • 76
  • 147