WCDMA_simulation_c_program

  • e3_491232
    了解作者
  • 53.9KB
    文件大小
  • 文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-23 11:50
    上传日期
WCDMA_simulation_c_program,是用C语言编写的WCDMA程序,非常有价值.
18194403WCDMA_simulation_c_program.rar
  • 255430
  • wcdma_ccode
  • get_ovsf_code_indexes.c
    1.8KB
  • bitroutines.h
    1.5KB
  • s_chcoding.c
    7.9KB
  • qpsk.c
    2.9KB
  • errormsg.c
    706B
  • interleaver.h
    4.3KB
  • test_crc16.c
    2KB
  • sratematch.c
    15.8KB
  • s_dl_discmod.c
    6.1KB
  • convdec.h
    2.4KB
  • chcoding.c
    8.4KB
  • s_deinterleaver.c
    6.4KB
  • c_testbed2.c
    5.5KB
  • s_channel.c
    9.6KB
  • errormsg.h
    550B
  • s_spreading.c
    5KB
  • c_testbed.c
    5.6KB
  • utility.h
    639B
  • s_conv_detection.c
    4.9KB
  • convdec.c
    16.6KB
  • dl_dch.c
    10.6KB
  • mealy.c
    6.6KB
  • spreading.h
    1.2KB
  • s_buffer.c
    4.4KB
  • test_interleavers.c
    3.5KB
  • conversions.h
    1.5KB
  • discmod.c
    2.7KB
  • interleaver.c
    16.2KB
  • test_channel.c
    2.8KB
  • channel_real_input.c
    24.1KB
  • test_blockinterleaver.c
    951B
  • bitroutines.c
    1.8KB
  • code.h
    1.7KB
  • conversions.c
    1.7KB
  • blockcollect.c
    6.2KB
  • c_code.c
    1.1KB
  • s_channel_estimator.c
    4.3KB
  • make_ratematch_test
    183B
  • build_slot.c
    5KB
  • s_chdecoding.c
    8.1KB
  • sratematch.h
    2.4KB
  • utility.c
    1.4KB
  • s_derate.c
    3.9KB
  • crc_routines.c
    3.4KB
  • control_bits.c
    1.1KB
  • rake.h
    6.9KB
  • get_ovsf_code.c
    1.9KB
  • discdemod.c
    3KB
  • discdemod.h
    2KB
  • qpsk.h
    1.8KB
  • qpsk_ints.h
    1.7KB
  • spreading.c
    6KB
  • convenc.c
    5.8KB
  • s_resize.c
    4.1KB
  • make_interleaver_test
    100B
  • misdefs.h
    614B
  • s_hard_decission.c
    3KB
  • s_dl_demod_buffer.c
    6.3KB
  • chdecoding.h
    2.9KB
  • s_intra_interleaver.c
    5.9KB
  • s_rake.c
    6.9KB
  • blockcollect.h
    2.4KB
  • test_symbolbuffer.c
    1013B
  • test_txrx_statchan.c
    8.3KB
  • test_ratematching.c
    3.4KB
  • s_ber_direct.c
    4.2KB
  • s_frame_buffer.c
    5.3KB
  • code.c
    13KB
  • config_wcdma.h
    3.8KB
  • s_rate.c
    3.6KB
  • make_txrx_test
    193B
  • qpsk_ints.c
    2.6KB
  • discmod.h
    1.9KB
  • chcoding.h
    3.9KB
  • rake_supp.c
    15.5KB
  • make_crc_test
    71B
  • s_mod_plain.c
    3.6KB
  • channel.c
    23.2KB
  • channel.h
    8.8KB
  • testsymbolbuffer.c
    1013B
  • test_conv1o2.c
    3.6KB
  • s_ber_calc.c
    4.6KB
  • make_conv1o2_test
    473B
  • rake.c
    8.4KB
  • dl_pri_ccpch.c
    10.6KB
  • metrics.c
    10.8KB
  • chdecoding.c
    10.3KB
  • convenc.h
    1.6KB
  • wcdma_simulink.h
    849B
  • s_crc_remove.c
    5.7KB
  • s_pulse_shaping.c
    3.6KB
  • metrics.h
    2.4KB
  • s_interleaver.c
    6.2KB
  • s_crc_add.c
    5KB
  • crc_routines.h
    1.5KB
  • test_chcoding.c
    4.5KB
  • mealy.h
    1.8KB
  • s_intra_deinterleaver.c
    6.6KB
