Function File: y = pamdemod (x, m)
Function File: y = pamdemod (x, m, phi)
Function File: y = pamdemod (x, m, phi, type)

Demodulates a pulse amplitude modulated signal x into an information sequence of integers in the range [0 … M-1]. phi controls the initial phase and type controls the constellation mapping. If type is set to "Bin" will result in binary encoding, in contrast, if set to "Gray" will give Gray encoding. An example of Gray-encoded 8-PAM is

d = randint (1, 1e4, 8);
y = pammod (d, 8, 0, "gray");
z = awgn (y, 20);
d_est = pamdemod (z, 8, 0, "gray");
plot (z, "rx")
biterr (d, d_est)

See also: pammod.

Package: communications