Learn R Programming

rwirelesscom (version 1.4.3)

f8pskdemod: 8-PSK Demodulator

Description

Receives a vector of complex values, r, corresponding to an 8-PSK modulated signal transmitted through a communications channel (e.g., signal plus noise). Three bits are output for each received symbol according to the following decision rules
input
output
$ -\pi/8 \ge Arg(r) < \pi/8$
000
$ \pi/8 \ge Arg(r) < 3 \pi/8$
001
$ 3 \pi/8 \ge Arg(r) < 5 \pi/8$
011
$ 5 \pi/8 \ge Arg(r) < 7 \pi/8$
010
$ 7 \pi/8 \ge Arg(r) < 9 \pi/8$
110
$ -7 \pi/8 \ge Arg(r) < -5 \pi/8$
111
$ -5 \pi/8 \ge Arg(r) < -3 \pi/8$
101

Usage

f8pskdemod(r)

Arguments

r
- received signal

Value

returns a vector of 1's and 0's, 3 bits per input element (i.e., 8-PSK symbol)

See Also

Other rwirelesscom functions: eyediagram; f16pskdemod; f16pskmod; f16qamdemod; f16qammod; f64qamdemod; f64qammod; f8pskmod; fNo; fbpskdemod; fbpskmod; fqpskdemod; iqdensityplot; iqscatterplot; stemplot

Examples

Run this code
M=8
Es=1
Eb = Es/log2(M)
Nsymbols=10
Nbits=log2(M)*Nsymbols
bits <- sample(0:1,Nbits, replace=TRUE)
s <- f8pskmod(bits)
EbNodB=7
No = Eb/(10^(EbNodB/10))
n <- fNo(Nsymbols,No,type="complex")
r <- s+n
bitsr <- f8pskdemod(r)
biterrs<-bits[bitsr!=bits]
b<-factor(bits)
Pberr=length(biterrs)/length(bits)

Run the code above in your browser using DataLab