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

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

?? btc_atm_unix.cpp

?? This CD-ROM is distributed by Kluwer Academic Publishers with ABSOLUTELY NO SUPPORT and NO WARRANTY
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
//**************************************************************************************//
// This program simulates the performance of the shortened RM(32,26)^2-turbo code case A
// The Trellis-based MAP algorithm is used. This code is an Equal Error Protetion (EEP) code
//**************************************************************************************//

#include <iostream.h>
#include <fstream.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <alloc.h>
#include <math.h>
#include <iomanip.h>

#define RM_N 32
#define RM_K 26
#define ORDER 3
#define dimfill1 8
#define dimfill2 26
#define Maxiter 5
#define startEBN0 1
#define SNRincr 0.5
#define Numrun 20

int Gx[27][33]; 
int nzero;
void get_data(void);
void add_noise(double sig);
double gauss_rv(double mean, double sigma);
int print_e_r(void);
double prioriprob[33][33];
double Receive[33][33]; 
int DIN[27][33];
double Soft[33][33];
double FinalSoft[33][33];
int numcode;

// RM generator Matrix part
void generateG(int order);
void multiply(int *out, int *v1,int *v2);
double bico(int n, int k);
int factorial(int n);


// for MSGM part
void Find_L_R(int *L, int *R, int *Given_row,int n);
void AddXYtoX(int *X, int *Y);
char Check(int *L, int *R);
void MSGM(int Gen[][33]);
void RMencoder(double *Out, int *In);
void Echelon(int Gen[][33]);
int Left[27];
int Right[27];
int Parity[27];
long total_errors[7];
long total_errorsarea1[7];
long total_errorsarea2[7];
double BERarea1[6],BERarea2[6],BERarea3[6];
double BER[6];
ofstream fout;
int iter;
double total_number_of_data_bits;
double Output_EBN0_dB;
double CodeRate,CodeRate_dB;

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

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

int Node::getTime(void) {return time;}
int Node::getStage(void) {return stage;}
double Node::getForwardmatric(void) {return forwardmatric;}
double Node::getBackwardmatric(void) {return backwardmatric;}
void Node::setStage(int 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);
  int getOriginal(void);
  int getDestination(void);
  int getBit(void);
  int getOriginalnode(void);
  int getDestinationnode(void);
  void setOriginaltime(int ot);
  void setOriginal(int o);
  void setDestination(int d);
  void setBit(int b);
  void setOriginalnode(int on);
  void setDestinationnode(int dn);
 private:
  int originaltime;
  int original; 
  int originalnode;
  int destinationnode;
  int destination;
  int bit;
};

Branch::Branch() {originaltime=original=destination=bit=0;}

int Branch::getOriginaltime(void) {return originaltime;}
int Branch::getOriginal(void) {return original;}
int 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(int o) {original = o;}
void Branch::setDestination(int d) {destination = d;}
void Branch::setBit(int b) {bit = b;}
void Branch::setOriginalnode(int on) {originalnode = on;}
void Branch::setDestinationnode(int dn) {destinationnode = dn;}

void Trellis(void);
int findbit(int originaltime,int original,int *index);
void newAddXYtoX(int *X,int *Y,int leng);
int findstate(int *index,int length);
void fillid(int *in,int *out,int s,int a);
void Softout(double *Rx,double Lc, double *Le_in, double *soft_out,int tag); 
int findparallel(int originaltime);
double callogone(double in1,double in2);
double callogzero(double in1,double in2);
double algebra(double in1,double in2);
double Lc;
double LeIn[33];
double Le[33];
double infosoft[27];
int iteration;
int w[33][27];
Node node[1000];
Branch branch[2000];
int statecomplex[33];
int lastbranch, lastnode;
int testindex[27];
int oneindex[27]; 
int numoneindex = 0;
int numindex = 0;
int bin[27];
int startnodeindex[33];
int startbranchindex[33];

