Learn R Programming

rwirelesscom (version 1.4.3)

fqpskmod: QPSK Modulator

Description

Receives a vector of bits (1's and 0's). The 1's and 0's are mapped to in-phase (real) and quadrature (imaginary) components. Correspondingly, a bit of 1 is mapped to +1/sqrt(2), otherwise to -1/sqrt(2) according to the following mapping.
input
output
00
(-1 - 1i) / sqrt(2)
01
(-1 + 1i) / sqrt(2)
10
(+1 - 1i) / sqrt(2)

Usage

fqpskmod(bits, Ns = 1, p = 1)

Arguments

bits
- received vector of bits (0's and 1's).
Ns
- N samples per symbol (default, Ns = 1)
p
- a vector defining the pulse shape of the transmitted waveform (default, p = 1)

Value

Returns a complex vector of QPSK symbols. If Ns > 1 then the returned signal is shaped with pulse shape, p.

Examples

Run this code
M=4
Nsymbols=10
Nbits=log2(M)*Nsymbols
bits <- sample(0:1,Nbits, replace=TRUE)
s <- fqpskmod(bits)

Run the code above in your browser using DataLab