亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? btc_general_unix.cpp

?? This CD-ROM is distributed by Kluwer Academic Publishers with ABSOLUTELY NO SUPPORT and NO WARRANTY
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
//*****************************************************************************************//
// The program simulates the performance of RM(r,m)^2-turbo code using the trellis-based MAP
// decoding  algorithm for linear block codes. The minimal trellis was drawn using Massey 
// Construction. Five decoding iteration is set and BER is written in file:BTC_General.dat
// User can input RM code parameters, i.e., r and m of RM(r,m) code. For example, RM(3,5) code
// is RM code with code length = 32 and information length = 26.  This program works up to 
// RM(4,6) or code length = 64 and information length = 57. 
// This program is written by Ms. Bo Yin
//*****************************************************************************************//

#include <iostream.h>
#include <stdlib.h>
#include <iomanip.h>
#include <fstream.h>
#include <math.h>
#include "ECHELON64.h"
#include "RM_64.h"
#include "Encoder_RM64.h"

class Node {
 public:
  Node();
  int getTime(void);
  double getStage(void);
  void setStage(double s);
  void setTime(int t);
  void setForwardmatric(double fm);
  void setBackwardmatric(double bm); 
  double getForwardmatric(void);
  double getBackwardmatric(void);
 private: 
  int time;
  double stage;
  double forwardmatric;
  double backwardmatric;
};

Node::Node() {time=0; stage=0.0; forwardmatric = 0.0; backwardmatric = 0.0;}

int Node::getTime(void) {return time;}
double Node::getStage(void) {return stage;}
double Node::getForwardmatric(void) {return forwardmatric;}
double Node::getBackwardmatric(void) {return backwardmatric;}
void Node::setStage(double s) {stage = s;}
void Node::setTime(int t) {time = t;}
void Node::setForwardmatric(double fm) {forwardmatric = fm;}
void Node::setBackwardmatric(double bm) {backwardmatric = bm;} 

class Branch {
public:
  Branch();
  int getOriginaltime(void);
  double getOriginal(void);
  double getDestination(void);
  int getBit(void); // the bit for each branch
  int getOriginalnode(void);// get the index of each original node
  int getDestinationnode(void);// get the index of each destination node
  void setOriginaltime(int ot);
  void setOriginal(double o);
  void setDestination(double d);
  void setBit(int b);//set the bit for each branch
  void setOriginalnode(int on);//set the index of each original node 
  void setDestinationnode(int dn);//set the index of each destination node
private:
  int originaltime;
  double original;
  int originalnode; 
  int destinationnode;
  double destination; 
  int bit;
};

Branch::Branch() {originaltime=bit=0; original=destination=0.0;}
int Branch::getOriginaltime(void) {return originaltime;}
double Branch::getOriginal(void) {return original;}
double Branch::getDestination(void) {return destination;}
int Branch::getBit(void) {return bit;}
int Branch::getOriginalnode(void) {return originalnode;}
int Branch::getDestinationnode(void) {return destinationnode;}

void Branch::setOriginaltime(int ot) {originaltime = ot;}
void Branch::setOriginal(double o) {original = o;}
void Branch::setDestination(double d) {destination = d;}
void Branch::setBit(int b) {bit = b;}
void Branch::setOriginalnode(int on) {originalnode = on;}
void Branch::setDestinationnode(int dn) {destinationnode = dn;}

/*******************************************************/
/*                    Main part                        */
/*******************************************************/

int findbit(int originaltime,double original,int *index, int Gx[][65], int RM_N, int RM_K);
void newAddXYtoX(int *X,int *Y,int leng, int RM_N);
double findstate(int *index,int length, int Gx[][65], int RM_N, int RM_K);
void fillid(int *in,int *out,int s,int a, int RM_N);
fstream tout("BTC_General.dat", ios::out);

