BER_Functions

library( binfunest)
#set.seed( 31394)

The binfunest package includes a number of common bit error rate functions. The function take a Signal to Noise ratio (SNR) expressed as the energy in a single bit (Eb/N0) in Decibels and return the probability of error. Most of the functions were taken from Proakis.

plot( QPSKdB, 0, 20, log="y", ylim=c( 1e-6, 0.5), axes=F, 
      main="Modulation Performance Curves", xlab="SNR in dB",
      ylab="BER")
axis(2, at=log10Tck('y','major'), tck=1, lty=3) # left
axis(4, at=log10Tck('y','major'), tcl= 0.2, labels=NA) # right
axis(2, at=log10Tck('y','minor'), tcl= 0.1, labels=NA) # left
axis(4, at=log10Tck('y','minor'), tcl= 0.1, labels=NA) # right
axis(1, at=seq( from=0, to=20, by=2), tck=1, lty=3) # normal x axis
#axis(3) # normal x axis on top side of plot
box()
curve( DBPSKdB, 0, 20, col="cyan", add=TRUE)
curve( DQPSKdB, 0, 20, col="magenta", add=TRUE)
curve( QAMdB.8.star, 0, 20, col="blue", add=TRUE)
curve( PSQPSKdB, 0, 20, col="red", add=TRUE)
curve( QAMdB.16, 0, 20, col="green", add=TRUE)
legend( "bottomleft", legend=c( "QPSKdB", "DBPSK", "DQPSKdB", "QAMdB.8.star", "PSQPSKdB",
                                "QAMdB.16"),
        lty=c( 1, 1, 1, 1, 1, 1),
        col=c("black", "cyan", "magenta", "blue", "red", "green"))