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

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

?? golay23.c

?? golay code in mat lab programme
?? C
字號:
/* File:    golay23.c * Title:   Encoder/decoder for a binary (23,12,7) Golay code * Author:  Robert Morelos-Zaragoza (robert@spectra.eng.hawaii.edu) * Date:    August 1994 * * The binary (23,12,7) Golay code is an example of a perfect code, that is, * the number of syndromes equals the number of correctable error patterns. * The minimum distance is 7, so all error patterns of Hamming weight up to * 3 can be corrected. The total number of these error patterns is: * *       Number of errors         Number of patterns *       ----------------         ------------------ *              0                         1 *              1                        23 *              2                       253 *              3                      1771 *                                     ---- *    Total number of error patterns = 2048 = 2^{11} = number of syndromes *                                               -- *                number of redundant bits -------^ * * Because of its relatively low length (23), dimension (12) and number of * redundant bits (11), the binary (23,12,7) Golay code can be encoded and * decoded simply by using look-up tables. The program below uses a 16K  * encoding table and an 8K decoding table. *  * For more information, suggestions, or other ideas on implementing error * correcting codes, please contact me at (I'm temporarily in Japan, but * below is my U.S. address): * *                    Robert Morelos-Zaragoza *                    770 S. Post Oak Ln. #200 *                      Houston, Texas 77056 * *             email: robert@spectra.eng.hawaii.edu * *       Homework: Add an overall parity-check bit to get the (24,12,8) *                 extended Golay code. * * COPYRIGHT NOTICE: This computer program is free for non-commercial purposes. * You may implement this program for any non-commercial application. You may  * also implement this program for commercial purposes, provided that you * obtain my written permission. Any modification of this program is covered * by this copyright. * * ==   Copyright (c) 1994  Robert Morelos-Zaragoza. All rights reserved.   == */#include <stdio.h>#define X22             0x00400000   /* vector representation of X^{22} */#define X11             0x00000800   /* vector representation of X^{11} */#define MASK12          0xfffff800   /* auxiliary vector for testing */#define GENPOL          0x00000c75   /* generator polinomial, g(x) *//* Global variables: * * pattern = error pattern, or information, or received vector * encoding_table[] = encoding table * decoding_table[] = decoding table * data = information bits, i(x) * codeword = code bits = x^{11}i(x) + (x^{11}i(x) mod g(x)) * numerr = number of errors = Hamming weight of error polynomial e(x) * position[] = error positions in the vector representation of e(x) * recd = representation of corrupted received polynomial r(x) = c(x) + e(x) * decerror = number of decoding errors * a[] = auxiliary array to generate correctable error patterns */long pattern;long encoding_table[4096], decoding_table[2048];long data, codeword, recd;long position[23] = { 0x00000001, 0x00000002, 0x00000004, 0x00000008,                      0x00000010, 0x00000020, 0x00000040, 0x00000080,                      0x00000100, 0x00000200, 0x00000400, 0x00000800,                      0x00001000, 0x00002000, 0x00004000, 0x00008000,                      0x00010000, 0x00020000, 0x00040000, 0x00080000,                      0x00100000, 0x00200000, 0x00400000 };long numerr, errpos[23], decerror = 0;int a[4];long arr2int(a,r)/* * Convert a binary vector of Hamming weight r, and nonzero positions in * array a[1]...a[r], to a long integer \sum_{i=1}^r 2^{a[i]-1}. */int r;int *a;{   int i;   long mul, result = 0, temp;    for (i=1; i<=r; i++) {      mul = 1;      temp = a[i]-1;      while (temp--)         mul = mul << 1;      result += mul;      }   return(result);}void nextcomb(n, r, a)/* * Calculate next r-combination of an n-set. */int  n, r;int  *a;{  int  i, j;   a[r]++;  if (a[r] <= n)      return;  j = r - 1;  while (a[j] == n - r + j)     j--;  for (i = r; i >= j; i--)      a[i] = a[j] + i - j + 1;  return;}long get_syndrome(pattern)/* * Compute the syndrome corresponding to the given pattern, i.e., the * remainder after dividing the pattern (when considering it as the vector * representation of a polynomial) by the generator polynomial, GENPOL. * In the program this pattern has several meanings: (1) pattern = infomation * bits, when constructing the encoding table; (2) pattern = error pattern, * when constructing the decoding table; and (3) pattern = received vector, to * obtain its syndrome in decoding. */long pattern;{    long aux = X22, aux2;     if (pattern >= X11)       while (pattern & MASK12) {           while (!(aux & pattern))              aux = aux >> 1;           pattern ^= (aux/X11) * GENPOL;           }    return(pattern);}main(){   register int i,j;   long temp;   int seed = 133757;   /*    * ---------------------------------------------------------------------    *                  Generate ENCODING TABLE    *    * An entry to the table is an information vector, a 32-bit integer,    * whose 12 least significant positions are the information bits. The    * resulting value is a codeword in the (23,12,7) Golay code: A 32-bit    * integer whose 23 least significant bits are coded bits: Of these, the    * 12 most significant bits are information bits and the 11 least    * significant bits are redundant bits (systematic encoding).    * ---------------------------------------------------------------------     */    for (pattern = 0; pattern < 4096; pattern++) {        temp = pattern << 11;          /* multiply information by X^{11} */        encoding_table[pattern] = temp + get_syndrome(temp);/* add redundancy */        }   /*    * ---------------------------------------------------------------------    *                  Generate DECODING TABLE    *    * An entry to the decoding table is a syndrome and the resulting value    * is the most likely error pattern. First an error pattern is generated.    * Then its syndrome is calculated and used as a pointer to the table    * where the error pattern value is stored.    * ---------------------------------------------------------------------     *                * (1) Error patterns of WEIGHT 1 (SINGLE ERRORS)    */    decoding_table[0] = 0;    decoding_table[1] = 1;    temp = 1;     for (i=2; i<= 23; i++) {        temp *= 2;        decoding_table[get_syndrome(temp)] = temp;        }   /*                * (2) Error patterns of WEIGHT 2 (DOUBLE ERRORS)    */    a[1] = 1; a[2] = 2;    temp = arr2int(a,2);    decoding_table[get_syndrome(temp)] = temp;    for (i=1; i<253; i++) {        nextcomb(23,2,a);        temp = arr2int(a,2);        decoding_table[get_syndrome(temp)] = temp;        }   /*                * (3) Error patterns of WEIGHT 3 (TRIPLE ERRORS)    */    a[1] = 1; a[2] = 2; a[3] = 3;    temp = arr2int(a,3);    decoding_table[get_syndrome(temp)] = temp;    for (i=1; i<1771; i++) {        nextcomb(23,3,a);        temp = arr2int(a,3);        decoding_table[get_syndrome(temp)] = temp;        }   /* ---------------------------------------------------------------------    *                        Generate DATA    * ---------------------------------------------------------------------    */    srandom(seed);    /*     * data = 12 information bits, an information polynomial i(x)     */    data = random() & 0x00000fff;    printf("data =            %#012x\n", data);   /*    * ---------------------------------------------------------------------    *                         ENCODING    * ---------------------------------------------------------------------    */    codeword = encoding_table[data];    printf("codeword =        %#012x\n", codeword);   /*    * ---------------------------------------------------------------------    *                          ERRORS    * ---------------------------------------------------------------------    */    printf("Enter the number of errors and their positions (0...22): ");    scanf("%d", &numerr);    for (i = 0; i < numerr; i++)        scanf("%d", &errpos[i]);   /*    * ---------------------------------------------------------------------    *                      RECEIVED VECTOR    * ---------------------------------------------------------------------    */    recd = codeword;    if (numerr)        for (i = 0; i < numerr; i++)            recd ^= position[errpos[i]];    printf("received vector = %#012x\n", recd);   /*    * ---------------------------------------------------------------------    *                         DECODING    * ---------------------------------------------------------------------    */    printf("syndrome =        %#012x\n", get_syndrome(recd));    printf("error pattern =   %#012x\n", decoding_table[get_syndrome(recd)]);   /*    * Calculate the syndrome, look up the corresponding error pattern and    * add it to the received vector.    */    recd ^= decoding_table[get_syndrome(recd)];    printf("decoded vector =  %#012x\n", recd);    printf("recovered data =  %#012x\n", (recd>>11));    printf("original data  =  %#012x\n", data);   /*    * DECODING ERRORS? Only the data portion is compared. Note that this    * is only possible in a simulation!    */    pattern = (recd ^ codeword) >> 11;    for (i=0; i<12; i++)       if (pattern&position[i])          decerror++;    printf("there were %d decoding errors\n", decerror);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91亚洲精品乱码久久久久久蜜桃| 国产精品第五页| 欧美成人综合网站| 亚洲情趣在线观看| 久久成人综合网| 欧美午夜影院一区| 2020国产成人综合网| 亚洲一级不卡视频| 99精品欧美一区| 国产片一区二区三区| 久久机这里只有精品| 欧美性色欧美a在线播放| 亚洲欧美自拍偷拍色图| 国产一区二区三区精品欧美日韩一区二区三区 | 欧美日韩一本到| 国产精品午夜电影| 国精产品一区一区三区mba桃花| 天天综合日日夜夜精品| 91麻豆自制传媒国产之光| 精品国产欧美一区二区| 美女性感视频久久| 欧美日本高清视频在线观看| 亚洲小说欧美激情另类| 91国偷自产一区二区开放时间 | 欧美性受xxxx黑人xyx性爽| 亚洲精品在线一区二区| 老司机午夜精品| 日韩一级免费一区| 日韩国产欧美三级| 91麻豆精品国产91久久久久久久久| 亚洲精品在线一区二区| 国内精品在线播放| 久久蜜桃av一区二区天堂| 蜜桃视频在线观看一区| 日韩精品一区二区三区四区| 免费视频一区二区| wwww国产精品欧美| 国产成人8x视频一区二区| 中文字幕va一区二区三区| 成人综合婷婷国产精品久久 | 国产精品无遮挡| 成人精品国产福利| 国产精品色眯眯| 91久久奴性调教| 五月综合激情婷婷六月色窝| 欧美一级久久久久久久大片| 韩国成人精品a∨在线观看| 精品国产乱子伦一区| 成人小视频免费观看| 亚洲视频一区在线观看| 欧美日韩中文字幕一区二区| 日本亚洲视频在线| 久久久久国产精品麻豆| 不卡一区二区中文字幕| 亚洲一区二区3| 精品国产污污免费网站入口| 风间由美中文字幕在线看视频国产欧美 | 国产成人综合亚洲网站| 亚洲日本在线天堂| 欧美精品亚洲二区| 激情另类小说区图片区视频区| 欧美日韩一区二区三区四区| 蜜桃精品在线观看| 欧美激情一区二区在线| 欧美午夜影院一区| 国产美女视频91| 亚洲欧美日韩在线播放| 欧美成人vps| 91在线视频观看| 麻豆精品视频在线| 亚洲精品少妇30p| 日韩精品在线一区二区| 91在线视频观看| 久久99这里只有精品| 亚洲精品国产第一综合99久久| 成人免费va视频| 婷婷丁香久久五月婷婷| 国产精品天美传媒沈樵| 51精品久久久久久久蜜臀| 成人黄色免费短视频| 久久国产精品99精品国产| 国产精品第13页| 欧美精品一区男女天堂| 欧美日韩一区 二区 三区 久久精品| 亚洲一区电影777| 中文天堂在线一区| 欧美成人精品高清在线播放 | 日韩一级高清毛片| 成人国产精品免费观看视频| 理论片日本一区| 日日夜夜一区二区| 亚洲男同性视频| 国产精品视频第一区| 精品999久久久| 337p亚洲精品色噜噜| 色婷婷综合久久久久中文| 国产91露脸合集magnet| 精品一区二区三区在线观看| 亚洲成人激情社区| 亚洲女同一区二区| 亚洲欧美日韩国产另类专区| 欧美激情中文字幕一区二区| 2023国产一二三区日本精品2022| 成人免费看视频| 欧美视频在线一区| 国产1区2区3区精品美女| 精品在线播放午夜| 美女诱惑一区二区| 日韩高清欧美激情| 婷婷开心久久网| 图片区小说区区亚洲影院| 亚欧色一区w666天堂| 亚洲高清视频的网址| 亚洲一二三四久久| 亚洲一区二区视频| 亚洲成av人片观看| 青青青爽久久午夜综合久久午夜 | 欧美一区二区三区男人的天堂| 捆绑调教美女网站视频一区| 亚洲福利视频一区| 亚洲成人动漫在线免费观看| 亚洲线精品一区二区三区八戒| 精品国产一区二区精华| 精品免费日韩av| 国产精品视频线看| 亚洲精品视频自拍| 视频一区视频二区中文| 久久国产欧美日韩精品| 国产成人精品网址| 99re在线精品| 欧美放荡的少妇| 久久伊人蜜桃av一区二区| 久久久午夜精品理论片中文字幕| 欧美性xxxxx极品少妇| 欧美丰满一区二区免费视频| 精品久久久久久久久久久久久久久久久| 国产ts人妖一区二区| 成人一区二区在线观看| 91国产免费观看| 欧美一区二区成人6969| 国产三级精品三级在线专区| 国产精品国产三级国产三级人妇| 欧美一级免费大片| 亚洲精品一区二区三区福利| 国产精品第五页| 日韩电影在线免费看| 九九九精品视频| 99r国产精品| 欧美成人官网二区| 日韩伦理av电影| 免费观看一级特黄欧美大片| 国产xxx精品视频大全| 欧美三级日韩三级| 久久久www免费人成精品| 一区二区成人在线视频| 国产一区二区三区观看| 欧美少妇性性性| 久久色在线观看| 亚洲第一福利一区| 国产99久久久久| 这里只有精品视频在线观看| 国产精品天美传媒沈樵| 久久国内精品自在自线400部| 污片在线观看一区二区| 成人黄色片在线观看| 制服丝袜亚洲播放| 亚洲欧美日韩精品久久久久| 国产成人一级电影| 欧美精品色一区二区三区| 国产精品电影院| 久久se这里有精品| 欧美精品视频www在线观看 | 久久精品视频网| 同产精品九九九| 91精品办公室少妇高潮对白| 精品国产乱码久久久久久浪潮 | 欧美日韩小视频| 中文字幕精品三区| 狠狠色狠狠色综合| 日韩视频一区二区| 亚洲成国产人片在线观看| 99视频精品在线| 国产精品久久久久久久久动漫 | 国产精品免费视频网站| 老司机精品视频一区二区三区| 久久精品国产一区二区三| 91精品办公室少妇高潮对白| 亚洲国产精品成人久久综合一区| 中文字幕日韩一区| 成人av午夜电影| 国产精品久久免费看| 久久精品国产一区二区| 日韩精品一区二区三区视频在线观看| 精品成人一区二区三区四区| 香蕉av福利精品导航| 欧美日韩国产成人在线91| 天堂成人免费av电影一区| 欧美亚日韩国产aⅴ精品中极品| 欧美成人精精品一区二区频| 精品一区二区三区视频|