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
Version:
$Id: BERTable.java,v 1.9 2005/03/13 16:11:55 barr Exp $
Author:
Rimon Barr <barr+jist@cs.cornell.edu>

Field Summary
private  double[] ber
          Table with Bit-Error-Rate values for given Signal-to-Noise-Ratio values.
private  double[] snr
          Table with Bit-Error-Rate values for given Signal-to-Noise-Ratio values.
 
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.
private  void check()
          Verify the input data.
private  void load(java.io.File f)
          Load BER data from a given file.
 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
 

Field Detail

snr

private double[] snr
Table with Bit-Error-Rate values for given Signal-to-Noise-Ratio values.


ber

private double[] ber
Table with Bit-Error-Rate values for given Signal-to-Noise-Ratio values.

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

load

private void load(java.io.File f)
           throws java.io.IOException
Load BER data from a given file. BER data should be formatted as a plain text file with floating point numbers in two columns (SNR BER). The SNR values should be ascending.

Parameters:
f - BER data file
Throws:
java.io.IOException - unable to read BER file

check

private void check()
Verify the input data. Check that SNR values were in ascending order.


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