TwoBitTable.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2008 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // dspsr/Kernel/Classes/dsp/TwoBitTable.h
10 
11 
12 #ifndef __TwoBitTable_h
13 #define __TwoBitTable_h
14 
15 #include "dsp/BitTable.h"
16 
17 namespace dsp {
18 
20  class TwoBitTable : public BitTable
21  {
22 
23  public:
24 
26  TwoBitTable (Type type, bool reverse_bits = false);
27 
29  void set_lo_val (float lo_val);
30 
32  float get_lo_val () const { return lo_val; }
33 
35  void set_hi_val (float hi_val);
36 
38  float get_hi_val () const { return hi_val; }
39 
41  void set_reverse_2bit (bool flag = true);
42 
44  bool get_reverse_2bit () const { return reverse_2bit; }
45 
47  void rebuild ();
48 
50  void generate_unique_values (float* vals) const;
51 
52  protected:
53 
55  float lo_val;
56 
58  float hi_val;
59 
61  bool reverse_2bit;
62 
63  };
64 
65 }
66 
67 #endif // !defined(__TwoBitTable_h)
TwoBitTable(Type type, bool reverse_bits=false)
Constructor.
Definition: TwoBitTable.C:10
Contains all Baseband Data Reduction Library classes.
Definition: ASCIIObservation.h:17
float get_hi_val() const
Return the value of the high voltage state.
Definition: TwoBitTable.h:48
void set_lo_val(float lo_val)
Set the value of the low voltage state.
Definition: TwoBitTable.C:21
bool reverse_2bit
Flip the two data bits - that is SignMag becomes MagSign.
Definition: TwoBitTable.h:71
float hi_val
Value of voltage in high state.
Definition: TwoBitTable.h:68
void set_reverse_2bit(bool flag=true)
Set the reverse_2bit attribute.
Definition: TwoBitTable.C:32
const bool reverse_bits
Reverse the order of the bits.
Definition: BitTable.h:130
void set_hi_val(float hi_val)
Set the value of the high voltage state.
Definition: TwoBitTable.C:27
void rebuild()
Build a two-bit table with the current attributes.
Definition: TwoBitTable.C:37
void build()
Build the lookup table.
Definition: BitTable.C:104
Look-up table for converting N-bit digitized to floating point numbers.
Definition: BitTable.h:22
bool get_reverse_2bit() const
Get the reverse_2bit value.
Definition: TwoBitTable.h:54
Type
Interpretation of the bits in each value.
Definition: BitTable.h:38
void generate_unique_values(float *vals) const
Generate a look-up table for 2-bit to floating point conversion.
Definition: TwoBitTable.C:42
Type type
Digitization convention.
Definition: BitTable.h:118
float get_lo_val() const
Return the value of the low voltage state.
Definition: TwoBitTable.h:42
float lo_val
Value of voltage in low state.
Definition: TwoBitTable.h:65

Generated using doxygen 1.8.17