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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tcc_binary_unix.c

?? This CD-ROM is distributed by Kluwer Academic Publishers with ABSOLUTELY NO SUPPORT and NO WARRANTY
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* Turbo code Test Driver: log_map, random interleaver *//* Creation date : Jan.3 2001     *//* Program written by: Gao yingzi *//* This program simulates the classical turbo encoding-decoding system *//* It uses parallel concatenated convolutional codes described in Figure 2.9 in Chapter 2. *//* Two component RSC (Recursive Systematic Convolutional) encoders are used.               *//* First encoder is terminated with tails bits. (Info + tail) bits are scrambled and       *//* passed to the second encoder, while second encoder is left open without tail bits.      *//* Random information bits are modulated into +1/-1, and transmitted through an AWGN channel. *//* Interleavers are randomly generated for each frame. *//* Log-MAP algorithm without quantization or approximation is used. *//* By making use of ln(e^x+e^y) = max (x,y) + ln(1+e^(-abs(x-y))),  *//* the Log-MAP is simplified with a look-up table for the correction term. *//* When the approximation ln(e^x+e^y) = max (x,y) is, we have MAX-Log-MAP. *//* To set the number of iterations, change the globle variable "DECITER". To set the frame length,   *//* the globle variable "FRAMESIZE" should be changed. To simulate a different range of Eb/N0, change *//* the globle variable LOEBNO and HIEBNO, as well as the step size of Eb/No increment. */#include <malloc.h>#include <math.h>#include <stdio.h>#include <stdlib.h>#include <time.h>#define K 3              /* constraint length */#define NUMSTATES 4      /* 2^(K - 1) -- change as required */#define PUNCTURE 1       /* rate increase from 1/3 to 1/2 if puncture=0 */#define INF 1000000      /* set infinity to an arbitrarily large value */ #define PI 3.141592654   /* circumference of circle divided by diameter */#define FRAMESIZE 900    /* how many bits in each test message */#define DECITER 6        /* decoding iteration numbers */ #define LOEBN0 0.0       /* minimum Eb/No at which to test */#define HIEBN0 3.0       /* maximum Eb/No at which to test */#define EBN0STEP 0.5     /* Eb/No increment for test driver *///#define DEBUG            /* test the outputs of the trellis function */void gen01dat(int data_len, int *out_array);void turbo_encd(int g[2][K], int alpha[FRAMESIZE], int *in_array, int puncture, int *turbo_en_out);void addnoise(float eb_ovr_n0, int data_len, int *in_array, float *out_array);void de_multiplex(int alpha[FRAMESIZE], int puncture, float *in_array,			 float *decd1_in_array, float *decd2_in_array);void logmap(int g[2][K], int len_total, int num_decd, float *rec_s, float *L_a, float *L_u);main() {  int i, j, a, iter, t, start;                /* loop variables */  int len_total, msg_length, channel_length;  /* length of I/O files */  int puncture, num_decd;  int alpha[FRAMESIZE] = {0};      /* random interleaver matric */  int *onezer;  int *encoded;                    /* original, encoded array */  float *splusn;                   /* noisy data array */  float *rec_s1;  float *rec_s2;  float *L_a;  float *L_e_1;  float *L_e_2;  float *L_u;  float *L_all;  int *turbout;  FILE *fp;  int m, dec_iter;                 /* m = K - 1,turbo decoding iteration */  float eb_ovr_n0,rate,L_c,bit_errors,temp_bit_errors,frame_errors,e_threshold,e_ber,f_ber; /* various statistics */  int g[2][K] = {{1, 1, 1},     /* 7 */                   {1, 0, 1}};    /* 5 */  fp = fopen("TCC_Binary_UNIX_data","wa+");  if ((fp = fopen("TCC_Binary_UNIX_data","wa+"))==NULL){    printf("cannot open file\n");    exit (0);  }  printf("\ng1 = %d%d%d", g[0][0], g[0][1], g[0][2] );  printf("\ng2 = %d%d%d\n", g[1][0], g[1][1], g[1][2] );  fprintf(fp,"\ng1 = %d%d%d", g[0][0], g[0][1], g[0][2] );  fprintf(fp,"\ng2 = %d%d%d\n", g[1][0], g[1][1], g[1][2] );  puncture = PUNCTURE;  rate = (float) 1.0/(2.0 + PUNCTURE);  a = 1;  m = K - 1;  msg_length = FRAMESIZE - m;  len_total = FRAMESIZE;  for (i=0; i<len_total; i++){    alpha[i] = rand() % len_total;    if (i>0) {      for (j=0; j<i; j++)	if(alpha[i] == alpha[j]) i = i-1;    }  }  printf("\nK = %d  puncture = %d  message length = %d\n", K, puncture, msg_length);  fprintf(fp,"\nK = %d  puncture = %d  message length = %d\n", K, puncture, msg_length);  if (puncture > 0) channel_length = ( msg_length + m ) * 3;  else channel_length = ( msg_length + m ) * 2;  onezer = malloc( msg_length * sizeof( int ) );  if (onezer == NULL) {     printf("\n TCC_Binary_UNIX.c:  error allocating onezer array, aborting!");        exit(1);  }  encoded = malloc( channel_length * sizeof(int) );  if (encoded == NULL) {     printf("\n TCC_Binary_UNIX.c:  error allocating encoded array, aborting!");     exit(1);  }  splusn = malloc( channel_length * sizeof(float) );  if (splusn == NULL) {      printf("\n TCC_Binary_UNIX.c:  error allocating splusn array, aborting!");      exit(1);  }  rec_s1 = malloc( channel_length * sizeof( float ) );  if (rec_s1 == NULL) {      printf("\n TCC_Binary_UNIX.c:  error allocating received symbol 1 array, aborting!");      exit(1);  }  rec_s2 = malloc( channel_length * sizeof( float ) );  if (rec_s2 == NULL) {      printf("\n TCC_Binary_UNIX.c:  error allocating received symbol 2 array, aborting!");      exit(1);  }  L_a = malloc( len_total * sizeof( float ) );  if (L_a == NULL) {      printf("\n TCC_Binary_UNIX.c:  error allocating L_a array, aborting!");      exit(1);  }  L_e_1 = malloc( len_total * sizeof( float ) );  if (L_e_1 == NULL) {      printf("\n TCC_Binary_UNIX.c:  error allocating L_e_1 array, aborting!");      exit(1);  }  L_e_2 = malloc( len_total * sizeof( float ) );  if (L_e_2 == NULL) {      printf("\n TCC_Binary_UNIX.c:  error allocating L_e_2 array, aborting!");      exit(1);  }  L_u = malloc( len_total * sizeof( float ) );  if (L_u == NULL) {      printf("\n TCC_Binary_UNIX.c:  error allocating L_u array, aborting!");      exit(1);  }  L_all = malloc( len_total * sizeof( float ) );  if (L_all == NULL) {      printf("\n TCC_Binary_UNIX.c:  error allocating L_all array, aborting!");      exit(1);  }  turbout = malloc( msg_length * sizeof( int ) );  if (turbout == NULL) {      printf("\n TCC_Binary_UNIX.c:  error allocating turbo decoding out array, aborting!");      exit(1);  }  for (eb_ovr_n0 = LOEBN0; eb_ovr_n0 <= HIEBN0; eb_ovr_n0 += EBN0STEP) {    start = time(NULL);    L_c = 4 * a * rate * pow(10,eb_ovr_n0/10);      printf("\nreliability = %f",L_c);    fprintf(fp,"\nStart:Reliability = %f",L_c);    printf("   channel length = %d", channel_length);    fprintf(fp,"   channel length = %d", channel_length);    bit_errors = 0.0;    frame_errors = 0.0;    e_ber = 0.0;    f_ber = 0.0;    iter = 0;    if (eb_ovr_n0 <= 3.5) e_threshold = 100; /* +/- 20% */    else e_threshold = 20;                   /* +/- 100 % */    while (bit_errors < e_threshold) {       iter += 1;       gen01dat(msg_length, onezer);       turbo_encd(g, alpha, onezer, puncture, encoded);       addnoise(eb_ovr_n0, channel_length, encoded, splusn);       de_multiplex(alpha, puncture, splusn, rec_s1, rec_s2);       for (i=0; i<2*len_total; i++){ 	 *(rec_s1+i) = 0.5*L_c**(rec_s1+i);	 *(rec_s2+i) = 0.5*L_c**(rec_s2+i);       }          for (i=0; i<len_total; i++){         *(L_a+i) = 0;         *(L_e_1+i) = 0;         *(L_e_2+i) = 0;         *(L_u+i) = 0;       }       for (dec_iter = 0; dec_iter < DECITER; dec_iter++){	 for (i=0; i<len_total; i++)	   *(L_a + alpha[i]) = *(L_e_1 + i);		 num_decd = 1;              /* Decoder one */ 	 logmap(g, len_total, num_decd, rec_s1, L_a, L_u); 	 num_decd = 2;              /* Decoder two */          for (i=0; i<len_total; i++)            *(L_e_2+i) = *(L_u+i) - 2**(rec_s1+2*i) - *(L_a+i);	 for (i=0; i<len_total; i++)	   *(L_a + i) = *(L_e_2 + alpha[i]);	 logmap(g, len_total, num_decd, rec_s2, L_a, L_u);                   for (i=0; i<len_total; i++){            *(L_e_1+i) = *(L_u+i) - 2**(rec_s2+2*i) - *(L_a+i);	 }       }       for (i=0; i<len_total; i++)	 *(L_all + alpha[i]) = *(L_u + i);       for (j=0; j<msg_length; j++){	 if (*(L_all+j)>0.0) *(turbout+j) = 1;	 else *(turbout+j) = 0;       }       temp_bit_errors = bit_errors;          for (t = 0; t < msg_length; t++) {          if ( *(onezer + t) != *(turbout + t) ) {             bit_errors = bit_errors + 1;          } /* end if */       } /* end t for-loop */       if ((bit_errors - temp_bit_errors) > 0) frame_errors = frame_errors + 1;    }    e_ber = bit_errors / (msg_length * iter);    f_ber = frame_errors / iter;    printf("\nframe errors=%f",frame_errors);    printf("\nThe elapsed time was %d seconds for %d frames:  dec_iter=%d",                   time(NULL) - start, iter, dec_iter);    fprintf(fp,"\nThe elapsed time was %d seconds for %d frames:  dec_iter%d",                   time(NULL) - start, iter, dec_iter);    printf("\nAt %1.1fdB Eb/No, ", eb_ovr_n0);    fprintf(fp,"\nAt %1.1fdB Eb/No, ", eb_ovr_n0);    printf("the e_ber was %1.1e the f_ber was %1.1e \n ", e_ber, f_ber);    fprintf(fp,"the e_ber was %1.1e the f_ber was %1.1e\n ", e_ber, f_ber);  } /* end of eb_ovr_n0 loop */  fclose (fp);  free(onezer);  free(encoded);  free(splusn);  free(rec_s1);  free(rec_s2);  free(L_a);  free(L_e_1);  free(L_e_2);  free(L_u);  free(L_all);  free(turbout);  exit(0);}/*******************//* 0/1 Generation  *//*******************/void gen01dat( int data_len, int *out_array ) {  int t;                          /* time */  rand();                         /* re-seed the random number generator */  for (t = 0; t < data_len; t++)  /* generate random data, write to output array */    *( out_array + t ) = (int)( rand() / (RAND_MAX / 2) > 0.5 );}/***************************//* PCCC Turbo code encoder *//***************************/void rsc_encd(int g[2][K], int input_len, int R, int *in_array, int *out_array_0, int *out_array);void turbo_encd( int g[2][K], int alpha[FRAMESIZE], int *in_array, int puncture, int *turbo_en_out){  int i,j,t,tt;                         /* loop variables */  int R;                                /* RSC encoder number */  int yy[3][FRAMESIZE],y[3*FRAMESIZE];  /* make a matrix to store the output */  int *output0,*output1,*output2;  int *rsc2_in_array,*info_array,*unuse;  int m,input_len,len_total;  m = K-1;  len_total = FRAMESIZE;  input_len = len_total-m;  info_array = malloc((input_len)*sizeof(int));  if (info_array == NULL) {     printf("\n turbo_encd:  error allocating info array, aborting!");     exit(1);    }  output0 = malloc((len_total)*sizeof(int));  if (output0 == NULL) {     printf("\n turbo_encd:  error allocating tail_RSC1 output array, aborting!");     exit(1);  }  output1 = malloc((len_total)*sizeof(int));  if (output1 == NULL) {     printf("\n turbo_encd:  error allocating RSC1 output array, aborting!");     exit(1);  }  rsc2_in_array = malloc((len_total)*sizeof(int));  if (rsc2_in_array == NULL) {     printf("\n turbo_encd:  error allocating RSC2 input array, aborting!");     exit(1);  }  unuse = malloc((len_total+m)*sizeof(int));  if (unuse == NULL) {     printf("\n turbo_encd:  error allocating RSC2 useless output array, aborting!");     exit(1);  }  output2 = malloc((len_total+m)*sizeof(int));  if (output2 == NULL) {     printf("\n turbo_encd:  error allocating RSC2 output array, aborting!");     exit(1);  }  for (i=0; i<input_len; i++)    *(info_array + i) = *(in_array + i);  R = 1;  rsc_encd(g, input_len, R, info_array, output0, output1);  /* make a matrix with first row corresponding to info sequence */  /* second row corresponding to RSC #1 s check/parity bits */  /* third row corresponding to RSC #2 s check/parity bits */  for (i=0; i<len_total; i++){    yy[0][i] = *(output0 + i);    yy[1][i] = *(output1 + i);  }  for (i=0; i<len_total; i++)    *(rsc2_in_array + i) = *(output0 + alpha[i]);  R != 1;  rsc_encd(g, len_total, R, rsc2_in_array, unuse, output2);   for (i=0; i<len_total; i++){    yy[2][i] = *(output2 + i);  }	 /* Paralell to serial multiplex to get output vector */  if (puncture > 0){                   /* puncture = 1: unpunctured, rate = 1/3 */    for (i=0; i<len_total; i++){      for (j=0; j<3; j++)	y[3*i+j] = yy[j][i];    }    for (t=0; t<3*len_total; t++)      *(turbo_en_out + t) = y[t];  }  else {                               /* puncture = 0: rate increase from 1/3 to 1/2 */    for (i=0; i<len_total; i++){      y[2*i] = yy[0][i];      if (i%2==0) y[2*i+1] = yy[1][i]; /* even check bits from rsc1 */      else y[2*i+1] = yy[2][i];        /* odd check bits from rsc2 */    }    for (tt=0; tt<2*len_total; tt++)      *(turbo_en_out + tt) = y[tt];  }  free(info_array);  free(output0);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕一区二区三区不卡 | 人人狠狠综合久久亚洲| 欧美日韩一区二区三区高清| 丝袜美腿亚洲一区| 精品日韩一区二区三区| 国产福利电影一区二区三区| 中文字幕一区二区三区色视频| 91久久精品一区二区三区| 亚洲综合视频网| 日韩一区二区三区观看| 国产黄色精品网站| 中文字幕一区在线| 在线影视一区二区三区| 日本欧美肥老太交大片| 国产午夜精品久久久久久免费视| www.亚洲免费av| 亚洲午夜av在线| 精品国产在天天线2019| 成人av电影在线| 亚洲国产一区二区a毛片| 精品国产一区二区精华 | 国产一区二区0| 亚洲色图在线看| 制服丝袜国产精品| 国产黄色91视频| 亚洲一区二区三区美女| 欧美xxxxxxxx| 99国产精品国产精品毛片| 三级欧美在线一区| 国产欧美一区二区三区鸳鸯浴| 一本色道**综合亚洲精品蜜桃冫| 另类人妖一区二区av| 国产精品视频第一区| 欧美日韩国产精选| 懂色av一区二区三区蜜臀| 亚洲国产精品一区二区www| 2023国产精品视频| 在线一区二区三区做爰视频网站| 捆绑紧缚一区二区三区视频| 日韩一区欧美一区| 日韩欧美123| 91国偷自产一区二区开放时间 | 日韩精品一区二区三区视频播放 | 日本欧美韩国一区三区| 国产精品久久久久久久久果冻传媒| 欧美午夜影院一区| 成人在线综合网站| 日韩电影在线免费| 亚洲少妇屁股交4| 精品国产麻豆免费人成网站| 色老汉一区二区三区| 国产综合色产在线精品| 亚洲永久免费视频| 国产日韩精品一区二区浪潮av| 欧美日韩成人一区二区| av激情成人网| 国内偷窥港台综合视频在线播放| 亚洲图片欧美一区| 国产精品区一区二区三| 日韩欧美国产麻豆| 欧美性生活大片视频| 成人高清av在线| 精品一区二区三区在线播放视频| 伊人色综合久久天天人手人婷| 国产日韩综合av| 欧美sm美女调教| 精品污污网站免费看| www.成人在线| 国产精品综合二区| 人人爽香蕉精品| 午夜视频一区在线观看| 亚洲视频你懂的| 国产日韩欧美激情| 久久综合色综合88| 8x8x8国产精品| 91福利国产精品| 99r国产精品| 成人国产精品免费观看视频| 国产米奇在线777精品观看| 日韩高清不卡一区| 午夜精品一区二区三区三上悠亚| 亚洲免费在线视频| 国产精品久久久久久亚洲伦| 久久亚洲捆绑美女| 日韩欧美一区二区视频| 欧美酷刑日本凌虐凌虐| 色婷婷综合久久久中文一区二区 | 国产精品热久久久久夜色精品三区| 精品日韩99亚洲| 制服丝袜亚洲网站| 欧美精品丝袜久久久中文字幕| 91久久线看在观草草青青| 99精品国产一区二区三区不卡| 国产盗摄视频一区二区三区| 国产精品主播直播| 国内精品不卡在线| 国产在线视频一区二区三区| 免费不卡在线视频| 毛片不卡一区二区| 免费看欧美美女黄的网站| 日韩影院在线观看| 婷婷开心激情综合| 午夜亚洲福利老司机| 亚洲亚洲精品在线观看| 亚洲一区二区中文在线| 一区二区三区蜜桃| 亚洲午夜免费电影| 亚洲国产成人91porn| 亚洲一区二区三区在线看| 亚洲综合av网| 一区二区激情视频| 亚洲免费av观看| 亚洲美女免费在线| 亚洲第一狼人社区| 天堂在线亚洲视频| 日本欧美在线观看| 久久成人18免费观看| 激情欧美一区二区三区在线观看| 理论片日本一区| 国产精品一色哟哟哟| 国产成人av一区二区三区在线 | 91免费版pro下载短视频| 91网站最新地址| 欧亚洲嫩模精品一区三区| 欧美性受xxxx| 欧美一区二区三区免费视频| 精品久久久网站| 国产日韩欧美激情| 中文字幕亚洲成人| 亚洲已满18点击进入久久| 亚洲一区二区三区四区在线观看| 日韩影院在线观看| 国产在线精品一区二区| 成人免费观看av| 色婷婷精品久久二区二区蜜臀av| 欧美性xxxxxxxx| 欧美成va人片在线观看| 中文一区在线播放| 亚洲精品一卡二卡| 婷婷夜色潮精品综合在线| 激情欧美日韩一区二区| 成人激情免费视频| 91福利视频在线| 日韩欧美国产高清| 国产精品久久网站| 亚洲福利视频一区二区| 久久精品国产精品亚洲精品| 国产suv一区二区三区88区| 色哟哟一区二区在线观看| 3atv一区二区三区| 国产午夜三级一区二区三| 亚洲精品久久嫩草网站秘色| 免费在线观看成人| 成人黄色软件下载| 在线播放中文一区| 国产日产欧美一区二区视频| 一区二区三区在线视频播放| 免费观看在线色综合| 成人午夜精品一区二区三区| 在线免费精品视频| 26uuuu精品一区二区| 亚洲天堂免费在线观看视频| 日韩vs国产vs欧美| 成人丝袜视频网| 欧美日本在线看| 欧美国产一区二区| 午夜电影久久久| 丁香六月久久综合狠狠色| 欧美三级日本三级少妇99| 久久久精品影视| 亚洲国产精品一区二区久久| 国产99久久久精品| 欧美日韩高清一区二区| 国产欧美一区二区精品性色 | a4yy欧美一区二区三区| 欧美一区二区三区影视| 国产精品美日韩| 丝袜亚洲另类丝袜在线| www.欧美精品一二区| 日韩一级片网站| 亚洲欧美日韩国产手机在线 | 久久青草欧美一区二区三区| 亚洲综合激情网| 成人免费av在线| 欧美一区二区视频网站| 亚洲精品欧美激情| 国产馆精品极品| 欧美一区二区三区四区久久| 亚洲视频免费观看| 国产麻豆欧美日韩一区| 欧美日韩一区二区在线观看| 欧美国产丝袜视频| 精品一区二区三区欧美| 欧美色图激情小说| 中文字幕亚洲区| 国产不卡视频在线播放| 欧美一区二区三区性视频| 亚洲一级二级在线| www.亚洲免费av| 国产三级久久久|