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
.