⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 factorgraph.h

📁 根据LDPC码中码子的构造方法中的PEG算法
💻 H
字号:
/************************************** * * factorgraph * **************************************/#ifndef FACTORGRAPH#define FACTORGRAPH#undef FACTORGRAPH_DEBUG#include "BlockCodeGenerator.h"//#include "TrellisFunctionNode.h"#include "VariableNode.h"#include "ChannelTransition.h"//#include "ISI.h"#include "ParityCheckNode.h"class FactorGraph {private:    // LDPC code parameter  int N, K, M;  // maximum number of ones per row in H  int m;  // generator matrix  /* extended factor graph     int *(*G);  */  // compressed parity check matrix  int *(*T);  // info bits location within a codeword  int *infoBitsLocation;  // arrays of pointers to variable and function nodes  ChannelTransition *(*channelTransitions);  //VariableNode *(*channelSymbols);  //VariableNode *(*trellisStates);  //TrellisFunctionNode *(*trellisTransitions);  VariableNode *(*codeBits);  ParityCheckNode *(*parityChecks);  /* extended factor graph     VariableNode *(*infoBits);     ParityCheckNode *(*codeEquations);   */  // local functions  /* extended factor graph     LocalFunction *codeEquationsLF;     LocalFunction *parityChecksLF;  */  //LocalFunction *trellisSectionLF;  // auxiliary methods (uses to build the connections in the factor graph)  // (returns an array containing the number of 1s in each row/column of G and H, respectively)  /* extended factor graph     void getOnesInRowsOfG(int *ones);     void getOnesInColsOfG(int *ones);  */  void getOnesInRowsOfH(int *ones);  void getOnesInColsOfH(int *ones);public:    // constructor  FactorGraph(const BlockCodeGenerator *blockCodeGenerator);  // destructor  ~FactorGraph();  // probabilities that are used to decide which information word was sent  double *(*probabilities);  // initialization for a new received block  void initialize(double *(*prob));  // perform an update  void update(void);  // perform a BCJR update on the trellis part of the factor graph  //void BCJRupdate(void);  // perform an distributed update on the parity-check part of the factor graph  void LDPCupdate(void);  void FactorGraph::LDPCupdateExBitK(int k); // BitNode k not updated.  void FactorGraph::LDPCupdateExBitK(int k, int j);   //void LDPCupdatePartial(void);  // get a code word  void getCodeWord(int *codeWord, double *codeWordLLR);  void getCodeWord(int *codeWord, double *codeWordLLR, int pos);  // get the absolute value of the syndrome  int getAbsSyndrome(int *codeWord);  // Gausselimination of G*infobits = codeword;  void decodeCodeWord(int *codeWord, int *decidedBits);  // reset the whole graph  void reset(void);    // get the probabilities of the last trellis state  //void getEndStateProbabilities(double *(*startStateProbabilities));  // issues a list of all nodes belonging to this graph and   // writes the output to a file  //void draw(char *filename, int iteration);  // starts matlab to draw the factor graph  //void writeMatlabFile(char *filename, int iteration);  //void writeDatFile(char *filename, int iteration);  // test method  //static void test(void);  };#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -