00001 /*-*-c++-*-***************************************************************** 00002 mimo-pcs-decoder.h - description 00003 ------------------- 00004 begin : August 2004 00005 copyright : (C) 2004 by Volker Ohlen 00006 email : volker.ohlen@freenet.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This library is free software; you can redistribute it and/or * 00012 * modify it under the terms of the GNU Lesser General Public * 00013 * License as published by the Free Software Foundation; either * 00014 * version 2.1 of the License, or (at your option) any later version. * 00015 * * 00016 * This library is distributed in the hope that it will be useful, * 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00019 * Lesser General Public License for more details. * 00020 * * 00021 * You should have received a copy of the GNU Lesser General Public * 00022 * License along with this library; if not, write to the Free Software * 00023 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * 00024 * MA 02111-1307 USA * 00025 * * 00026 ***************************************************************************/ 00027 00028 #ifndef MIMO_PCS_DECODER_H 00029 #define MIMO_PCS_DECODER_H 00030 00031 // Mimolib includes 00032 #include "mimo-decoder.h" 00033 #include "modulationschemes.h" 00034 #include "adaptiveModulator.h" 00035 00036 namespace mimo 00037 { 00038 00039 class PCSDecoder : public mimo::Decoder 00040 { 00041 protected: 00042 00043 unsigned nr_param; 00044 bool diff_extr; 00045 bool int_hard_dec; 00046 unsigned bits_per_symbol; 00047 unsigned num_carrier; 00048 std::string mod_type; 00049 bool easy_alg; 00050 bool quality; 00051 double sum_qlty; 00052 double sum_qlty_max; 00053 double sum_diff_mat_qlty; 00054 unsigned qlty_counter; 00055 simthlib::ExtendedModList* localExtModList; 00056 00057 00058 /* 00059 Here the adaptive internal hard decision is performed. By means of the values 00060 n and i the right position inside the loading info sequence is found which exists globally. 00061 Function is called from R_iterate. 00062 */ 00063 Complex give_me_a_hard_dec(const Complex& rivalue, 00064 unsigned n, unsigned i); 00065 00066 /* 00067 Computes the received symbol values from R of the QR decomposition, 00068 using internal hard decision remapping if wanted. 00069 */ 00070 CVector R_iterate (CMatrix R, CVector e, unsigned n); 00071 00072 /* Builds the appropriate constellation diagram used for 00073 internal hard decision. */ 00074 bool what_modulation(const std::string& mod_type); 00075 00076 /* Sorts the elements of a given vector from greatest to 00077 smallest value */ 00078 Vector vecsort(Vector vec); 00079 00080 /* Makes the diagonal elements of R positiv, while changing the 00081 remaining elements respectively */ 00082 CMatrix make_R_diag_pos(CMatrix R); 00083 00084 /* Checks whether R is singular. If this is the case, the 00085 matrix inversion needed for the llr values cannot be 00086 performed. */ 00087 bool is_R_singular(const CMatrix& R); 00088 00089 public: 00090 00091 /* Gives R the right triangular shape, since LaGenQRFactComplex does not 00092 return the proper shape */ 00093 static CMatrix build_nice_shaped_R (const CMatrix& R); 00094 00095 /* Returns the diagonal elements of a matrix in vector form 00096 (absolute values if wanted). */ 00097 static Vector absdiag(const CMatrix& mat, bool betrag); 00098 00099 00101 PCSDecoder (int deviceID, simth::DeviceSystemIntf* system, 00102 const simth::PropertyList& pl); 00104 ~PCSDecoder(); 00105 00106 void endOfSimulation(); 00107 00112 int getDataLength(int codedLength) const; 00113 00118 int getCodeLength(int rawLength) const; 00119 00127 void process(); 00128 00129 00130 void Decode(const CVectorSeq& input_vectors, 00131 const MatrixFreqSignal& chanest, 00132 simth::ModSeq& output_symbols, 00133 simth::ModSeq* output_softout); 00134 00135 private: 00136 CMatrixSeq::storage_type* U_old; 00137 simthlib::ConstellationDiagram* ConstDiag; 00138 simth::LoadingInfoSeq* loading; 00139 00140 00141 }; // class 00142 00143 } // namespace 00144 00145 #endif
1.4.1