00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef TRELLISSOFTOUT_H
00029 #define TRELLISSOFTOUT_H
00030
00031 #include <iostream>
00032 #include <iomanip>
00033 #include <complex>
00034 #include <stdexcept>
00035 #include <algorithm>
00036 #include <memory>
00037
00038
00039 #include "signals.h"
00040 #include "misc.h"
00041 #include "phbib.h"
00042 #include "trellis.h"
00043
00044
00045
00046
00047 namespace simthlib
00048 {
00049
00050
00058 class TrellisSoftoutAlgorithm
00059 {
00060
00061 public:
00062
00065 TrellisSoftoutAlgorithm(std::auto_ptr<simthlib::Trellis> usedTrellis);
00066
00069 virtual ~TrellisSoftoutAlgorithm( );
00070
00073 virtual void softout4Output(const simth::LlvSeq &metr, simth::LlrSeq* softout, const simth::LlrSeq* apri = NULL) = 0;
00074
00077 virtual void softout4Input(const simth::LlvSeq &metr, simth::LlrSeq* softout, const simth::LlrSeq* apri = NULL) = 0;
00078
00079
00085 virtual void decode(const simth::LlvSeq &metr, simth::BitSeq* decodedData, const simth::LlrSeq* apri = NULL) = 0;
00086
00087
00091
00092
00093
00096 const simthlib::Trellis* getTrellis() {return usedTrellis_;}
00097
00098 protected:
00099
00100 simthlib::Trellis* usedTrellis() {return usedTrellis_;}
00101
00102 size_t pathLength() const {return pathLength_;}
00103
00104 void setPathLength(int newPathLength);
00105
00106 private:
00107
00108 simthlib::Trellis* usedTrellis_;
00109
00110 size_t pathLength_;
00111
00112 void invariante() const;
00113 };
00114
00115
00116 inline void TrellisSoftoutAlgorithm::invariante() const
00117 {
00118 if(DEBUG){
00119 }
00120 }
00121
00122
00123 inline void TrellisSoftoutAlgorithm::setPathLength(int newPathLength)
00124 {
00125 pathLength_ = newPathLength;
00126 invariante();
00127 }
00128
00129
00130 namespace trellissoftout{
00131
00133 enum softoutalgorithmmode {SOVA, MAXLOGMAP, LOGMAP};
00134
00136 enum sova_type {CODER_IN, CODER_OUT};
00137
00138
00144 std::auto_ptr<TrellisSoftoutAlgorithm> makeSoftoutAlgorithm(softoutalgorithmmode mode, int mem,
00145 int inSymbols, int outSymbols);
00151 std::auto_ptr<TrellisSoftoutAlgorithm> makeSoftoutAlgorithm(softoutalgorithmmode mode, int inSymbolsPerStep,
00152 const simth::checkedVector<int>& polynomials);
00158 std::auto_ptr<TrellisSoftoutAlgorithm> makeSoftoutAlgorithm(softoutalgorithmmode mode, int inSymbolsPerStep,
00159 const simth::checkedVector<int>& polynomials, int recursivePolynomial, bool systematic);
00160
00166 std::auto_ptr<TrellisSoftoutAlgorithm> makeSoftoutAlgorithm(softoutalgorithmmode mode, int inSymbolsPerStep,
00167 int bitsPerSymbol, simthlib::ConvCodeTrellis::StartingMode startingMode, simthlib::map_type mappMode,
00168 const simth::checkedVector<int>& polynomials, int recursivePolynomial);
00169
00175 std::auto_ptr<TrellisSoftoutAlgorithm> makeExplicitSoftoutAlgorithm(softoutalgorithmmode mode,int inputBitsPerStep, int outputBitsPerStep,
00176 simthlib::ConvCodeTrellis::StartingMode startingMode, simthlib::map_type mappMode);
00177
00178
00179 }
00180
00181 }
00182
00183 #endif