
16.3. MATLAB IMPLEMENTATION 269
cos(1π/2) = 0, cos(2π/2) = −1, or cos(3π/2) = 0. Thus, the LO will only have
an output value of +1, 0, −1, or 0. For this special case of signal generation, mixing
with the LO requires very few computational resources.
5. (Line 7): The counter variable is used to determine the current position within a
symbol.
6. (Lines 16–18): A new data bit is generated whenever counter is equal to 1.
7. (Line 21): Calculates the output value by multiplying (mixing) the data value with
the LO’s output. The cosine variable is accessed by the MATLAB mod command
which maintains the index value between 1 and 4.
8. (Lines 24–26): The counter ...