亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? channel.c

?? matlab實現wcdma的全過程
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* | 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  channel_data[MAX_CHANNELS];/* List that keeps record which channel instances are used /**/static enum instance_state channel_alloc_list[MAX_CHANNELS] ;/* General initialization flag /**/static int general_channel_init_flag = FALSE;/* Total number of occupied channels/**/static int channel_index = 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 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 == FALSE) {        for (i=0; i < MAX_CHANNELS; i++) {            channel_alloc_list[i] = FREE_INSTANCE;        } /* for */        general_channel_init_flag = TRUE;    } /* if general_init_flag */    /*     * Find first free instance number.     */    instance = -1;    for (i=0; i < MAX_CHANNELS; i++) {        if (channel_alloc_list[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[instance].n_taps = nTaps;    channel_data[instance].n_impulses = nImpulse;    channel_data[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[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[instance].mode = CONST;} /* CONSTANT channel model /**/          else if (steps == 0)          /* RANDOM channel model /**/      { channel_data[instance].mode = RANDOM;      /* 	 Calculate cumulative impulse vector probalitites 	 /**/      channel_data[instance].cumul_prob[0] = impulse_prob[0];      for (i = 1; i < nImpulse; i++){	channel_data[instance].cumul_prob[i] = 	  impulse_prob[i] +  channel_data[instance].cumul_prob[i-1];      }}        else {        /* INTERPOLATING channel model /**/      channel_data[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[instance].max[j] = n_intervals;	channel_data[instance].use[j] = 0;}    }    /*      Update the channel data matrix for all channel taps      /**/    for(i = 0; i < nTaps; i++){      channel_data[instance].cur_channel[i] = channel_impulse[i];      channel_data[instance].cur_delays[i] = channel_delays[i];      if( channel_data[instance].mode == RANDOM){	/* RANDOM channel model  	   Save all the impulses and delays	   /**/	for(j = 0; j < nImpulse; j++){	  channel_data[instance].amplitudes[j][i] = channel_impulse[j * nTaps + i]; 	  channel_data[instance].delays[j][i] = channel_delays[ j * nTaps + i];	}}      else if( channel_data[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[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[instance].delays[j][i] =  	      ( n_intervals / (abs(delay_diff)+1) + min(1, n_intervals % (abs(delay_diff)+1))) ;            if( delay_diff < 0 )  {	      channel_data[instance].delays[j][i] = -  channel_data[instance].delays[j][i] ;}	  }	  else {channel_data[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[instance].max_memory = channel_delays[nTaps-1];    for (j = 2; j <= nImpulse; j++){      if ( channel_delays[j * nTaps - 1]  > channel_data[instance].max_memory )	    channel_data[instance].max_memory = channel_delays[j * nTaps-1];     }    /*      Allocate memory for the memory storage of previous time chips      /**/    channel_data[instance].I_prev_chips  = (int*)calloc( channel_data[instance].max_memory, sizeof(int));    channel_data[instance].Q_prev_chips  = (int*)calloc( channel_data[instance].max_memory, sizeof(int));    /*        Update the static tables to keep in mind which channel instances are in use       /**/        channel_alloc_list[instance] = INSTANCE_IN_USE;    channel_index ++;    /*      If you want to check what has been updated call:      channel_print(instance);/**/    return(instance);}/* -------------------------------------------------------------------- *//* * Function:    wcdma_channel * Desc.:       Channel response *              The function which performs the givne channel *              for the input signal and upstaes the channel *              and stores the last chips for next call.   * * Note: *         channel_impulse and tap_delay vectors need to same length and *         their elements are corresponding, i.e. the tap_delay[i]  *         indicates how many chipintervals the channel_impulse  *         is delayd. The channel_impulse[i] indicates the attennuation *         coefficient.  * *        THE LAST ELEMENT OF tap_delay[i] VECTOR IMPLIES WHAT IS THE TOTAL *        DELAY FOR THE CHANNEL.  *//* -------------------------------------------------------------------- */int wcdma_channel( 	     int  Inputs[],	        /* IN: input chip vector */	     int  Qnputs[],	        /* IN: input chip vector */	     int  nInputs,	        /* IN: input vector size */	     int  instance,	        /* IN:  */	     double channel[],          /* OUT: Channel impulse vector*/	     int  delay[],              /* OUT: Delays of channel taps*/	     double Iout[],             /* OUT: output bit vector */ 	     double Qout[]              /* OUT: output bit vector */){    int i,  memory_length, nTaps ;    double std_noise;    int *prev_I,*prev_Q;    channel_matrix *channel_datum;    /*      Get the channel data for given channel instance      /**/    channel_datum = &channel_data[instance];    nTaps = channel_datum->n_taps;    std_noise = channel_datum->noise_std ;    /*        If AWGN noise is added to the channel       /**/    if(std_noise > 0 )      i = wcdma_channel_conv(Inputs,Qnputs,nInputs,instance,Iout,Qout);    /*        If no noise is added /**/ 	    else      i = wcdma_channel_conv_nonoise(Inputs,Qnputs,nInputs,instance,Iout,Qout);        /*        Return the used channel amplitude and delay vectors       /**/    for(i=0;i<nTaps;i++){      channel[i] = channel_datum->cur_channel[i];      delay[i] = channel_datum->cur_delays[i];    }    /*        Update the channel amplitude and delay vectors if not CONSTANT channel       /**/        if (channel_datum->mode > CONST){      wcdma_update_channel(channel_datum);    }    /*        Save the last chips of this input block to next function call       /**/    i = wcdma_update_memory_chips(Inputs,Qnputs,nInputs,channel_datum);    /**/        return(0);}/* -------------------------------------------------------------------- *//* * Function:    wcdma_channel_conv_nonoise  * Desc.:       Channel response *              Performs the channel concolution and adds no noise to it *              (i.e. is almost the same as function wcdma_channel_conv) * Note: *         channel_impulse and tap_delay vectors need to same length and *         their elements are corresponding, i.e. the tap_delay[i]  *         indicates how many chipintervals the channel_impulse  *         is delayd. The channel_impulse[i] indicates the attennuation *         coefficient.  * *        THE LAST ELEMENT OF tap_delay[i] VECTOR IMPLIES WHAT IS THE TOTAL *        DELAY FOR THE CHANNEL.  *//* -------------------------------------------------------------------- */int wcdma_channel_conv_nonoise( 	     int  Inputs[],	        /* IN: input chip vector */	     int  Qnputs[],	        /* IN: input chip vector */	     int  nInputs,	        /* IN: input vector size */	     int  instance,	        /* IN: indicates the channel instance used/**/ 	     double Iout[],             /* OUT: output bit vector */	     double Qout[]              /* OUT: output bit vector */){    int i, j, i_tmp, tmp_delay,d_zero;    int  taps, mem_len;    double I_collect , Q_collect , noise,std_noise;    int  *delay, *prev_I, *prev_Q;    double  *channel;    channel_matrix *channel_datum;    /*      Get infromation about the used channel from the channel matrix      /**/          channel_datum = &channel_data[instance];    taps = channel_datum->n_taps;    /*        Current channel amplitudes and delays       /**/    channel = &channel_datum->cur_channel[0];    delay = &channel_datum->cur_delays[0];    mem_len = delay[taps -1];    /*      The chips saved from previous function call      /**/    prev_I = &(channel_datum->I_prev_chips[0]);    prev_Q = &(channel_datum->Q_prev_chips[0]);    /*        The first mem_len chips are effected also by the        previous input chips.        /**/    for(i = mem_len ; i > 0; i--) {      I_collect = 0;  /* gathers all the multipaths signals for I /**/      Q_collect = 0;  /* and for Q/**/      d_zero = i - mem_len;      for(j = 0; j < taps; j++) {	    i_tmp = d_zero + delay[j];             if( i_tmp > 0) {	      /* Use the stored chips to update the output		 /**/	      I_collect += prev_I[i_tmp - 1] * channel[j];	      Q_collect += prev_Q[i_tmp - 1] * channel[j];	    } 	    else {	      /* Use the new input chips  to update the output		 /**/	      i_tmp = abs(i_tmp);	      I_collect += Inputs[i_tmp] * channel[j];	      Q_collect += Qnputs[i_tmp] * channel[j];

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美经典视频| 成人毛片视频在线观看| 国产成人av电影在线| 色综合久久久久| 精品久久久久久无| 天天综合色天天综合色h| 成人在线一区二区三区| 日韩一级黄色片| 亚洲主播在线播放| 成人av免费在线观看| 久久婷婷国产综合精品青草| 亚洲午夜私人影院| 色哟哟精品一区| 中文字幕亚洲不卡| 懂色中文一区二区在线播放| 91精品国产综合久久蜜臀| 亚洲美女屁股眼交| 99久久99久久综合| 国产精品人妖ts系列视频| 精品一区二区三区日韩| 91精选在线观看| 首页国产欧美日韩丝袜| 欧美日韩视频不卡| 夜夜嗨av一区二区三区网页 | 欧美国产精品v| 国产最新精品免费| 精品va天堂亚洲国产| 蜜臀av性久久久久蜜臀aⅴ流畅| 欧美日韩成人一区二区| 午夜精品成人在线视频| 欧美性色黄大片| 香蕉成人伊视频在线观看| 欧美影院一区二区三区| 一区二区三区不卡在线观看| 日本精品视频一区二区三区| 亚洲男女毛片无遮挡| 91国产丝袜在线播放| 亚洲摸摸操操av| 欧美亚洲动漫精品| 五月天婷婷综合| 欧美r级电影在线观看| 韩国视频一区二区| 中文字幕欧美区| 色综合天天综合网天天看片 | 久久综合999| 粉嫩13p一区二区三区| 亚洲欧美中日韩| 欧美日韩国产免费| 久久99精品久久久| 中文字幕精品—区二区四季| 91浏览器在线视频| 亚洲mv大片欧洲mv大片精品| 日韩三级.com| 不卡一区二区三区四区| 一区二区三区精品在线| 日韩三级高清在线| eeuss鲁片一区二区三区在线观看| 亚洲欧美电影一区二区| 欧美三级日韩三级国产三级| 美腿丝袜一区二区三区| 国产精品热久久久久夜色精品三区| 91麻豆免费看片| 蜜臀久久久99精品久久久久久| 国产校园另类小说区| 欧美最猛性xxxxx直播| 国产一区二区按摩在线观看| 亚洲日本护士毛茸茸| 日韩欧美国产麻豆| 91麻豆国产精品久久| 美女一区二区三区在线观看| 国产精品无人区| 日韩欧美在线观看一区二区三区| 99久久久精品| 麻豆精品蜜桃视频网站| 亚洲欧美福利一区二区| 精品理论电影在线观看 | 性欧美大战久久久久久久久| 日韩一区二区免费视频| 91欧美一区二区| 激情文学综合网| 亚洲午夜在线视频| 亚洲色图欧洲色图婷婷| 久久奇米777| 91精品国产一区二区三区| 99国产欧美另类久久久精品| 精久久久久久久久久久| 亚洲第一久久影院| 亚洲图片欧美激情| 欧美国产国产综合| 久久久久成人黄色影片| 日韩精品一区二区三区中文不卡 | 一区二区在线看| 久久精品视频网| 精品美女一区二区| 日韩欧美国产一区二区三区 | 国产日韩欧美高清| 欧美第一区第二区| 欧美一卡二卡在线| 欧美日韩在线电影| 欧美日韩综合色| 色又黄又爽网站www久久| 成人国产精品免费观看视频| 国产一区二区三区免费播放| 久久99国产精品免费网站| 日韩电影在线观看电影| 午夜亚洲福利老司机| 亚洲国产一区二区三区| 一区二区三区免费网站| 亚洲免费看黄网站| 樱花影视一区二区| 一区二区三区在线影院| 亚洲激情图片小说视频| 亚洲图片欧美综合| 天天色综合天天| 日韩av电影免费观看高清完整版在线观看| 亚洲成人激情av| 日本一道高清亚洲日美韩| 奇米影视一区二区三区| 理论电影国产精品| 国产麻豆精品在线观看| 成人黄色电影在线| 欧洲中文字幕精品| 欧美精品久久99| 2021久久国产精品不只是精品| 亚洲精品一区二区三区影院| 中文在线资源观看网站视频免费不卡 | 久久久综合网站| 国产亚洲综合色| 一区精品在线播放| 亚洲国产综合91精品麻豆| 五月激情综合婷婷| 久久99国产乱子伦精品免费| 国产精品自拍在线| 色偷偷久久一区二区三区| 欧美日韩激情一区二区三区| 欧美成人乱码一区二区三区| 久久久99精品久久| 亚洲啪啪综合av一区二区三区| 午夜视频在线观看一区| 精品写真视频在线观看| www.日韩在线| 69堂亚洲精品首页| 国产精品嫩草影院av蜜臀| 一区二区在线观看不卡| 美腿丝袜亚洲三区| 99精品久久免费看蜜臀剧情介绍| 欧美日韩在线一区二区| 久久久午夜电影| 亚洲精品成人精品456| 久草精品在线观看| 色综合久久综合| 日韩欧美高清一区| 亚洲欧美日韩久久精品| 狠狠色狠狠色综合| 欧洲一区二区三区在线| 久久久久久电影| 同产精品九九九| av影院午夜一区| 精品噜噜噜噜久久久久久久久试看| 亚洲天堂精品在线观看| 激情亚洲综合在线| 欧美精选在线播放| 亚洲欧美日韩国产一区二区三区| 狠狠色丁香婷综合久久| 欧美在线一区二区三区| 中文字幕 久热精品 视频在线 | 日韩写真欧美这视频| 亚洲人精品午夜| 狠狠色综合日日| 欧美日韩二区三区| 亚洲免费观看高清完整版在线观看熊 | 捆绑调教美女网站视频一区| 色成人在线视频| 国产精品三级av| 国产成人高清在线| 日韩一级免费一区| 视频一区二区不卡| 色狠狠色狠狠综合| 最新日韩av在线| 国产成人精品免费视频网站| 精品免费国产二区三区 | 日韩欧美黄色影院| 亚洲6080在线| 91极品美女在线| 亚洲视频一二三| 91蜜桃免费观看视频| 国产精品丝袜黑色高跟| 国产精品88av| 久久精品欧美日韩精品| 国产综合成人久久大片91| 日韩美女在线视频| 老色鬼精品视频在线观看播放| 91精品国产欧美一区二区成人| 亚洲大尺度视频在线观看| 91福利精品视频| 亚洲美女在线一区| 欧美写真视频网站| 亚洲高清免费在线| 91精品国产综合久久精品图片 | 亚洲一区免费在线观看|