I am trying to implement a M-PAM modulator in Matlab without using the built-in functions. I am confused when it comes to the symbols-bits mapping.
Say I have a sequence of bits: 1000110110
and M = 4
which means I encode k = log2(M)
bits into each symbol. So, I get the vector s = [2 0 3 1 2]
. But to my understanding this is not the proper mapping because the symbols arent symmetrical e.g. 1,-1,2,-2,3,-3. However, in functions like pammod I see examples that produce the symbols with randi
that gives the first kind of mapping. Then, the mapping is passed as an argument in pammod. That is really odd for me since later on the amplitude per symbol is computed using the symmetrical mapping like (2m - M - 1)A
(2m - M - 1 produces symmetrical symbols) where A is an energy constant and m = 1,2,3...,M
.
So is it ok to use the first mapping when computing the Am amplitude but its less viable? Or I am misunderstanding the concept?