NewGamePhysics.Mathematics.ValueUnbiaser Class Reference

Creates unbiased bit-streams from uncorrelated values. More...

List of all members.

Public Member Functions

 ValueUnbiaser (ValueUnbiasAlgorithm algorithm)
 Creates an instance of a value unbiaser which converts uncorrelated values into bit-streams.
string Extract (double[] uncorrelatedData)
 Extract an unbiased bitstream as string of 0 and 1 characters from an array of uncorrelated values.

Detailed Description

Creates unbiased bit-streams from uncorrelated values.

Definition at line 39 of file ValueUnbiaser.cs.


Constructor & Destructor Documentation

NewGamePhysics.Mathematics.ValueUnbiaser.ValueUnbiaser ( ValueUnbiasAlgorithm  algorithm  ) 

Creates an instance of a value unbiaser which converts uncorrelated values into bit-streams.

Parameters:
algorithm The value unbiasing algorithm.

Definition at line 56 of file ValueUnbiaser.cs.

00057         {
00058             this.algorithm = algorithm;
00059 
00060             // Create AMLS unbiaser for partitioning technique
00061             this.bitUnbiaser = new BitUnbiaser(BitUnbiasAlgorithm.AMLS);
00062         }


Member Function Documentation

string NewGamePhysics.Mathematics.ValueUnbiaser.Extract ( double[]  uncorrelatedData  ) 

Extract an unbiased bitstream as string of 0 and 1 characters from an array of uncorrelated values.

Parameters:
uncorrelatedData Uncorrelated values (i.e. timing measurements of radioactive decay events).
Returns:
Extracted bitstream as string consisting of 0s and 1s

Definition at line 71 of file ValueUnbiaser.cs.

00072         {
00073             if (uncorrelatedData.Length < 2)
00074             {
00075                 return string.Empty;
00076             }
00077 
00078             StringBuilder sb = new StringBuilder();
00079 
00080             // Calculate intervals between data values
00081             double[] intervals = new double[uncorrelatedData.Length - 1];
00082             for (int i = 0; i < intervals.Length; i++)
00083             {
00084                 intervals[i] = uncorrelatedData[i + 1] - uncorrelatedData[i];
00085             }
00086 
00087             // Unbias using selected algorithm
00088             switch (this.algorithm)
00089             {
00090                 case ValueUnbiasAlgorithm.Pairwise:
00091                     this.PairwiseExtract(intervals, ref sb);
00092                     break;
00093                 case ValueUnbiasAlgorithm.Median:
00094                     this.MedianExtract(intervals, ref sb);
00095                     break;
00096                 case ValueUnbiasAlgorithm.Partition:
00097                     this.RecursiveExtract(intervals, ref sb);
00098                     break;
00099             }
00100 
00101             // Return collected bits
00102             return sb.ToString();
00103         }


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2