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

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

?? rs.c

?? RS(15,9)上的C語言糾錯源碼.在VC++6.0平臺上調試通過
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*             rs.c        */ 
/* This program is an encoder/decoder for Reed-Solomon codes. Encoding is in 
 
   systematic form, decoding via the Berlekamp iterative algorithm. 
   In the present form , the constants mm, nn, tt, and kk=nn-2tt must be 
   specified  (the double letters are used simply to avoid clashes with 
   other n,k,t used in other programs into which this was incorporated!) 
   Also, the irreducible polynomial used to generate GF(2**mm) must also be 
   entered -- these can be found in Lin and Costello, and also Clark and Cai 
n. 
   The representation of the elements of GF(2**m) is either in index form, 
   where the number is the power of the primitive element alpha, which is 
   convenient for multiplication (add the powers modulo 2**m-1) or in 
   polynomial form, where the bits represent the coefficients of the 
   polynomial representation of the number, which is the most convenient for 
m 
   for addition.  The two forms are swapped between via lookup tables. 
   This leads to fairly messy looking expressions, but unfortunately, there 
   is no easy alternative when working with Galois arithmetic. 
   The code is not written in the most elegant way, but to the best 
   of my knowledge, (no absolute guarantees!), it works. 
   However, when including it into a simulation program, you may want to do 
   some conversion of global variables (used here because I am lazy!) to 
   local variables where appropriate, and passing parameters (eg array 
   addresses) to the functions  may be a sensible move to reduce the number 
   of global variables and thus decrease the chance of a bug being introduce 
d. 
   This program does not handle erasures at present, but should not be hard 
   to adapt to do this, as it is just an adjustment to the Berlekamp-Massey 
   algorithm. It also does not attempt to decode past the BCH bound -- see 
   Blahut "Theory and practice of error control codes" for how to do this. 
              Simon Rockliff, University of Adelaide   21/9/89 
   26/6/91 Slight modifications to remove a compiler dependent bug which had 
n't 
           previously surfaced. A few extra comments added for clarity. 
           Appears to all work fine, ready for posting to net! 
                  Notice 
                 -------- 
   This program may be freely modified and/or given to whoever wants it. 
   A condition of such distribution is that the author's contribution be 
   acknowledged by his name being left in the comments heading the program, 
   however no responsibility is accepted for any financial or other loss whi 
ch 
   may result from some unforseen errors or malfunctioning of the program 
   during use. 
                                 Simon Rockliff, 26th June 1991 
*/ 
#include <math.h> 
#include <stdio.h> 

#define mm  4           /* RS code over GF(2**4) - change to suit */ 
#define nn  15          /* nn=2**mm -1   length of codeword */ 
#define tt  3           /* number of errors that can be corrected */ 
#define kk  9           /* kk = nn-2*tt  */ 
int pp [mm+1] = { 1, 1, 0, 0, 1} ; /* specify irreducible polynomial coeffts */ 
// The G(x)	=	x^4  + x  + 1 

//#define mm  3           /* RS code over GF(2**4) - change to suit */ 
//#define nn  7         /* nn=2**mm -1   length of codeword */ 
//#define tt  2          /* number of errors that can be corrected */ 
//#define kk  3           /* kk = nn-2*tt  */ 
//int pp [mm+1] = { 1, 1, 0, 1} ; /* specify irreducible polynomial coeffts */ 



int alpha_to [nn+1], index_of [nn+1], gg [nn-kk+1] ; 
int recd [nn], data [kk], bb [nn-kk] ; 
void generate_gf() 
/* generate GF(2**mm) from the irreducible polynomial p(X) in pp[0]..pp[mm] 
   lookup tables:  index->polynomial form   alpha_to[] contains j=alpha**i; 
                   polynomial form -> index form  index_of[j=alpha**i] = i 
   alpha=2 is the primitive element of GF(2**mm) 
*/ 
 { 
   register int i, mask ; 
  mask = 1 ; 
  alpha_to[mm] = 0 ; 
  for (i=0; i<mm; i++) 
  { 
	 alpha_to[i] = mask ; 
     index_of[alpha_to[i]] = i ; 
     if (pp[i]!=0) 
	 {
       alpha_to[mm] ^= mask ; 
	 }
     mask <<= 1 ; 
  } 
  index_of[alpha_to[mm]] = mm ; 
  mask >>= 1 ; 
  for (i=mm+1; i<nn; i++) 
  { 
	  if (alpha_to[i-1] >= mask) 
	  {
        alpha_to[i] = alpha_to[mm] ^ ((alpha_to[i-1]^mask)<<1) ; 
	  }
      else
	  {
		  alpha_to[i] = alpha_to[i-1]<<1 ; 
	  }
     index_of[alpha_to[i]] = i ; 
  } 
  index_of[0] = -1 ; 
  for(i=0;i<5;i++)printf("gf%d is : %d\n",i,alpha_to[i]); 
 } 
