⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 multi_channel.c

📁 This model is just testing an idea of MIMO, which IEEE802.11n will have. But I havo not seen the s
💻 C
字号:
/*****************************************************************************//*   FIle Name : multi_channel.c                                             *//*   Description : MIMO prototype Pseudo Channel Estimatitor                 *//*                 num_inp : number of receiver's antena                     *//*                      : [2]  0:doubler input                               *//*                 level : White Noise level                                 *//*   author : miffie                                                         *//*   Date   : aug/12/05                                                      *//*   Copyright (c) 2005 miffie   All rights reserved.                        *//*****************************************************************************///                 _____________________________________//   PPDU0        X_____________________________________X//                |  _____________________________________//   PPDU1        | X_____________________________________X//                | |  _____________________________________//   PPDU2        | | X_____________________________________X//         offset>| |<|   //This offset is a fixed number//   Add PPDU0 + PPDU1 + PPDU2          //                 _________________________________________//   MIMO PPDU    X_________________________________________Xstruct complexsetset multi_channel(struct complexsetset css, char num_inp, char level ) {int 	ii , jj , kk ;int 	size ;int     tmp0 ;int     offset ;double  tx_phase, rx_phase ;double  rx_time ;struct 	complex  *top ;struct 	complex  tmp1, tmp2 , tmp3;struct  complexsetset  cout ;struct  complexset  *ctop ;struct  complexset  cset0 ;static  double pi = 3.14159265 ;  if((ctop = (struct complexset *)malloc(num_inp*sizeof(struct complexset)) ) == NULL) {        PRINTF( " malloc failed in multi_channel.c\n") ;  } //fail  else { //allocated   size = css.set[0].size ;   PRINTF("multi_channel size=%d \n", size ) ;   cout.size = num_inp ;   cout.set = ctop ;   for(jj=0;jj<num_inp;jj++){ //each receiver        if ((top = (struct complex *)malloc((size+16)*sizeof(struct complex)) ) == NULL) {        PRINTF( " malloc failed in multi_channel.c\n") ;     } //fail     else { //allocated       PRINTF("multi_channel =%d th receiver\n", jj ) ;       ctop[jj].data = top ;       ctop[jj].size = size+16 ;       //noise generation       for( ii=0;ii<(size+16);ii++) {//noise           tmp0 = int_random( 2 ) ;          if (tmp0==0) tmp0= -1 ;          top[ii].realp = (tmp0 * gamma_random( level )/4096.0)  ;          tmp0 = int_random( 2 ) ;          if (tmp0==0) tmp0= -1 ;          top[ii].image = (tmp0 * gamma_random( level )/4096.0) ;       } //noise       for(kk=0;kk<css.size;kk++) { //each transmitter         offset = kk*2 ;         cset0.size = css.set[kk].size ;         cset0.data = css.set[kk].data ;         //if (kk==jj) { tmp1.realp = 1.0 ; tmp1.image = 0 ; }          //else { tmp1.realp = 0.0 ; tmp1.image = 0 ; }         tmp2.realp = (24+int_random( 9 ))/32.0 ; //radius         tmp2.image = 2*pi*(int_random( 128 ))/128.0 ; //phase         tmp1.realp = tmp2.realp * cos( tmp2.image ) ;         tmp1.image = tmp2.realp * sin( tmp2.image ) ;         PRINTF("multi_channel (%d) th transmitter %6.3f + j * %6.3f\n",                 kk , tmp1.realp , tmp1.image ) ;         for(ii=0;ii<size;ii++) {//noise             tmp2 = multiply_complex( tmp1, cset0.data[ ii ] ) ;            top[ii+offset].realp += tmp2.realp ;            top[ii+offset].image += tmp2.image ;         } //noise       } //each transmitter     } //allocated   } //each receiver  } //allocated  return( cout ) ;}//multi_channel 

⌨️ 快捷键说明

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