int main()
{

  int lastbranch, lastnode;
  int numoneindex = 0;
  int numindex = 0;
  int startnodeindex[65];
  int startbranchindex[65];
  int i,j;
  int countnode = 0 ,numbranch = 0;
  int r, m, k, n;
  int Left[58];
  int original_G[58][65], G[58][65];
  const int *G1ptr, *G2ptr;
  int statecomplexfile[65], *stateptr;
  int nodenumber = 0; 
  int *L;
  
  cout << "Enter (r, m) : ";
  cin >> r >> m;
  RM_64 mycode(m, r);// the definition of an object for RM code original G_matrix
  G1ptr = mycode.get_G();
  
  k = mycode.get_k();
  cout << "Information length=" << k << endl;
  tout << "Information length=" << k << endl;
  n = mycode.get_n();
  cout << "Code length =" << n << endl;
  tout << "Code length =" << n << endl << endl;
  for ( i = 0; i < k; i++)
    {
      for ( j = 0; j < n; j++)
	original_G[i][j] = G1ptr[65*i + j];
    }
 
  
  ECHELON64 echelon_G( original_G, k, n);//the definition of an object for Echelon G_matrix
  G2ptr = echelon_G.get_echelon();
  for ( i = 0; i < k; i++)
    { for ( j = 0; j < n; j++)
      G[i][j] = G2ptr[65*i + j];}
 
  echelon_G.display_MSGM(); 
  stateptr = echelon_G.statecomplex();
  for (i = 0; i <= n; i++)
    statecomplexfile[i] = *(stateptr + i);
  for ( i=0; i<=n; i++)
    for (i = 0; i < n; i++)
      countnode += ( int) pow (2, statecomplexfile[i]);
  
  Node node[3000];
  Branch branch[6000];
  for(i=0; i < n + 1; i++)
    {
      for(j=0; j < pow(2,statecomplexfile[i]); j++)
	{
	  node[nodenumber].setTime(i);
	  nodenumber++;
	}
    }
  
  startnodeindex[0] = 0;
  startnodeindex[1] = 1;
  for(i=2; i < n + 1; i++)
    startnodeindex[i] = startnodeindex[i-1] + (int)pow(2,statecomplexfile[i-1]);
  
  startbranchindex[0] = 0;
 for(i=1; i < n; i++)
   {
     if(statecomplexfile[i-1] < statecomplexfile[i])
       startbranchindex[i] = startbranchindex[i-1] + (int)pow(2,statecomplexfile[i]);
     else if(statecomplexfile[i-1] == statecomplexfile[i])
       startbranchindex[i] = startbranchindex[i-1] + 2*(int)pow(2,statecomplexfile[i]);
     else if (statecomplexfile[i-1] > statecomplexfile[i])
       startbranchindex[i] = startbranchindex[i-1] + (int)pow(2,statecomplexfile[i-1]);
   }
 startbranchindex[n] = 0;

 int id[2638][10];
 int dim,s;


 for(i = 0; i < 2638; i++) 
   for(j = 0; j < 10; j++)
     id[i][j] = -1;
 
 id[0][0] = -2;

 nodenumber = 0;
 numbranch  = 0;

 
 
 L =  echelon_G.get_Left();
 for ( i = 0; i < k; i++)
   Left[i] = *(L +i);
 

/*******************************/
/*      Trellis part           */
/*******************************/
 
 for(i=0; i < n; i++)
   {
     for(dim=0; dim < k; dim++)
	{
	  if(i == Left[dim])
	    {s = dim; break;}
	  else {s = -1;}
	}
	
     if(s >= 0)
       {
	 int nn=0;
	 for(int kk=0;kk < pow(2,statecomplexfile[i]); kk++)
	   {
	     if(kk == 0)
	       {
		 for(j=0; j < 2; j++)
		   {
		     branch[numbranch].setOriginaltime(i);
		     branch[numbranch].setOriginal(findstate(id[nodenumber],n-i, G,n,k));
		     branch[numbranch].setOriginalnode(nodenumber);
		   
		     if(j==0)
		       {
			 branch[numbranch].setDestinationnode(startnodeindex[i+1]+2*kk+j);
			 fillid(id[branch[numbranch].getOriginalnode()],id[branch[numbranch].getDestinationnode()],s,-1,n);
			 branch[numbranch].setDestination(findstate(id[startnodeindex[i+1]+2*kk+j],n-i-1,G,n,k));
			 branch[numbranch].setBit(findbit(i,branch[numbranch].getOriginal(),id[startnodeindex[i+1]+2*kk+j], G, n, k));
			 node[startnodeindex[i+1]+2*kk+j].setStage(branch[numbranch].getDestination());
			 nn++;
		       }
		     else
		       {
			 branch[numbranch].setDestinationnode(startnodeindex[i+1]+2*kk+j);
			 fillid(id[branch[numbranch].getOriginalnode()],id[branch[numbranch].getDestinationnode()],s,1,n);
			 branch[numbranch].setDestination(findstate(id[startnodeindex[i+1]+2*kk+j],n-i-1,G,n,k));
			 branch[numbranch].setBit(findbit(i,branch[numbranch].getOriginal(),id[startnodeindex[i+1]+2*kk+j], G, n,k));
			 node[startnodeindex[i+1]+2*kk+j].setStage(branch[numbranch].getDestination());
			 nn++;
		       }
		     numbranch++;
		   }// loop j
		 nodenumber++;
	       } // if(kk==0) statement
	     else
	       {
		 int l,b, arrayvalue[65];
		 double value;
		 char found;
		 for(j=0; j < 2; j++)
		   {
		     branch[numbranch].setOriginaltime(i);
		     branch[numbranch].setOriginal(findstate(id[nodenumber],n-i,G,n,k));
		     branch[numbranch].setOriginalnode(nodenumber);
		     if(j==0)
		       {
			 
			 value = branch[numbranch].getOriginal();
			 for(l=n-i-1; l >= 0; l--)
			   {
			     arrayvalue[l] = (int)fmod(value,2);
			     value = value/2;
			   }
			 
			 value = 0.0;
			 for(l=n-1-i; l >= 1; l--)
			   {
			     if (arrayvalue[l]==1)
			       value +=  pow(2,n-1-i-l);
			   }
		       }
		     else
		       {
			 int idtemp[65];
			 for(int p = 0; p < n; p++)
			   idtemp[p] = -1;
			 fillid(id[branch[numbranch].getOriginalnode()],idtemp,s,1,n);
			 value = findstate(idtemp,n-i-1,G,n,k);
			 
		       }
		    
		     for(b = 0; b < 2 * pow(2, statecomplexfile[i]); b++)
		       {
			double temp;
			temp = branch[startbranchindex[i] + b].getDestination();
			 if(value == temp)
			   {
			     branch[numbranch].setDestination(temp);
			     branch[numbranch].setDestinationnode(branch[startbranchindex[i]+b].getDestinationnode());
			     branch[numbranch].setBit(branch[startbranchindex[i]+b].getBit()*-1);
			     found = 'y';
			     break;
			   }
			 else
			   {
			     found = 'n';
			   }
		       } // loop b
		     
		     
		     if(found == 'n')
		       {
			 branch[numbranch].setDestinationnode(startnodeindex[i+1]+nn);
			 if(j==0)
			   {
			     fillid(id[branch[numbranch].getOriginalnode()],id[branch[numbranch].getDestinationnode()],s,-1,n);
			   }
			 else
			   {
			     fillid(id[branch[numbranch].getOriginalnode()],id[branch[numbranch].getDestinationnode()],s,1,n);
			   } 
			 branch[numbranch].setDestination(findstate(id[startnodeindex[i+1]+nn],n-i-1,G,n,k));
			 branch[numbranch].setBit(findbit(i,branch[numbranch].getOriginal(),id[startnodeindex[i+1]+nn], G,n,k));
			 node[startnodeindex[i+1]+nn].setStage(branch[numbranch].getDestination());
			 nn++;
		       }// if(found == 'n')
		     
		     numbranch++;
		     
		   } //loop j   
		 nodenumber++;
	       } // from else statement of (kk > 0)
	     // nodenumber++;
	   }// loop kk  
       }
     else
       {
	 int nn=0;
	 for(int kk=0; kk < pow(2,statecomplexfile[i]); kk++)
	   {
	     branch[numbranch].setOriginaltime(i);
	     branch[numbranch].setOriginal(findstate(id[nodenumber],n-i,G,n,k));
	     branch[numbranch].setOriginalnode(nodenumber);
	     if(kk==0)
	       {
		 branch[numbranch].setDestinationnode(startnodeindex[i+1]+kk);
		 fillid(id[branch[numbranch].getOriginalnode()],id[branch[numbranch].getDestinationnode()],s,-1,n);
		 branch[numbranch].setDestination(findstate(id[startnodeindex[i+1]+kk],n-i-1,G,n,k));
		 branch[numbranch].setBit(findbit(i,branch[numbranch].getOriginal(),id[startnodeindex[i+1]+kk],G,n,k));
		 node[startnodeindex[i+1]+kk].setStage(branch[numbranch].getDestination());
		 nn++;
	       }
	     else
	       {
		double value;
		int l,b, arrayvalue[65];
		char found;
		 value = branch[numbranch].getOriginal();
		 for(l=n-i-1; l >= 0; l--)
		   {
		     arrayvalue[l] = (int)fmod(value, 2);
		     value = value / 2;
		   }
		      
		 value = 0.0;
		 for(l = n-1-i; l >= 1; l--)
		   {
		     if (arrayvalue[l] == 1)
		       value += pow(2, n-1-i-l);
		   }
		 
		 for(b = 0; b < pow(2, statecomplexfile[i]); b++)
		   {
		     double temp;
		     temp = branch[startbranchindex[i]+b].getDestination();
		     if(value == temp)
		       {
			 branch[numbranch].setDestination(temp);
			 branch[numbranch].setDestinationnode(branch[startbranchindex[i]+b].getDestinationnode());
			 branch[numbranch].setBit(branch[startbranchindex[i]+b].getBit()*-1);
			 found = 'y';
			 break;
		       }
		     else
		       {
			 found = 'n';
		       }
		   }
		 
		 if(found == 'n')
		   {
		     branch[numbranch].setDestinationnode(startnodeindex[i+1]+nn);
		     fillid(id[branch[numbranch].getOriginalnode()],id[branch[numbranch].getDestinationnode()],s,-1,n);
		     branch[numbranch].setDestination(findstate(id[startnodeindex[i+1]+nn],n-i-1,G,n,k));
		     branch[numbranch].setBit(findbit(i,branch[numbranch].getOriginal(),id[startnodeindex[i+1]+nn],G,n,k));
		     node[startnodeindex[i+1]+nn].setStage(branch[numbranch].getDestination());
		     nn++;
		   }
	       }
	     numbranch++;
	     nodenumber++;
	   }  
       }
   }
 
 
 lastbranch = numbranch;
 lastnode = nodenumber + 1;
 double snr, Rdb, SNR[10] = {0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5}, sigma, Lc, R, EbN0, Lxy[65][65], Lu[65][65], Le_H[65][65], Le_V[65][65], LL_U[65][65];
 double *Y_H_Vptr;
 int *Uptr, U[58][58], U_estimate[58][58];
 double Y_H_V[65][65];
 int counterbranch = 0, nodenum, counter;
 double temp1,temp2, t, tt;
 int d ;
 int times;
 int error;
 double Pe, loop;
 int iteration = 5, iter;
 
 R = ( double) k*k /(n*n - (n - k)*(n - k)) ;
 tout << "Code Rate =  " << R << endl;
 Rdb = 10*log10(R);
 
 for (int w = 0; w < 8; w++){
   
   times = 0; error = 0; 
   
   EbN0 = pow (10, SNR[w]/10);
   sigma = sqrt(1.0/(2.0*R*EbN0));
   tout << "EBN0 = " << SNR[w] << endl;
   Lc = 4*R*EbN0;
   Encoder_double64 encoder(G, k, n, sigma);
   
   for ( i = 0; i < n; i++) // initialize the Lu[i][j] 
     for (j = 0; j < n; j++)
       Lu[i][j] = Le_V[i][j] = 0;
 
   if ( SNR[w] == 0.0) 
   loop = 2e+0;
   else if ( SNR[w] == 0.5) 
   loop = 4e+0;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产aⅴ一区二区| 天天综合网 天天综合色| 国产毛片精品视频| 欧美三级三级三级爽爽爽| 《视频一区视频二区| 成人涩涩免费视频| 久久久久久久久久看片| 久久国产精品99精品国产| 欧美精品一二三四| 午夜精品久久久久久| 欧美视频一区二区三区四区| av激情综合网| 欧美午夜不卡视频| 亚洲一区二区在线免费观看视频| 99在线精品观看| 一区二区三区中文在线观看| 在线亚洲免费视频| 日韩精品一区第一页| 91精品蜜臀在线一区尤物| 美日韩一区二区三区| 精品国产乱码久久久久久闺蜜| 激情综合网最新| 国产欧美日韩不卡免费| 91亚洲精品久久久蜜桃| 国产精品色哟哟| 色偷偷88欧美精品久久久| 亚洲图片一区二区| 欧美电视剧在线看免费| 粉嫩蜜臀av国产精品网站| 国产精品乱码妇女bbbb| 在线观看av一区二区| 日本视频中文字幕一区二区三区| 亚洲精品一区二区三区四区高清| 成人国产亚洲欧美成人综合网| 一区二区三区四区五区视频在线观看 | 久久99精品久久久久久动态图| 2021久久国产精品不只是精品| 成人国产精品免费网站| 亚洲午夜国产一区99re久久| 日韩精品一区二区三区四区视频 | 免费在线观看不卡| 久久久久久**毛片大全| av中文字幕亚洲| 午夜精品久久久久久久| 国产亚洲欧美激情| 国产日产精品一区| 色综合天天综合网天天看片| 亚洲1区2区3区4区| 久久精品日产第一区二区三区高清版 | 成人听书哪个软件好| 亚洲成人黄色影院| 国产性色一区二区| 欧美男生操女生| 成人高清视频免费观看| 日韩黄色片在线观看| 日本一区二区三级电影在线观看 | 国产精品乱码一区二三区小蝌蚪| 欧美日韩成人综合| 91视频观看视频| 国产精品资源在线看| 婷婷六月综合网| 亚洲欧美一区二区久久| 26uuu精品一区二区| 欧美特级限制片免费在线观看| 国产尤物一区二区在线| 亚洲成人免费在线| 亚洲美女偷拍久久| 国产精品久久免费看| 日韩免费成人网| 欧美日本一道本| 在线亚洲高清视频| 91一区在线观看| 国产91精品一区二区麻豆网站| 毛片基地黄久久久久久天堂| 依依成人精品视频| 亚洲综合视频在线| 日韩av一二三| 亚洲亚洲人成综合网络| 综合久久给合久久狠狠狠97色 | 99久久精品99国产精品| 精品无码三级在线观看视频| 天天av天天翘天天综合网色鬼国产| 国产精品国产三级国产a| 久久日韩粉嫩一区二区三区| 欧美一激情一区二区三区| 欧美三级视频在线| 欧美色精品在线视频| 色哟哟一区二区| 91蜜桃免费观看视频| www.99精品| 91社区在线播放| 91美女蜜桃在线| 色综合夜色一区| 欧美综合在线视频| 在线一区二区三区四区| 91久久线看在观草草青青| 成人av在线资源| 99re热这里只有精品免费视频| 成人性生交大合| 99精品欧美一区二区三区小说 | 中文字幕成人网| 久久精品亚洲精品国产欧美| 亚洲精品一区二区三区四区高清 | 欧美天堂一区二区三区| 欧美日韩综合色| 欧美日韩免费在线视频| 在线播放中文一区| 日韩欧美激情一区| 国产午夜精品美女毛片视频| 国产精品毛片久久久久久| 久久成人18免费观看| 蜜臀av一区二区在线免费观看| 人人精品人人爱| 国产麻豆精品一区二区| 福利一区福利二区| 91欧美一区二区| 7777精品伊人久久久大香线蕉的 | 国产在线一区二区综合免费视频| 国产麻豆精品theporn| 成人av在线网站| 色爱区综合激月婷婷| 91麻豆精品91久久久久同性| 久久先锋资源网| 亚洲欧美日韩国产手机在线 | 全部av―极品视觉盛宴亚洲| 国产在线视频不卡二| 99国产精品国产精品毛片| 91黄色激情网站| 欧美成人bangbros| 国产精品伦理一区二区| 亚洲小少妇裸体bbw| 韩国精品久久久| 日本精品视频一区二区三区| 制服视频三区第一页精品| 国产精品一区二区在线播放| 国产精品免费视频观看| 欧美一区二视频| 久久精品国产成人一区二区三区| 国产精品911| 精品视频在线免费看| 日韩免费观看高清完整版| 国产精品理伦片| 亚洲人亚洲人成电影网站色| 午夜国产不卡在线观看视频| 国产乱码精品一品二品| 欧美性猛交xxxxxxxx| 国产亚洲精品bt天堂精选| 亚洲黄网站在线观看| 国模一区二区三区白浆| 91国产成人在线| 国产日韩欧美电影| 日本不卡一二三| 国产精品美女久久久久aⅴ国产馆| 国产精品久久精品日日| 免费国产亚洲视频| 在线观看日韩国产| 国产校园另类小说区| 日本少妇一区二区| 欧美午夜理伦三级在线观看| 国产欧美精品一区二区色综合朱莉| 亚洲自拍偷拍欧美| 91香蕉国产在线观看软件| 久久久久久久久97黄色工厂| 日韩va欧美va亚洲va久久| 91麻豆免费在线观看| 国产女人aaa级久久久级| 免费高清成人在线| 欧美日韩免费在线视频| 一区二区三区在线视频观看| 不卡的av在线播放| 国产欧美一区二区精品性色超碰| 免费不卡在线观看| 欧美一区二区在线不卡| 五月综合激情网| 欧美色窝79yyyycom| 亚洲麻豆国产自偷在线| 成人av中文字幕| 国产精品每日更新| 成人午夜碰碰视频| 国产亚洲成av人在线观看导航| 狠狠色丁香久久婷婷综合_中| 日韩欧美高清在线| 久久精品国产一区二区三 | 欧美在线观看视频一区二区三区| 最新高清无码专区| 色噜噜狠狠一区二区三区果冻| 国产精品进线69影院| 97久久久精品综合88久久| 亚洲天堂成人在线观看| gogo大胆日本视频一区| 亚洲欧美日韩国产综合| 色天使色偷偷av一区二区| 亚洲乱码中文字幕综合| 国产成人超碰人人澡人人澡| 久久久亚洲精品一区二区三区| ㊣最新国产の精品bt伙计久久| 天堂一区二区在线| 欧美一二三在线| 成人国产电影网| 亚洲v精品v日韩v欧美v专区|