Function File: qaskenco (m)
Function File: qaskenco (msg, m)
Function File: y = qaskenco (…)
Function File: [inphase, quadr] = qaskenco (…)

Map a digital signal using a square QASK constellation. The argument m must be a positive integer power of 2. With two input arguments the variable msg represents the message to be encoded. The values of msg must be between 0 and m-1. In all cases qaskenco (M) is equivalent to qaskenco (1:m, m)

Three types of outputs can be created depending on the number of output arguments. That is

No output arguments

In this case qaskenco plots the constellation. Only the points in msg are plotted, which in the case of a single input argument is all constellation points.

A single output argument

The returned variable is a complex variable representing the in-phase and quadrature components of the mapped message msg. With, a single input argument this effectively gives the mapping from symbols to constellation points

Two output arguments

This is the same as one output argument, expect that the in-phase and quadrature components are returned explicitly. That is

c = qaskenco (msg, m);
[a, b] = qaskenco (msg, m);
all (c == a + 1i*b)
    ⇒ 1

If sqrt (m) is an integer, then qaskenco uses a Gray mapping. Otherwise, an attempt is made to create a nearly square mapping with a minimum Hamming distance between adjacent constellation points.

See also: qaskdeco.

Package: communications