内容介绍
/* | Project: WCDMA simulation environment | Module: | Author: Maarit Melvasalo | Date: February 1999 | | History: | March 18, 1999 Maarit Melvasalo | Channel memory vector changed to mode were | several different vectors can be memorized | | May 3, 1999 Maarit Melvasalo | Channel model changed | June 16, 1999 Maarit Melvasalo | Documentation added and cleaning up the code | | 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. | /* * Static data structures. */ #include <stdlib.h> #include <math.h> #include <stdio.h> #include "config_wcdma.h" #include "channel.h" #ifndef TRUE #define TRUE 1 #define FALSE 0 #endif /* TRUE */ /* Channel matrix to keep in memory the channel impulses (both amplitudes and delays and their changes) and previous chips etc /**/ static channel_matrix_double channel_data_double[MAX_CHANNELS]; /* List that keeps record which channel instances are used /**/ static enum instance_state channel_alloc_list_double[MAX_CHANNELS] ; /* General initialization flag /**/ static int general_channel_init_flag_double = FALSE; /* Total number of occupied channels/**/ static int channel_index_double = 0; /* -------------------------------------------------------------------- */ /* * Function: wcdma_channel_init * Desc.: Channel initialization * Allocates memory for the chips that effect the future call time inputs * * Return: instance number or -1 if all instances are already occupied. * * Note: */ /* -------------------------------------------------------------------- */ int wcdma_channel_init_double( double channel_impulse[], /* IN: Channel impulse vector*/ int channel_delays[],/* IN: Delay taps */ int nTaps, /* IN: channel impulse vector size */ int nImpulse, /* IN: number of channel impulse vectors */ double impulse_prob[],/* IN: Channel impulse vector probabilities*/ int steps, /* IN: Total number of frames send during ssim/**/ double esno, /* IN: SNR/**/ double power, /* IN: Power/**/ int nCode /* IN: Length of the spreading code/**/ ){ int i,j,instance,n_intervals,delay_diff; /* * If first call, initialize static data. */ if (general_channel_init_flag_double == FALSE) { for (i=0; i < MAX_CHANNELS; i++) { channel_alloc_list_double[i] = FREE_INSTANCE; } /* for */ general_channel_init_flag_double = TRUE; } /* if general_init_flag */ /* * Find first free instance number. */ instance = -1; for (i=0; i < MAX_CHANNELS; i++) { if (channel_alloc_list_double[i] == FREE_INSTANCE) { instance = i; break; } } if (instance == -1) return(-1); /* no free instances */ if (nCode < 0) return(-1); /* Spreading code length incorrect/**/ /* Store the channel data Note if the channel is changed there might be some old data left in the memory, but this do not effect the calculations. /**/ channel_data_double[instance].n_taps = nTaps; channel_data_double[instance].n_impulses = nImpulse; channel_data_double[instance].cur_impulse = 0; /* Standard noise deviation is calculated for each chip. See Michel C. Jeruchim: "Simulation of communication Systems", Plenum 1992 page. 283 Power = noise power nCode = code length esno = Signal to noise ratio The random number is scaled between -1 and 1 and multiplied by noise_std calculated here. /**/ channel_data_double[instance].noise_std = sqrt(power / nCode / 2 / pow(10.0,(esno/10.0)) ) ; /**/ /* Select the channel mode CONSTANT RANDOM INTERPOL /**/ if( nImpulse == 1) { channel_data_double[instance].mode = CONST;} /* CONSTANT channel model /**/ else if (steps == 0) /* RANDOM channel model /**/ { channel_data_double[instance].mode = RANDOM; /* Calculate cumulative impulse vector probalitites /**/ channel_data_double[instance].cumul_prob[0] = impulse_prob[0]; for (i = 1; i < nImpulse; i++){ channel_data_double[instance].cumul_prob[i] = impulse_prob[i] + channel_data_double[instance].cumul_prob[i-1]; }} else { /* INTERPOLATING channel model /**/ channel_data_double[instance].mode = INTERPOL; /* Define the number of iteration steps in between two channel impulses /**/ n_intervals = ceil (steps / (nImpulse - 1)) + min(1, steps % (nImpulse - 1));/**/ for(j = 0; j<nImpulse; j++){ channel_data_double[instance].max[j] = n_intervals; channel_data_double[instance].use[j] = 0;} } /* Update the channel data matrix for all channel taps /**/ for(i = 0; i < nTaps; i++){ channel_data_double[instance].cur_channel[i] = channel_impulse[i]; channel_data_double[instance].cur_delays[i] = channel_delays[i]; if( channel_data_double[instance].mode == RANDOM){ /* RANDOM channel model Save all the impulses and delays /**/ for(j = 0; j < nImpulse-1; j++){ channel_data_double[instance].amplitudes[j][i] = channel_impulse[j * nTaps + i]; channel_data_double[instance].delays[j][i] = channel_delays[j * nTaps + i]; }} else if( channel_data_double[instance].mode == INTERPOL){ /* INTERPOLATING channel model Calculate the derivates of the amplitudes and the number of timesteps between delay tap changes (and the direction of the change) /**/ for(j = 0; j< nImpulse-1; j++){ channel_data_double[instance].amplitudes[j][i] = (channel_impulse[(j+1) * nTaps + i] - channel_impulse[j * nTaps + i])/n_intervals; delay_diff = channel_delays[(j+1) * nTaps + i] - channel_delays[j * nTaps + i] ; if( delay_diff != 0) { channel_data_double[instance].delays[j][i] = ( n_intervals / (abs(delay_diff)+1) + min(1, n_intervals % (abs(delay_diff)+1))) ; if( delay_diff < 0 ) { channel_data_double[instance].delays[j][i] = - channel_data_double[instance].delays[j][i] ;} } else {channel_data_double[instance].delays[j][i] = 0;} }} } /*Update for each channel tap/**/ /* Find the longest delay in the channel (to allocate enough memory for stored chips) /**/ channel_data_double[instance].max_memory = channel_delays[nTaps-1]; for (j = 2; j <= nImpulse; j++){ if ( channel_delays[j * nTaps - 1] > channel_data_double[instance].max_memory ) channel_data_double[instance].max_memory = channel_delays[j * nTaps-1]; } /* Allocate memory for the memory storage of previous time chips /**/ channel_data_double[instance].I_prev_chips = (double*)calloc( channel_data_double[instance].max_memory, sizeof(double)); channel_data_double[instance].Q_prev_chips = (double*)calloc( channel_data_double[instance].max_memory, sizeof(double)); /* Update the static tables to keep in mind which channel instances are in use /**/ channel_alloc_list_double[instance] = INSTANCE_IN_USE; channel_index_double ++; /* If you want to check what has been updated call: channel_print(instance);/**/ return(instance); } /* -----------------------------------------------------------
评论
    相关推荐
    • 谭浩强C语言
      这是谭浩强C语言的新版,有兴趣想学C语言的童鞋们可以下载来看看啊!
    • 谭浩强c语言
      谭浩强c语言,国内最权威的c语言学习宝典,从零基础开始,成为c语言高手。
    • Makefile c语言
      Makefile c语言Makefile c语言Makefile c语言Makefile c语言 四本资料!自己学习的时候整理的!
    • c语言教程
      c语言教程,优秀的c语言教程,简单基础,是学习c语言的好教程
    • C语言 实现
      C语言 项目实现 《计算方法》课件 俄罗斯方块游戏 C语言实训 综合案例-学生成绩管理程序 C语言程序设计学习与实践指导(源代码)
    • c语言
      c语言
    • C语言库函数
      C语言函数库,里面包括C语言的函数库,方便直接调用,还可以了解很多C语言一些函数模板
    • C语言
      C语言
    • 谭浩强C语言
      谭浩强C语言word版,学习C语言的,经典教材。 使用的编译工具有些老旧,建议是使用visual stdio 2008。
    • 水滴石穿C语言
      学习C语言的有用文档 水滴石穿C语言C语言的底层操作 水滴石穿C语言之extern声明辨析 水滴石穿C语言之static辨析 水滴石穿C语言之typedef的问题 水滴石穿C语言之编译器引出的问题 水滴石穿C语言之代码检查工具 ...