get_ovsf_code.c

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

C
84
字号
/* | Project:     WCDMA simulation environment | Module:     | Author:      Maarit Melvasalo | Date:        June 1999 | | History: |              June 11,  1999 Maarit Melvasalo  |               | | Desc:          |              This is a matlab function which return  |              a OVSF code for given code length and code index.  | | Limitations: |              Code length must be in between 2^2 ... 2^8 |              The index must be greater tahn 0 and less or equal |              to code length       |         | Depends on files: |              code.c  and code.h      |      |  Function call:  |           [code, side_info] = get_ovsf_code(code_length, index) |          |           side_info[0] = code_length  |           side_info[1] = code index          | | See also function: get_ovsf_code_indexes | | 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. | */#include "mex.h"void mexFunction(		 int nlhs, mxArray *plhs[], 		 int nrhs, 		 const mxArray *prhs[]){  int code_len,tmp, index ;  double *code, *side;  int *code_tmp;  /*  get the scalar input x */  code_len = (int)mxGetScalar(prhs[0]);  index = (int)mxGetScalar(prhs[1]);      /* Create a matrix for the return argument */  plhs[0] = mxCreateDoubleMatrix(1, code_len, mxREAL);/**/  plhs[1] = mxCreateDoubleMatrix(1, 2, mxREAL);/**/    code = mxGetPr(plhs[0]);  side = mxGetPr(plhs[1]);  tmp =  wcdma_get_ovsf_code_double(code_len,index,code);/**/  side[0] = code_len;  side[1] = index;return;}/* [EOF] complex.c */

⌨️ 快捷键说明

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