📄 build_slot.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: Frame building for transport channels. | Author: Tommi Makelainen, Nokia Research Center/NIST | Date: May 18, 1999 | | History: | May 18, 1999 Tommi Makelainen | Initial version. | */#include <stdio.h>#include <stdlib.h>#include <math.h>#include "config_wcdma.h"/* ------------ S T A T I C D A T A S T R U C T U R E S ----------- */static enum instance_state rake_alloc_list[MAX_RAKES];static rake_instance_count = 0;static int init_flags[MAX_RAKES] = { TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE };double path_select_level[MAX_RAKES] = { 0 };static finger_type stored_fingers[MAX_RAKES][MAX_FINGERS];static mem_chips_t old_chips[MAX_RAKES];static rake_data_type rake_data[MAX_RAKES];static finger_count[MAX_RAKES];static int general_init_flag = FALSE;/* -------------------------------------------------------------------- *//* * Function: wcdma_dl_frame_build * Desc.: Build downlink frame for primary and secondary * common control physical channel and dedicated * physical channel. The former carries BCCH, * PCH and FACH. The latter carries dedicated traffic. * * Returns: none * * Note: * If any of fields below is 0 bits, the field is omitted. * */int wcdma_dl_frame_build( int nPilotBits, /* IN: number of pilot bits */ int nTPCBits, /* IN: number of power control bits */ int nTFIBits, /* IN: number of transport format bits */ int nDataBits) /* IN: number of data bits */{ int i, instance; return(instance);}/* -------------------------------------------------------------------- *//* * Function: wcdma_slot_build * Desc.: Build a slot with selected fields. * * Returns: none * * Note: * If any of fields below is 0 bits, the field is omitted. * Maximum length of output buffer is MAX_SLOT_LEN. * */int wcdma_slot_build( int nPilotBits, /* IN: number of pilot bits */ int pilot[], /* IN: pilot bit vector */ int nTPCBits, /* IN: number of power control bits */ int tpc[], /* IN: transmission power control bits */ int nTFIBits, /* IN: number of transport format bits */ int tfi[], /* IN: transport format indicator bits */ int nDataBits, /* IN: number of data bits */ int data[], /* IN: data bits */ int *nOutBits, /* OUT: number of output bits */ int outData[]) /* OUT: combined slot */{ int offset; offset = 0; memcpy(outData, pilot, nPilotBits * sizeof(int) ); offset += nPilotBits; memcpy(outData+offset, tpc, nTPCBits * sizeof(int) ); offset += nTPCBits; memcpy(outData+offset, tfi, nTFIBits * sizeof(int) ); offset += nTFIBits; memcpy(outData+offset, data, nDataBits * sizeof(int) ); offset += nDataBits; *nOutBits = offset; return(0);}/* -------------------------------------------------------------------- *//* * Function: wcdma_slot_extract * Desc.: Extract fields out of a slot. * * Returns: none * * Note: * If any of fields below is 0 bits, the field is omitted. * Maximum length of input buffer is MAX_SLOT_LEN. * */int wcdma_slot_extract( int nInBits, /* IN: number of input soft bits */ double inData[], /* IN: combined slot */ int nPilotBits, /* IN: number of pilot bits */ double pilot[], /* OUT: pilot bit vector */ int nTPCBits, /* IN: number of power control bits */ double tpc[], /* OUT: transmission power control bits */ int nTFIBits, /* IN: number of transport format bits */ double tfi[], /* OUT: transport format indicator bits */ int nDataBits, /* IN: number of data bits */ double outData[]) /* OUT: data bits */{ int offset; offset = 0; memcpy(pilot, inData, nPilotBits * sizeof(double) ); offset += nPilotBits; memcpy(tpc, inData+offset, nTPCBits * sizeof(double) ); offset += nTPCBits; memcpy(tfi, inData+offset, nTFIBits * sizeof(double) ); offset += nTFIBits; memcpy(outData, inData+offset, nDataBits * sizeof(double) ); offset += nDataBits; return(0);}/* ------------------------------------------------------------------- */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -