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

📄 test_interleavers.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 inter and intraframe interleavers. | 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"#include "interleaver.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 interleaved_data[2000];    double interleaved_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;    int frame_len;    double max_match_ratio;    short int crc_value;    int crc_bits[16];    test_inp_size = 48;    max_match_ratio = 0.2;    size_with_crc = test_inp_size + 16;    matched_block_size = 22;    frame_len = 16;    for (i=0; i < test_inp_size; i++) {        test_input[i] = i;    }    wcdma_crctable_init (ARIB_CRC16);#if 0    crc_value = wcdma_get_crc_value(test_input, test_inp_size, crc_bits);#endif    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("\nInterframe interleaving input block %d to target block.\n",           size_with_crc);    wcdma_interframe_interleaver(size_with_crc, frame_len,                                 tx_block_with_crc, interleaved_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 < size_with_crc; i++) {        printf("%d ", interleaved_data[i]);     }    printf("\n");    printf("\nInterframe deinterleaving input block %d to original order.\n",            size_with_crc);     for (i=0; i < size_with_crc; i++) {        interleaved_double_data[i] = (double)interleaved_data[i];    }    wcdma_interframe_double_deinterleaver(size_with_crc, frame_len,                                        interleaved_double_data,                                        rx_doubleblock_with_crc);    printf("\nCompare input and output for interframe deinterleaving:\n");    for (i=0; i < size_with_crc; i++) {        printf("%g ", interleaved_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];    }#if 0    wcdma_get_crc_value(rx_intblock_with_crc, size_with_crc, crc_bits);#endif    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 + -