jist.swans.radio
Class BERTable

java.lang.Object
  extended by jist.swans.radio.BERTable

public class BERTable
extends java.lang.Object

Implementation of Bit-Error-Rate calculations (via a loaded table) for a range of Signal-to-Noise-Ratio values.

Since:
SWANS1.0

Constructor Summary
BERTable(java.lang.String filename)
          Initialize the BER table with data from given file.
 
Method Summary
 double calc(double snrVal)
          Compute BER value by interpolating among existing SNR points.
 boolean shouldDrop(double snrVal, int bits)
          Compute probabilistically whether an error occured for a given number of bits and SNR value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BERTable

public BERTable(java.lang.String filename)
         throws java.io.IOException
Initialize the BER table with data from given file.

Parameters:
filename - file to load
Throws:
java.io.IOException - unable to read BER file
Method Detail

calc

public double calc(double snrVal)
Compute BER value by interpolating among existing SNR points.

Parameters:
snrVal - input SNR value for BER computation (interpolation)
Returns:
Bit-Error-Rate

shouldDrop

public boolean shouldDrop(double snrVal,
                          int bits)
Compute probabilistically whether an error occured for a given number of bits and SNR value.

Parameters:
snrVal - Signal-to-Noise-Ratio value
bits - number of bits
Returns:
whether (probabilistically) an error occurred