⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test_ratematching.c

📁 这是一个c++编写的WCDMA链路采用RAKE接收的方针源代码
💻 C
字号:
/* | | Copyright disclaimer: |   This software was developed at the National Institute of Standards |   and Technology by employees of the Federal Government in the course |   of their official duties. Pursuant to title 17 Section 105 of the |   United States Code this software is not subject to copyright |   protection and is in the public domain. | |   We would appreciate acknowledgement if the software is used. |*//* | Project:     WCDMA simulation environment | Module:      Test bed for rate matching algortihms. | Author:      Tommi Makelainen, Nokia/NIST | Date:        June 19, 1999 | | History: |              June 19, 1999 Tommi Makelainen |                      Initial version. | */#include <stdio.h>#include <math.h>#include "crc_routines.h"#include "sratematch.h"#define INPUT_SIZE 200#define ARIB_CRC16 0x1021#define CRC_LEN 16int tc_block_sizes[] = {60, 100, 120, 200};int main(int argc, char *argv[]){    int i, j, output_size, output_data[200];    int test_input[8];    int test_input2[2000];    int rmatched_data[2000];    double rmatched_double_data[2000];    int tx_block_with_crc[2000];    double rx_doubleblock_with_crc[2000];    int rx_intblock_with_crc[2000];    int test_inp_size;    int size_with_crc;    int matched_block_size;    double max_match_ratio;    short int crc_value;    int crc_bits[16];    test_inp_size = 8;    max_match_ratio = 0.2;    size_with_crc = test_inp_size + 16;    matched_block_size = 22;    for (i=0; i < test_inp_size; i++) {        test_input[i] = i % 2;    }    wcdma_crctable_init (ARIB_CRC16);    crc_value = wcdma_get_crc_value(test_input, test_inp_size, crc_bits);    printf("\nCRC value %x\n", crc_value);    for (i=0; i < test_inp_size; i++) {        tx_block_with_crc[i] = test_input[i];    }    for (i=test_inp_size, j=0; i < size_with_crc; i++, j++) {        tx_block_with_crc[i] = crc_bits[j];    }    printf("\nRate matching input block %d to target block %d.\n",           size_with_crc, matched_block_size);    wcdma_rate_match(0, tx_block_with_crc, size_with_crc,                     max_match_ratio, matched_block_size, rmatched_data);    printf("\nCompare input and output for rate matching:\n");    for (i=0; i < size_with_crc; i++) {        printf("%d ", tx_block_with_crc[i]);     }    printf("\n");    for (i=0; i < matched_block_size; i++) {        printf("%d ", rmatched_data[i]);     }    printf("\n");    printf("\nRate dematching input block %d to original size %d.\n",            matched_block_size, size_with_crc);     for (i=0; i < matched_block_size; i++) {        rmatched_double_data[i] = (double)rmatched_data[i];    }    wcdma_rate_dematch(0, rmatched_double_data,                       matched_block_size, max_match_ratio,                       size_with_crc, rx_doubleblock_with_crc);    printf("\nCompare input and output for rate dematching:\n");    for (i=0; i < matched_block_size; i++) {        printf("%g ", rmatched_double_data[i]);     }    printf("\n");    for (i=0; i < size_with_crc; i++) {        printf("%g ", rx_doubleblock_with_crc[i]);     }    printf("\n");    for (i=0; i < size_with_crc; i++) {        rx_intblock_with_crc[i] = rx_doubleblock_with_crc[i];    }    wcdma_get_crc_value(rx_intblock_with_crc, size_with_crc, crc_bits);    printf("\nCRC bits in decoding: ");    for (i=0; i < 16; i++) {        printf("%x ", crc_bits[i]);    }    printf("\n\n");    return;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -