亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲一区在线视频观看| 日韩中文字幕亚洲一区二区va在线 | 国产一二精品视频| 不卡一区二区中文字幕| 日韩欧美在线影院| 亚洲午夜电影网| 成人免费观看男女羞羞视频| 日韩一区二区不卡| 亚洲一级不卡视频| 97超碰欧美中文字幕| 久久久不卡影院| 精品无人码麻豆乱码1区2区| 欧美日韩和欧美的一区二区| 亚洲欧美综合在线精品| 国产成人福利片| 久久在线免费观看| 麻豆国产一区二区| 在线电影欧美成精品| 一卡二卡欧美日韩| 色老汉av一区二区三区| 国产精品女同一区二区三区| 日日摸夜夜添夜夜添亚洲女人| 一本一本大道香蕉久在线精品| 中文字幕欧美激情| 国产成人一级电影| www一区二区| 国模无码大尺度一区二区三区| 91精品国产高清一区二区三区 | 成人性视频免费网站| 精品欧美一区二区在线观看| 日韩高清在线一区| 欧美乱妇15p| 首页国产欧美久久| 欧美一区二区三区日韩视频| 日韩不卡免费视频| 欧美一区二区三级| 日本欧美大码aⅴ在线播放| 51午夜精品国产| 日韩国产一区二| 欧美一区二区黄色| 狠狠色丁香久久婷婷综| 精品国产不卡一区二区三区| 国产一区在线看| 国产视频一区二区三区在线观看| 国产精品一区二区三区99| 日本一区二区三区四区在线视频| 成人网页在线观看| 亚洲一区二区欧美日韩| 7777精品久久久大香线蕉| 日韩中文字幕不卡| 日韩精品一区二区三区视频在线观看| 日本亚洲天堂网| 精品国产1区二区| 成人中文字幕电影| 亚洲最大成人综合| 日韩一级黄色片| 国产风韵犹存在线视精品| 国产精品对白交换视频| 欧美视频一区在线| 黑人精品欧美一区二区蜜桃| 一区在线播放视频| 88在线观看91蜜桃国自产| 国产做a爰片久久毛片| 亚洲狠狠丁香婷婷综合久久久| 777久久久精品| 成人丝袜18视频在线观看| 亚洲成人免费av| 国产精品丝袜久久久久久app| 欧美午夜片在线看| 国产不卡视频在线观看| 亚洲成在线观看| 日本一区二区三区在线不卡| 欧美二区三区91| 成人app在线观看| 日韩二区三区在线观看| 国产精品美女视频| 欧美电影免费观看高清完整版在| 成人午夜又粗又硬又大| 日韩一区精品字幕| 一级女性全黄久久生活片免费| 日韩欧美亚洲一区二区| 欧美午夜电影在线播放| 国产精品77777| 男人的天堂久久精品| 一区二区三区四区五区视频在线观看| 精品国产凹凸成av人导航| 欧美日韩一级片在线观看| 成人天堂资源www在线| 久久se精品一区精品二区| 亚洲国产综合色| 国产精品三级视频| 久久综合色之久久综合| 日韩一区二区三| 在线观看日韩精品| 99re成人精品视频| 国产精品18久久久久久久网站| 日韩一区欧美二区| 亚洲第一综合色| 一区二区三区在线视频播放| 国产精品免费视频网站| 久久久亚洲精品一区二区三区| 欧美一区二区成人6969| 欧美美女喷水视频| 欧美日韩激情在线| 欧美乱妇15p| 欧美精品xxxxbbbb| 欧美日韩国产一级| 欧美精品丝袜久久久中文字幕| 在线一区二区三区做爰视频网站| 91蝌蚪porny| 色综合久久精品| 色av综合在线| 在线观看中文字幕不卡| 一本大道av伊人久久综合| 91麻豆精品在线观看| 99久久精品国产麻豆演员表| 91丨porny丨蝌蚪视频| 一本在线高清不卡dvd| 在线亚洲精品福利网址导航| 欧美无乱码久久久免费午夜一区| 欧美亚洲尤物久久| 欧美高清视频www夜色资源网| 欧美日韩精品综合在线| 日韩一区二区免费视频| 国产亚洲精品aa午夜观看| 久久久久国产精品厨房| 国产精品久久久久影院| 亚洲欧美日韩精品久久久久| 亚洲国产日产av| 麻豆国产精品一区二区三区| 国产在线精品一区二区三区不卡 | 在线免费视频一区二区| 欧美男女性生活在线直播观看| 欧美中文字幕一二三区视频| 在线免费观看日韩欧美| 欧美猛男男办公室激情| 精品国产91亚洲一区二区三区婷婷| 久久婷婷久久一区二区三区| 国产精品初高中害羞小美女文| 亚洲综合视频在线| 免费在线观看成人| 成人午夜私人影院| 欧美日韩免费视频| 精品久久久久久久久久久院品网| 中文字幕一区免费在线观看| 亚洲国产精品视频| 国产精品影视在线观看| 色综合欧美在线| 欧美成人a视频| **网站欧美大片在线观看| 日本美女视频一区二区| 福利一区二区在线| 欧美日韩一区 二区 三区 久久精品| 精品88久久久久88久久久| 亚洲色欲色欲www在线观看| 视频一区视频二区在线观看| 粉嫩嫩av羞羞动漫久久久| 欧美午夜精品一区二区蜜桃| 久久精品夜夜夜夜久久| 香港成人在线视频| www.亚洲色图| 精品国产区一区| 亚洲一区二区三区四区不卡| 成人午夜在线免费| 欧美成人艳星乳罩| 亚洲国产一区二区在线播放| 国产成人免费高清| 日韩欧美一级二级| 亚洲国产人成综合网站| zzijzzij亚洲日本少妇熟睡| 精品嫩草影院久久| 亚洲二区在线观看| 91丝袜美腿高跟国产极品老师 | 色婷婷综合久久久中文字幕| 精品国产乱码久久久久久牛牛 | 亚洲精品国产a| 国产白丝网站精品污在线入口| 欧美一区二区三区小说| 一区二区在线观看免费| 福利电影一区二区| 亚洲精品一区二区精华| 麻豆91在线观看| 欧美日韩高清不卡| 一区二区三区中文在线观看| 国产91富婆露脸刺激对白| 欧美一级艳片视频免费观看| 亚洲午夜日本在线观看| 色悠悠亚洲一区二区| 亚洲欧美中日韩| www.欧美精品一二区| 国产精品卡一卡二| 成人午夜免费电影| 日本一二三四高清不卡| 国产成人综合亚洲网站| 国产欧美精品国产国产专区 | 日本伊人精品一区二区三区观看方式| 日本久久电影网| 亚洲妇熟xx妇色黄| 精品1区2区3区| 日韩中文字幕亚洲一区二区va在线|