int main(void)
{
  short int FieldPoly[9];
  time_t now;
  int i,j,k,e;
  double temp;
  int shift;
  int iEBN0;
  long MaxSample,Sample;
  double EbN0,EbN0_dB,sigma;

  fout.open("BTC_ATM.dat");
  srand((unsigned)time(&now));
  cout << setprecision(3);

  //***********************************************************//
  //                   RM(32,26) Generator
  //***********************************************************//

  generateG(ORDER);

  //*********************************************************//
  // Transform the Generator matrix to be in reduced echelon form  
  //*********************************************************//
  MSGM(Gx);

 //***********************************************************//
  //     Minimal Trellis Construction using Massey Algorithm
  //***********************************************************//

  Trellis();

  fout << setprecision(3);
  nzero = (int) (dimfill1*dimfill2)/RM_K;

  for (iEBN0=0;iEBN0<4;iEBN0++)
    {
      Output_EBN0_dB = startEBN0 + iEBN0*SNRincr;
      CodeRate= (float) (RM_K*RM_K-dimfill1*dimfill2) / (float) (RM_N*RM_K+RM_K*(RM_N-RM_K)-dimfill1*RM_N);
      Lc = 4*CodeRate*pow(10.0,Output_EBN0_dB/10.0);
      CodeRate_dB = 10*log(CodeRate)/log(10.0);
      EbN0_dB = Output_EBN0_dB + CodeRate_dB;
      cout  << "EBNO db = " << Output_EBN0_dB << endl;
      fout  << "EBNO db = " << Output_EBN0_dB << endl;
      EbN0 = exp(log(10.0)*(EbN0_dB/10.0));
      sigma = sqrt(1.0/(2.0*EbN0));
      
      cout << "CodeRate = " << CodeRate << endl;
      fout << "CodeRate = " << CodeRate << endl;
      MaxSample = (1+iEBN0)*Numrun;
      
      for(i=0; i < Maxiter; i++)
	{
	  total_errorsarea1[i] = 0;
	  total_errorsarea2[i] = 0;
	}
	

      double TempSoft1[RM_K][RM_N],TempSoft2[RM_K][RM_N];
      double TempReceive[RM_K][RM_N];
      double Softhor[RM_K][RM_K],Softver[RM_K][RM_K];
      
      for(Sample = 0; Sample < MaxSample; Sample++)
	{
	  // Initialization

	  for(i=0; i < RM_K; i++)
	    for(j=0; j < RM_K; j++)
	      {
		prioriprob[i][j] = 0;
		Softhor[i][j] = 0;
		Softver[i][j] = 0;
	      }
	  

	  //***********************************************************//
	  //            Random Data and Channel Encoder 
	  //***********************************************************//
	 
	  get_data(); 

	  //***********************************************************//
	  //                  AWGN Channel
	  //***********************************************************//
	 
	  add_noise(sigma);
	  
	  //***********************************************************//
	  //Set shortened bits to be -2, they are known at the receiver
	  //***********************************************************//
	  int num = 0;
	  for(i=RM_K-1; i >= 0; i--)
	    for(j=0; j < RM_K; j++)
	      if(num < dimfill1*dimfill2)
		{
		  Receive[i][Left[j]] = -2;
		  num++;
		}

	  for(i=RM_K-1; i >= RM_K-nzero; i--)
	    for(j=0; j < RM_N; j++)
	      Receive[i][j] = -2;

	  
	  for(iteration = 0; iteration < Maxiter; iteration++)
	    {
	      
	      for(i=0; i < RM_K; i++)
		Softout(Receive[i],Lc,prioriprob[i],Soft[i],0);

	      for(i=0; i < RM_K; i++)
		for(j=0; j < RM_K; j++)
		  TempSoft1[i][j] = Softhor[j][i] = Soft[j][i];


	      for(i=0; i < RM_K; i++)
		{
		  for(j=0; j < RM_K; j++)
		    TempReceive[i][Left[j]] = Receive[j][Left[i]];
		  
		  for(j=0; j < RM_N-RM_K; j++)
		    TempReceive[i][Parity[j]] = Receive[RM_K+j][Left[i]];
		}

	      for(i=0; i < RM_K; i++)
		Softout(TempReceive[i],Lc,TempSoft1[i],TempSoft2[i],1);
	   

	      for(i=0; i < RM_K; i++)
		for(j=0; j < RM_K; j++)
		  prioriprob[i][j] = Softver[i][j] = TempSoft2[j][i];
	 

	      for(i=0; i < RM_K; i++)
		for(j=0; j < RM_K; j++)
		  FinalSoft[i][j] = Lc*Receive[i][Left[j]] + Softhor[i][j] + Softver[i][j];

	      e = print_e_r();
	    
	    }// end iter
	
	}// end Sample

      total_number_of_data_bits = (1+iEBN0)*Numrun*(RM_K*RM_K-dimfill1*dimfill2);
      cout << "total_bit = " << total_number_of_data_bits << endl;

    
      for (i=0; i < Maxiter; i++)
	{
	  cout << "total_errorsarea1[ " << i << "] = " << total_errorsarea1[i] << endl;
	  cout << "total_errorsarea2[ " << i << "] = " << total_errorsarea2[i] << endl << endl;
	  
	  
	  fout << "total_errorsarea1[ " << i << "] = " << total_errorsarea1[i] << endl;
	  fout << "total_errorsarea2[ " << i << "] = " << total_errorsarea2[i] << endl << endl;
	  
	}
      
      for (i=0;i<=Maxiter;i++) BERarea1[i]=(float)total_errorsarea1[i]/(float)((1+iEBN0)*Numrun*(RM_K/2)*(RM_K-nzero));
      for (i=0;i<=Maxiter;i++) BERarea2[i]=(float)total_errorsarea2[i]/(float)((1+iEBN0)*Numrun*(RM_K*RM_K-dimfill1*dimfill2-(RM_K/2)*(RM_K-nzero)));
      
      for (i=0;i<=Maxiter;i++) BER[i]=(float)(total_errorsarea1[i]+total_errorsarea2[i])/(float)total_number_of_data_bits;
      
      
      for (i=0; i < Maxiter; i++) cout << "BERarea1[" << i << "] = " << BERarea1[i] << "  ";
      cout << endl;
      for (i=0; i < Maxiter; i++) cout << "BERarea2[" << i << "] = " << BERarea2[i] << "  ";
      cout << endl;  
      
      for (i=0; i < Maxiter; i++) cout << "BER[" << i << "] = " << BER[i] << " ";
      cout << endl;
      
   
      for (i=0; i < Maxiter; i++) fout << "BERarea1[" << i << "] = " << BERarea1[i] << " ";
      fout << endl;
      for (i=0; i < Maxiter; i++) fout << "BERarea2[" << i << "] = " << BERarea2[i] << " ";  
      fout << endl;
      
      for (i=0; i < Maxiter; i++) fout << "BER[" << i << "] = " << BER[i] << " ";
      fout << endl;
    
      cout << endl;
      
    }// end iEBN0
  
  fout.close();
}

