discmod.c

来自「matlab实现wcdma的全过程」· C语言 代码 · 共 105 行

C
105
字号
/* | | 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:      Discrete CDMA downlink modulation containing QPSK data  |		and spreading modulation. | Author:      Tommi Makelainen, Nokia/NIST | Date:        February 22, 1999 | | History: |              February 22, 1999 Tommi Makelainen |                      Initial version. | */#include <stdio.h>#include <math.h>#include "conversions.h"#include "bitroutines.h"#include "config_wcdma.h"#include "mealy.h"#include "spreading.h"#include "qpsk_ints.h"#include "discmod.h"/* ------------------------------------------------------------------- *//* * Function:    wcdma_mod_init * Desc.:       Discrete data and spreading modulation initialization. * * Note: */int wcdma_mod_init(void){    /*     * Allocated memory for temporary outputs.     */    return(0);}/* -------------------------------------------------------------------- *//* * Function:    wcdma_dl_mod * Desc.:       Data and spreading modulation * * Note: *		Input data length can be maximum of 2000 coded bits. */int wcdma_dl_mod(int inputs[],	/* input bit vector */                       int nInputs,	/* input vector size */                       int code[],      /* spreading code */                       int code_len,	/* length of spreading code */                       int sf,		/* spreadign factor */                       int I_out[],	/* modulated I output */                       int Q_out[])	/* modulated Q output */{    int mod_data_len;    int I_data_mod[2000], Q_data_mod[2000];    int I_mod_antipodal[2000], Q_mod_antipodal[2000];    wcdma_dl_qpsk_mod(inputs, nInputs, I_data_mod,                      Q_data_mod, &mod_data_len);    bin2antipodal(I_data_mod, nInputs/2, I_mod_antipodal);    wcdma_spread(I_mod_antipodal, nInputs/2, code, code_len, sf, I_out);    bin2antipodal(Q_data_mod, nInputs/2, Q_mod_antipodal);    wcdma_spread(Q_mod_antipodal, nInputs/2, code, code_len, sf, Q_out);    return(0);}/* -------------------------------------------------------------------- *//* * Function:    wcdma_dl_mod_free * Desc.:       Discrete modulation clean up function. * * Note: */int wcdma_dl_mod_free(void){    return(0);}/* -------------------------------------------------------------------- */

⌨️ 快捷键说明

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