void gen_poly() 
/* Obtain the generator polynomial of the tt-error correcting, length 
  nn=(2**mm -1) Reed Solomon code  from the product of (X+alpha**i), i=1..2* tt 
*/ 
 { 
   register int i,j ; 
   gg[0] = 2 ;    /* primitive element alpha = 2  for GF(2**mm)  */ 
   gg[1] = 1 ;    /* g(x) = (X+alpha) initially */  
   for (i=2; i<=nn-kk; i++) 
   {
	   gg[i] = 1 ; 
	   for (j=i-1; j>0; j--) 
	   {
			if (gg[j] != 0) 
			{
				gg[j] = gg[j-1]^ alpha_to[(index_of[gg[j]]+i)%nn] ; 
			} 
			else
			{
				gg[j] = gg[j-1] ; 
			}
	   }
       gg[0] = alpha_to[(index_of[gg[0]]+i)%nn] ;     /* gg[0] can never be z ero */ 
   } 
   /* convert gg[] to index form for quicker encoding */ 
   for (i=0; i<=nn-kk; i++)  gg[i] = index_of[gg[i]] ; 
 } 
void encode_rs() 
/* take the string of symbols in data[i], i=0..(k-1) and encode systematically 
   to produce 2*tt parity symbols in bb[0]..bb[2*tt-1] 
   data[] is input and bb[] is output in polynomial form. 
   Encoding is done by using a feedback shift register with appropriate 
   connections specified by the elements of gg[], which was generated above. 
   Codeword is   c(X) = data(X)*X**(nn-kk)+ b(X) 
*/ 
{ 
   register int i,j ; 
   int feedback ; 
   for (i=0; i<nn-kk; i++)   
   {
	   bb[i] = 0 ; 
   }
   for (i=kk-1; i>=0; i--) 
   {  
	   feedback = index_of[data[i]^bb[nn-kk-1]] ; 
       if (feedback != -1) 
       { 
		   for (j=nn-kk-1; j>0; j--) 
		   {
				if (gg[j] != -1) 
				{
					bb[j] = bb[j-1]^alpha_to[(gg[j]+feedback)%nn] ; 
				}
				else 
				{
					bb[j] = bb[j-1] ; 
				}
		   }
           bb[0] = alpha_to[(gg[0]+feedback)%nn] ; 
       } 
       else 
       {
		   for (j=nn-kk-1; j>0; j--) 
		   {
				bb[j] = bb[j-1] ; 
		   }
           bb[0] = 0 ; 
       } 
   }  
}  
void decode_rs() 
/* assume we have received bits grouped into mm-bit symbols in recd[i], 
   i=0..(nn-1),  and recd[i] is index form (ie as powers of alpha). 
   We first compute the 2*tt syndromes by substituting alpha**i into rec(X)  
and 
   evaluating, storing the syndromes in s[i], i=1..2tt (leave s[0] zero) . 
   Then we use the Berlekamp iteration to find the error location polynomial 
 
   elp[i].   If the degree of the elp is >tt, we cannot correct all the erro 
rs 
   and hence just put out the information symbols uncorrected. If the degree 
 of 
   elp is <=tt, we substitute alpha**i , i=1..n into the elp to get the root 
s, 
   hence the inverse roots, the error location numbers. If the number of err 
ors 
   located does not equal the degree of the elp, we have more than tt errors 
 
   and cannot correct them.  Otherwise, we then solve for the error value at 
 
   the error location and correct the error.  The procedure is that found in 
 
   Lin and Costello. For the cases where the number of errors is known to be 
 too 
   large to correct, the information symbols as received are output (the 
   advantage of systematic encoding is that hopefully some of the informatio 
n 
   symbols will be okay and that if we are in luck, the errors are in the 
   parity part of the transmitted codeword).  Of course, these insoluble cas 
es 
   can be returned as error flags to the calling routine if desired. 
*/ 
 { 
   register int i,j,u,q ; 
   int elp[nn-kk+2][nn-kk], d[nn-kk+2], l[nn-kk+2], u_lu[nn-kk+2], s[nn-kk+1 ] ; 
   int count=0, syn_error=0, root[tt], loc[tt], z[tt+1], err[nn], reg[tt+1]  ; 
/* first form the syndromes */ 
   for (i=1; i<=nn-kk; i++) 
    { 
	   s[i] = 0 ; 
       for (j=0; j<nn; j++) 
	   {
			if (recd[j]!=-1) 
			{
				s[i] ^= alpha_to[(recd[j]+i*j)%nn] ;      /* recd[j] in index form */ 
			}
	   }
/* convert syndrome from polynomial form to index form  */ 
      if (s[i]!=0) 
	  {
		  syn_error=1 ;        /* set flag if non-zero syndrome => error */ 
	  }
      s[i] = index_of[s[i]] ; 
    } /////////; 
   if (syn_error)       /* if errors, try and correct */ 
    { 
/* compute the error location polynomial via the Berlekamp iterative algorithm, 
   following the terminology of Lin and Costello :   d[u] is the 'mu'th 
   discrepancy, where u='mu'+1 and 'mu' (the Greek letter!) is the step number 
   ranging from -1 to 2*tt (see L&C),  l[u] is the 
   degree of the elp at that step, and u_l[u] is the difference between the 
   step number and the degree of the elp. */ 
/* initialise table entries */ 
      d[0] = 0 ;           /* index form */ 
      d[1] = s[1] ;        /* index form */ 
      elp[0][0] = 0 ;      /* index form */ 
      elp[1][0] = 1 ;      /* polynomial form */ 
      for (i=1; i<nn-kk; i++) 
      { elp[0][i] = -1 ;   /* index form */ 
          elp[1][i] = 0 ;   /* polynomial form */ 
      } 
      l[0] = 0 ; 
      l[1] = 0 ; 
      u_lu[0] = -1 ; 
      u_lu[1] = 0 ; 
      u = 0 ; 
      do 
      { 
        u++ ; 
        if (d[u]==-1) 
        { 
			l[u+1] = l[u] ; 
            for (i=0; i<=l[u]; i++) 
             { 
					elp[u+1][i] = elp[u][i] ; 
					elp[u][i] = index_of[elp[u][i]] ; 
             } 
        } 
        else 
/* search for words with greatest u_lu[q] for which d[q]!=0 */ 
        { 
			q = u-1 ; 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久久久久久久久久久99| 色av成人天堂桃色av| 99在线精品观看| 激情深爱一区二区| 国产区在线观看成人精品| 日韩免费观看高清完整版在线观看| 男人操女人的视频在线观看欧美 | 国产一区二区三区不卡在线观看| 久久婷婷成人综合色| 高清国产午夜精品久久久久久| 麻豆国产精品视频| 中文字幕亚洲精品在线观看| 精品视频一区三区九区| 欧美午夜电影网| 亚洲综合自拍偷拍| 亚洲欧美日韩成人高清在线一区| 欧美在线观看你懂的| 日韩伦理免费电影| 日韩va欧美va亚洲va久久| 亚洲欧美色综合| 亚洲男同性视频| 亚洲乱码国产乱码精品精的特点| 欧美精品一区二区三区蜜臀| 懂色av中文字幕一区二区三区| 色综合欧美在线| 日韩激情一二三区| 亚洲欧美日韩国产另类专区 | 欧美日韩欧美一区二区| 欧美一卡二卡在线观看| 久久久不卡影院| 一区二区三区中文免费| 蜜桃视频在线观看一区| 国产91精品一区二区麻豆亚洲| 91视视频在线直接观看在线看网页在线看| 99精品久久99久久久久| 在线91免费看| 国产精品久久久久aaaa樱花| 亚洲国产视频直播| 国产剧情一区二区| 欧美色综合天天久久综合精品| 日韩美一区二区三区| 亚洲视频小说图片| 卡一卡二国产精品 | 中文字幕一区视频| 日本欧美一区二区三区| 99精品久久只有精品| 精品国精品国产尤物美女| 亚洲精品伦理在线| 国产福利视频一区二区三区| 51精品国自产在线| 亚洲欧美视频一区| 成人免费电影视频| 精品国免费一区二区三区| 亚洲高清视频中文字幕| 不卡在线观看av| 久久久久久一级片| 免费成人美女在线观看.| 色天天综合色天天久久| 久久精品欧美一区二区三区不卡| 日日噜噜夜夜狠狠视频欧美人| 99久久综合色| 中文字幕精品—区二区四季| 久久99久久久欧美国产| 在线不卡一区二区| 午夜久久久久久电影| 欧美日韩一区二区三区视频| 亚洲欧美日韩电影| 93久久精品日日躁夜夜躁欧美| 国产欧美日韩三级| 东方aⅴ免费观看久久av| 久久综合久久综合九色| 国内成人自拍视频| 久久综合久久久久88| 国产麻豆成人精品| 国产视频911| 国产成人免费视频网站高清观看视频 | 成人欧美一区二区三区白人| 懂色一区二区三区免费观看| 国产人伦精品一区二区| 成人动漫一区二区| 国产精品美女久久久久高潮| 91麻豆蜜桃一区二区三区| 亚洲精品第一国产综合野| 在线精品观看国产| 性久久久久久久久| 日韩一二三区视频| 国产精品一区二区x88av| 久久久久久久精| 不卡的av电影| 一区二区三区四区不卡在线| 欧美三级中文字| 久久精品久久久精品美女| 欧美哺乳videos| 国产成人免费视频精品含羞草妖精| 久久久久久一级片| 在线看国产一区| 精品一区二区在线视频| 中文字幕av一区二区三区| 色老头久久综合| 免费的成人av| 国产精品亲子伦对白| 欧美性欧美巨大黑白大战| 久久国产三级精品| 国产精品进线69影院| 在线视频综合导航| 久久精品国产99国产| 亚洲欧洲韩国日本视频| 欧美精品久久一区二区三区| 国产资源精品在线观看| 亚洲日本中文字幕区| 日韩免费观看2025年上映的电影| 成人av电影在线观看| 日韩国产精品大片| 中文字幕一区二区日韩精品绯色| 欧美日韩大陆一区二区| 高清不卡一二三区| 日韩电影在线观看网站| 国产精品网站在线观看| 6080日韩午夜伦伦午夜伦| eeuss鲁片一区二区三区 | 韩国精品久久久| 一区二区欧美国产| 日本一区二区免费在线 | 国产亚洲一区二区三区四区 | 日韩国产欧美在线观看| 国产精品视频免费| 欧美不卡一区二区三区| 欧美性做爰猛烈叫床潮| voyeur盗摄精品| 国产乱人伦精品一区二区在线观看| 亚洲综合在线观看视频| 国产精品私人影院| 久久亚洲影视婷婷| 日韩一区二区三| 欧美精品777| 欧美系列一区二区| 99麻豆久久久国产精品免费优播| 精品在线亚洲视频| 青青草伊人久久| 日本怡春院一区二区| 一级精品视频在线观看宜春院| 国产精品视频你懂的| 国产欧美一区二区三区在线老狼| 欧美xfplay| 精品国产乱码久久久久久牛牛| 欧美伦理电影网| 欧美日韩电影在线播放| 欧美妇女性影城| 欧美日韩电影在线| 91精品国产一区二区三区| 在线播放中文字幕一区| 欧美日韩高清一区二区不卡| 欧美日韩国产首页在线观看| 欧美午夜精品一区二区三区| 欧美亚洲一区三区| 欧美性猛片aaaaaaa做受| 欧美在线不卡视频| 在线电影院国产精品| 884aa四虎影成人精品一区| 欧美丰满少妇xxxxx高潮对白| 精品视频一区二区三区免费| 欧美一区二区不卡视频| 日韩一二三四区| 国产色产综合色产在线视频| 日本一区二区三区免费乱视频 | 日韩精品在线网站| 337p日本欧洲亚洲大胆色噜噜| 久久久精品2019中文字幕之3| 国产网站一区二区| ...中文天堂在线一区| 亚洲欧美电影院| 日欧美一区二区| 国产一区啦啦啦在线观看| 粉嫩绯色av一区二区在线观看| 91日韩在线专区| 欧美一区二区视频在线观看| 精品国产乱码久久久久久浪潮 | 菠萝蜜视频在线观看一区| 在线视频综合导航| 日韩精品一区二区三区swag| 国产日韩欧美不卡在线| 一区二区三区加勒比av| 韩国成人福利片在线播放| 成人精品免费网站| 欧美日本在线播放| 久久精品视频免费观看| 亚洲女与黑人做爰| 乱一区二区av| 色偷偷久久人人79超碰人人澡| 欧美一区二区三区视频在线观看| 日本一区二区三区在线观看| 五月婷婷欧美视频| 成人av综合在线| 日韩写真欧美这视频| 中文字幕在线观看不卡视频| 美女脱光内衣内裤视频久久影院| 成人av动漫网站| 亚洲精品一区二区三区精华液| 亚洲最大成人网4388xx| 粉嫩久久99精品久久久久久夜|