void get_data(void)
{
  int i,j;
  int temp;
  double u1;
  int iparity = 0;
  int templeft[RM_N];

  for(i=0; i < RM_N; i++)
    templeft[i] = 0;

  for(i=0; i < RM_K; i++)
    templeft[Left[i]] = 1;
  
  for(i=0; i < RM_N; i++)
    {
      if(templeft[i] == 0)
	{
	  Parity[iparity] = i;
	  iparity++;
	} 
    }

  // Random data
  for(i=0; i < RM_K ; i++)
    {
      for(j=0; j < RM_K; j++)
	{
	  temp = rand();
	  u1 = (float) temp;
	  u1 /= RAND_MAX;
	  
	  if(u1 >= 0.5)
	    DIN[i][j] = 1;
	  else
	    DIN[i][j] = 0;
	}
    }

  // Shortening Pattern A
  int num = 0;
  for(i=RM_K-1; i >= 0; i--)
    for(j=0; j < RM_K; j++)
      if(num < dimfill1*dimfill2)
	{
	  DIN[i][j] = 0;
	  num++;
	}

  // Channel Encoder
  for(i=0; i < RM_K; i++)
    RMencoder(Receive[i],DIN[i]);
  
  int Itemp[RM_K][RM_K];
  double Ctemp[RM_K][RM_N];
  
  for(i=0; i < RM_K; i++)
    for(j=0; j < RM_K; j++)
      Itemp[i][j] = DIN[j][i];

  for(i=0; i < RM_K; i++)
    RMencoder(Ctemp[i],Itemp[i]);
  
  for(i=0; i < RM_K; i++)
    for(j=0; j < RM_N-RM_K; j++)
      Receive[RM_K+j][Left[i]] = Ctemp[i][Parity[j]];

}

void add_noise(double sig)
{
  int i, j;
  
  for(i=0; i < RM_K; i++)
    for(j=0; j < RM_N; j++)
      Receive[i][j] = Receive[i][j] + gauss_rv(0.0,sig);
  
  for(i=RM_K; i < RM_N; i++)
    for(j=0; j < RM_K; j++)
      Receive[i][Left[j]] = Receive[i][Left[j]] + gauss_rv(0.0,sig);
  
}

double gauss_rv(double mean, double sigma)
{
  int i1,i2;
  double temp,u1,u2,g1;
  
  i1 = rand();
  u1 = (float)i1;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人免费视频国产在线观看| 日韩在线一二三区| caoporm超碰国产精品| 中文字幕在线不卡国产视频| 97久久精品人人澡人人爽| 中文字幕视频一区| 欧美色综合久久| 精品一区二区免费视频| 国产亚洲va综合人人澡精品| 99精品久久99久久久久| 亚洲综合在线观看视频| 91精品欧美一区二区三区综合在| 久久99热99| 国产精品动漫网站| 欧美日韩综合一区| 国产专区综合网| 亚洲男同性恋视频| 日韩免费看网站| 波多野结衣中文一区| 五月天欧美精品| 久久精品免视看| 欧美三级韩国三级日本一级| 国内成人免费视频| 亚洲黄色尤物视频| 精品不卡在线视频| 色哟哟国产精品| 激情六月婷婷综合| 一区二区免费在线| 日本一区二区三级电影在线观看 | 91精品1区2区| 国产一区二三区| 亚洲图片自拍偷拍| 中文字幕欧美日韩一区| 日韩视频一区二区| 97se亚洲国产综合自在线不卡| 日韩av一区二区三区| 久久综合色之久久综合| 欧美日韩一区二区电影| 成人午夜精品一区二区三区| 国产一区二区美女诱惑| 日韩欧美国产三级电影视频| 亚洲日本免费电影| 久久免费国产精品| 538在线一区二区精品国产| caoporn国产一区二区| 久久国产精品免费| 午夜精品一区在线观看| 国产精品久久毛片| 国产欧美一区二区在线| 久久―日本道色综合久久| 91麻豆福利精品推荐| 国产精品综合一区二区| 久久精品国产在热久久| 亚洲成人激情综合网| 亚洲欧美日韩久久精品| 国产欧美日韩久久| 久久久久久影视| 日韩精品一区二区三区三区免费| 欧美日韩精品一区视频| 91福利视频在线| 91麻豆精品视频| 91亚洲午夜精品久久久久久| 成人av免费观看| 不卡欧美aaaaa| 99国内精品久久| av激情成人网| k8久久久一区二区三区| 成人动漫av在线| 国产99精品国产| 东方aⅴ免费观看久久av| 国产一区二区三区香蕉| 国产乱码字幕精品高清av| 久久精品国产一区二区三| 久色婷婷小香蕉久久| 免费一级欧美片在线观看| 日本中文在线一区| 蓝色福利精品导航| 国产在线精品免费| 国产成人精品免费在线| 高清免费成人av| 一本色道久久综合亚洲91| 91黄色激情网站| 欧美日韩一区精品| 日韩一区二区不卡| 精品入口麻豆88视频| 精品久久久久久最新网址| 久久综合狠狠综合| 国产精品欧美一级免费| 亚洲欧美日本韩国| 婷婷综合另类小说色区| 美女一区二区三区| 国产主播一区二区三区| 不卡的电影网站| 欧美三级电影精品| 精品三级在线观看| 亚洲人成网站精品片在线观看 | 国产精品毛片a∨一区二区三区| 国产精品丝袜久久久久久app| 中文字幕日韩精品一区 | 久久九九国产精品| 中文字幕一区二区三区不卡 | 亚洲男帅同性gay1069| 亚洲aaa精品| 国产精品自拍毛片| 色婷婷激情一区二区三区| 911精品国产一区二区在线| 久久欧美一区二区| 亚洲视频每日更新| 琪琪一区二区三区| 97久久超碰精品国产| 欧美一区二区久久| 日韩一区欧美一区| 免费高清在线一区| 91浏览器在线视频| 精品国精品国产| 亚洲黄色免费网站| 国产精品一区二区视频| 欧美色偷偷大香| 欧美国产一区二区| 日本vs亚洲vs韩国一区三区二区| 国产91精品免费| 91精品国产综合久久久久久久久久 | 欧美日韩不卡在线| 日本一区二区高清| 日本最新不卡在线| 91黄色小视频| 国产精品久久久久天堂| 裸体在线国模精品偷拍| 91久久精品一区二区三区| 久久久久9999亚洲精品| 首页综合国产亚洲丝袜| 91老司机福利 在线| 久久久久久9999| 奇米精品一区二区三区在线观看| 99久久伊人久久99| 国产午夜精品久久久久久久| 免费看欧美女人艹b| 欧美日韩卡一卡二| 亚洲日本中文字幕区| 丁香啪啪综合成人亚洲小说 | 制服丝袜成人动漫| 亚洲欧美日韩国产另类专区| 国产福利一区二区三区视频 | 全部av―极品视觉盛宴亚洲| 色婷婷国产精品综合在线观看| 国产亚洲精品资源在线26u| 麻豆国产精品777777在线| 在线综合视频播放| 亚洲风情在线资源站| 色综合天天综合给合国产| 国产女主播视频一区二区| 国产精品一区二区三区99| 欧美成人a∨高清免费观看| 日韩精品亚洲一区| 88在线观看91蜜桃国自产| 亚洲3atv精品一区二区三区| 色女孩综合影院| 亚洲精品国产一区二区精华液 | 一本色道综合亚洲| 亚洲欧洲成人精品av97| 99久久精品国产一区| 国产精品私人自拍| 成人综合婷婷国产精品久久免费| 久久久91精品国产一区二区精品| 久久99精品一区二区三区| 欧美精品一区在线观看| 国产毛片精品视频| 国产精品网站一区| 不卡的av电影| 亚洲黄色av一区| 欧美区一区二区三区| 美国十次了思思久久精品导航| 欧美大胆人体bbbb| 国产精一品亚洲二区在线视频| 欧美国产激情一区二区三区蜜月| va亚洲va日韩不卡在线观看| 亚洲欧美另类小说视频| 在线日韩一区二区| 日韩av二区在线播放| 欧美精品一区二区三区蜜臀| 国产91高潮流白浆在线麻豆 | 亚洲大片在线观看| 欧美一三区三区四区免费在线看| 日韩—二三区免费观看av| 欧美精品一区二区三区在线 | 色噜噜狠狠色综合中国| 亚洲mv在线观看| 精品久久久久香蕉网| 成人免费观看男女羞羞视频| 亚洲黄色av一区| 精品久久国产字幕高潮| 成人少妇影院yyyy| 亚洲国产你懂的| 亚洲精品一区二区三区99| 99精品国产热久久91蜜凸| 日本在线播放一区二区三区| 久久久久9999亚洲精品| 欧美性猛交xxxx黑人交| 国模少妇一区二区三区| 亚洲精品乱码久久久久|