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

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

?? block_4by4_complex.c

?? 軟件無線電的平臺
?? C
字號:
/*************************************************************************** *    block_4by4_complex.c  - Defines a variable, complex NxM MIMO block *                           ------------------- *   begin                :  03/09/03 *   authors              :  Linus Gasser *   emails               :  linus.gasser@epfl.ch ***************************************************************************//*************************************************************************** *                                Changes *                                ------- * date - name - description * 03/07/03 - ineiti - took block_mimo to make block_complex * 09 Dec 2003 - chiurtu - extended to 4 by 4 system * 04/03/04 - ineiti - auto-detect number of rx and tx ports * 04/03/05 - ineiti - adjusted documentation * **************************************************************************//*************************************************************************** *                                                                         * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU General Public License as published by  * *   the Free Software Foundation; either version 2 of the License, or     * *   (at your option) any later version.                                   * *                                                                         * ***************************************************************************//** * This block is used for simulations of the channel. It implements * a NxM MIMO-system, where N and M are <= 4. *  One can give the size of the block in samples as well as the * precision of the A/D converter. *  The channel-matrix h[n][m] represents the channel between the * tx-antenna (input) 'm' and the rx-antenna (output) 'n'. *  For the receiving-antenna you can give the sigma of the white noise. * Please be aware that the sigma is between -32767 and 32767, and compares * to a signal-amplitude set by the modules (usually around 10000), whereas * the more conventional sigma compares to a signal-amplitude of 1.  */#include <stdlib.h>#include <complex.h>#include "spc.h"#define DBG_LVL 0#define RX_TX_DELAY 0#define MAX_NO_RX 4#define MAX_NO_TX 4typedef struct {  // The number of symbols of the block  int size;      // 2560  // The precision of the A/D converter  int precision; // 12  // channel entries over rows    complex double h[MAX_NO_RX][MAX_NO_TX]; // 0.5 + 0.5j  // The sigma of the gaussian-noise at the receiver  complex double sigma[MAX_NO_RX]; // 100 + 100j}config_t;typedef struct {  // The maximum number of reception antennas  int max_no_rx;  // The maximum number of transmission antennas  int max_no_tx;}stats_t;typedef struct {  int size;  int mask;  // How many input channels  int no_tx;  // How many output channels  int no_rx;    // channel entries over rows    complex double h[MAX_NO_RX][MAX_NO_TX];  // this is for Gaussian  complex double sigma[MAX_NO_RX];  // for the random-number generator  unsigned short simrand[3];}private_t;/* * The initialisation function, or constructor, * is called the first time this module is instantiated. */int spc_init( swr_sdb_t *context ) {  int i, j;  // Begin system-definitions {  config_t *config;  stats_t *stats;  MOD_INC_USE_COUNT;  if ( sizeof( private_t ) > 0 )    context->private_data = swr_malloc( sizeof( private_t ) );  swr_sdb_get_config_struct( context->id, (void**)&config );  swr_sdb_get_stats_struct( context->id, (void**)&stats );  // } End of system-definitions  // Tell the subsystem we don't accept resizes, but only emit them  context->status |= SUBS_STATUS_RESIZE_BOTH;  private->size = 0;  // We set the standard UMTS-size for the slot  config->size = 2560;  config->precision = 16;  stats->max_no_rx = MAX_NO_RX;  stats->max_no_tx = MAX_NO_TX;  // Channel parameters  for(i = 0; i < MAX_NO_RX; i++){    for(j = 0; j < MAX_NO_TX; j++){      config->h[i][j] = 0.5 + 0.5I;    }  }    for(j = 0; j < MAX_NO_RX; j++){    config->sigma[j] = 100 + 100I;  }    srand( (int)get_time_usec()%100000000 );  // initialize the random generator  private->simrand[0]=(unsigned short)((get_time_usec()>>00)&0xffff);  private->simrand[1]=(unsigned short)((get_time_usec()>>16)&0xffff);  private->simrand[2]=(unsigned short)((get_time_usec()>>00)&0xffff);  // Begin system-definitions  swr_sdb_free_stats_struct( context->id, (void**)&stats );  swr_sdb_free_config_struct( context->id, (void**)&config );  return 0;  // End system-definitions}/* * Every time modules from the outside change the value of a configuration parameter, * this function is called. */int spc_reconfig( swr_sdb_t *context ) {  // Definition of variables - don't touch  config_t *config;  int ch;  swr_sdb_get_config_struct( context->id, (void**)&config );  if ( config->size != private->size ) {    PR_DBG( 2, "Re-setting sizes: %i, %i\n", config->size, private->size );    private->size = config->size;    for ( ch=0; ch<MAX_NO_TX; ch++ ){      size_in(ch) = config->size;    }    for ( ch=0; ch<MAX_NO_RX; ch++ ){      size_out(ch) = config->size;    }  }  private->mask = -1 << ( 16 - config->precision );    // Copy the config-parameters to the private array  memcpy( private->sigma, config->sigma, sizeof( config->sigma ) );  memcpy( private->h, config->h, sizeof( config->h ) );    swr_sdb_free_config_struct( context->id, (void**)&config );  return 0;}int spc_configure_inputs( swr_sdb_t *context ) {  // Definition of variables - don't touch  config_t *config;  int ch;  swr_sdb_get_config_struct( context->id, (void**)&config );  private->no_tx = 0;  for ( ch=0; ch<MAX_NO_TX; ch++ ){    if ( port_in( ch ).sdb_id >= 0 ){      private->no_tx++;    }  }  PR_DBG( 4, "Got %i Tx and %i Rx ports\n",	  private->no_tx, private->no_rx );  // Definition - don't touch  swr_sdb_free_config_struct( context->id, (void**)&config );  return 0;}/* * This is called when the input-sizes change * It configures the outputs */int spc_configure_outputs( swr_sdb_t *context ) {  // Definition of variables - don't touch  config_t *config;  int ch;  swr_sdb_get_config_struct( context->id, (void**)&config );  private->no_rx = 0;  for ( ch=0; ch<MAX_NO_RX; ch++ ){    if ( port_out( ch ).sdb_id >= 0 ){      private->no_rx++;    }  }  PR_DBG( 4, "Got %i Tx and %i Rx ports\n",	  private->no_tx, private->no_rx );  // Definition - don't touch  swr_sdb_free_config_struct( context->id, (void**)&config );  return 0;}double getSigma( swr_sdb_t *context, double amplitude ){  double u, v, w, alpha;  do {    u = 2*erand48(private->simrand)-1;    v = 2*erand48(private->simrand)-1;        w = u*u + v*v;  } while (w>=1);  alpha = sqrt( -2 * log(w)/w);  return alpha * u * amplitude;}complex double getSigmaComplex( swr_sdb_t *context, complex double amplitude ){    return getSigma( context, creal( amplitude ) ) +    getSigma( context, cimag( amplitude ) ) * I;}/* * This is the function that implements the `main method' of the class * Every class has got just ONE method/working-mode. */int spc_pdata( swr_sdb_t *context ) {  // Definition of variables - don't touch  stats_t *stats;  SYMBOL_COMPLEX *in[MAX_NO_TX];  SYMBOL_COMPLEX *out[MAX_NO_RX];  int i, j, k, re, im;  double a;  complex double x, y;  //  double plus_real, minus_real,	plus_imag1, plus_imag2;  /* // Return if not all data available yet */    for ( i=0; i<private->no_tx; i++ ){      if ( !data_available( i ) ){      PR_DBG( 3, "Not all data here yet. Data to port %i is missing\n",i );      return 0;    }  }  PR_DBG( 3, "Processing data: size is %i, in(%i), out(%i)\n", 	  private->size, private->no_rx, private->no_tx );#if DBG_LVL >= 3  PR_DBG( 3, "h is " );  for ( i=0; i<private->no_rx; i++ ){    for ( j=0; j<private->no_tx; j++ ){      PR_DBG_CL( 3, "%g+%gi   ", creal( private->h[i][j] ),		 cimag( private->h[i][j] ) );    }  }  PR_DBG_CL( 3, "\n" );  PR_DBG( 3, "sigma is " );  for ( i=0; i<private->no_rx; i++ ){    PR_DBG_CL( 3, "%g+%gi   ", creal( private->sigma[i] ),	       cimag( private->sigma[i] ) );  }  PR_DBG_CL( 3, "\n" );#endif    for (i = 0; i < private->no_tx; i++){    in[i] =  buffer_in(i);  }  for (i = 0; i < private->no_rx; i++){    out[i] = buffer_out(i);  }    // this is still hard coded, to omit a saturation of the channel  a= 0.1;  PR_DBG( 4, "A is %f, mask is %x\n", a, private->mask );    if ( private->size ) {    for ( i=0; i<private->size; i++ ) {      for ( j=0; j<private->no_rx; j++ ) {	y = 0;	for ( k=0; k<private->no_tx; k++ ){	  x = in[k][i].real + in[k][i].imag * I;	  y += x * private->h[j][k];	}	y += getSigmaComplex( context, private->sigma[j] );	y *= a;		re = creal( y );	im = cimag( y );		re = max( re, -1 << 15 );	re = min( re,  1 << 15 );	im = max( im, -1 << 15 );	im = min( im,  1 << 15 );		out[j][i+RX_TX_DELAY].real = re & private->mask;	out[j][i+RX_TX_DELAY].imag = im & private->mask;      }    }  }    swr_sdb_get_stats_struct( context->id, (void**)&stats );  // Put your code here  // ADD HERE  swr_sdb_free_stats_struct( context->id, (void**)&stats );  return(0);}/* * This is the `destructor'. */int spc_finalize( swr_sdb_t *context ) {  if ( sizeof( private_t ) > 0 )    swr_free( private );  MOD_DEC_USE_COUNT;  return 0;}/* * This function is called upon "insmod" and is used to register the * different parts of the module to the SPM. */swr_spc_id_t cdb_id;int spc_module_init(void) {  swr_spc_desc_t *desc;  /**   * Get a description-part from SPM   * Give the following parameters:   * Input-ports, output-ports, config-params, stat-params   */  desc = swr_spc_get_new_desc( MAX_NO_TX, MAX_NO_RX, 22, 2 );  if ( !desc ) {    PR_DBG( 0, "Can't initialise the module. This is BAD!\n" );    return -1;  }  /**   * Define the different parts of config and stats. You have to define   * them in the same order as they appear in the structures. The names   * can be freely chosen.   *   * UM_CONFIG_{INT,DOUBLE,STRING128,POINTER}( "name" );   * UM_STATS_{INT,DOUBLE,STRING128,POINTER,BLOCK}( "name" );   */  UM_CONFIG_INT( "size" );  UM_CONFIG_INT( "precision" );  UM_CONFIG_DOUBLE_COMPLEX( "h" );  UM_CONFIG_DOUBLE_COMPLEX( "h12" );  UM_CONFIG_DOUBLE_COMPLEX( "h13" );  UM_CONFIG_DOUBLE_COMPLEX( "h14" );  UM_CONFIG_DOUBLE_COMPLEX( "h2" );  UM_CONFIG_DOUBLE_COMPLEX( "h22" );  UM_CONFIG_DOUBLE_COMPLEX( "h23" );  UM_CONFIG_DOUBLE_COMPLEX( "h24" );  UM_CONFIG_DOUBLE_COMPLEX( "h3" );  UM_CONFIG_DOUBLE_COMPLEX( "h32" );  UM_CONFIG_DOUBLE_COMPLEX( "h33" );  UM_CONFIG_DOUBLE_COMPLEX( "h34" );  UM_CONFIG_DOUBLE_COMPLEX( "h4" );  UM_CONFIG_DOUBLE_COMPLEX( "h42" );  UM_CONFIG_DOUBLE_COMPLEX( "h43" );  UM_CONFIG_DOUBLE_COMPLEX( "h44" );  UM_CONFIG_DOUBLE_COMPLEX( "sigma" );  UM_CONFIG_DOUBLE_COMPLEX( "sigma2" );  UM_CONFIG_DOUBLE_COMPLEX( "sigma3" );  UM_CONFIG_DOUBLE_COMPLEX( "sigma4" );  UM_STATS_INT( "max_no_rx" );  UM_STATS_INT( "max_no_tx" );  /**   * The in- and outputs have also to be defined in the right order. First   * port first. The additional flag is not used yet, but it will...   *   * UM_INPUT( SIG_{U8,SYMBOL_{S16,COMPLEX,MMX},SAMPLE_S12,S32}, 0 );   * UM_OUTPUT( SIG_{U8,SYMBOL_{S16,COMPLEX,MMX},SAMPLE_S12,S32}, 0 );   */  UM_INPUT( SIG_SYMBOL_COMPLEX, 0 );  UM_INPUT( SIG_SYMBOL_COMPLEX, 0 );  UM_INPUT( SIG_SYMBOL_COMPLEX, 0 );  UM_INPUT( SIG_SYMBOL_COMPLEX, 0 );  UM_OUTPUT( SIG_SYMBOL_COMPLEX, 0 );  UM_OUTPUT( SIG_SYMBOL_COMPLEX, 0 );  UM_OUTPUT( SIG_SYMBOL_COMPLEX, 0 );  UM_OUTPUT( SIG_SYMBOL_COMPLEX, 0 );  // Initialise the callback-functions. Delete the ones you don't use  desc->fn_init              = spc_init;  desc->fn_reconfigure       = spc_reconfig;  desc->fn_process_data      = spc_pdata;  desc->fn_finalize          = spc_finalize;  desc->fn_configure_inputs  = spc_configure_inputs;  desc->fn_configure_outputs = spc_configure_outputs;  // And register the module in the SPM. Change the name!  cdb_id = swr_cdb_register_spc( &desc, "block_4by4_complex" );  if ( cdb_id == SWR_SPM_INVALID_ID ) {    swr_spc_free_desc( desc );    PR_DBG( 0, "Couldn't register the module!\n" );    return 1;  }  PR_DBG( 4, "Ready\n" );  return 0;}/* * This is called upon rmmod */void spc_module_exit( void ) {  PR_DBG( 4, "Freeing id: %i\n", cdb_id );  if ( swr_cdb_unregister_spc( cdb_id ) < 0 ) {    PR_DBG( 0, "Still in use somewhere\n" );  }}module_init( spc_module_init );module_exit( spc_module_exit );

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
97se亚洲国产综合自在线不卡 | 蜜桃免费网站一区二区三区 | av激情亚洲男人天堂| 欧美一区二区三区在| 美日韩一区二区| 777色狠狠一区二区三区| 精品国内片67194| 青青草国产成人99久久| 欧美一级理论性理论a| 久久er精品视频| 欧美精品一区二区精品网| 国产高清亚洲一区| 久久久久9999亚洲精品| 日韩极品在线观看| 国产拍欧美日韩视频二区| 粉嫩av一区二区三区粉嫩 | 五月开心婷婷久久| 欧美精品一级二级| 日本aⅴ亚洲精品中文乱码| 日韩欧美二区三区| 国产麻豆欧美日韩一区| 国产偷国产偷亚洲高清人白洁| 国产一区视频导航| 国产欧美日韩在线看| 成人av午夜电影| 一区二区久久久久久| 欧美日韩另类一区| 国产综合色精品一区二区三区| 国产日产亚洲精品系列| 91美女视频网站| 男女性色大片免费观看一区二区| 久久婷婷国产综合精品青草| jizzjizzjizz欧美| 亚洲成人在线免费| 国产亚洲综合在线| 在线精品亚洲一区二区不卡| 秋霞午夜av一区二区三区| 久久精品水蜜桃av综合天堂| 91精品福利视频| 国内国产精品久久| 一区二区三区欧美亚洲| 日韩视频免费观看高清在线视频| 岛国精品在线播放| 亚洲国产wwwccc36天堂| 精品免费视频.| 色婷婷综合五月| 久久99精品久久久久久国产越南| 亚洲欧美激情小说另类| 日韩精品专区在线影院观看| 91视频在线观看免费| 亚洲综合av网| 国产视频一区二区在线观看| 色综合 综合色| 国产精一区二区三区| 亚洲专区一二三| 日本一区二区三区国色天香| 在线91免费看| 色av一区二区| 国产成人免费xxxxxxxx| 美女国产一区二区| 亚洲一区视频在线观看视频| 精品福利视频一区二区三区| 色哟哟一区二区三区| 美女在线一区二区| 亚洲人精品一区| 精品国产一区二区精华| 色爱区综合激月婷婷| 久久精品国产久精国产| 国产精品国产三级国产aⅴ中文 | 亚洲成av人影院| 亚洲欧美怡红院| 欧美videos大乳护士334| 成人免费福利片| 久久99精品国产.久久久久| 亚洲在线免费播放| 亚洲视频一二三| 国产女主播视频一区二区| 日韩一区二区三区观看| 欧美日韩综合色| 色一情一伦一子一伦一区| 成人av在线一区二区三区| 国产在线精品一区在线观看麻豆| 天堂午夜影视日韩欧美一区二区| 伊人色综合久久天天人手人婷| 国产精品福利av| 中文字幕在线不卡| 国产精品理伦片| 中文字幕av一区二区三区高| 久久久久久久综合色一本| 精品国产精品网麻豆系列| 欧美大片在线观看| 欧美mv和日韩mv国产网站| 日韩精品一区二区三区老鸭窝| 欧美一区二区三区系列电影| 欧美亚洲一区二区三区四区| 91电影在线观看| 色婷婷狠狠综合| 欧美午夜片在线看| 在线观看成人免费视频| 色婷婷国产精品久久包臀| 色呦呦国产精品| 欧美日韩精品高清| 欧美福利视频导航| 欧美一激情一区二区三区| 日韩欧美不卡一区| 久久九九全国免费| 国产精品国产自产拍在线| 1000部国产精品成人观看| 亚洲欧美日韩国产一区二区三区 | 欧美日韩视频不卡| 欧美一区二区三区视频在线| 欧美日韩精品一二三区| 欧美xxxx在线观看| 国产日韩综合av| 亚洲精品视频免费看| 亚洲一区二区三区在线播放| 偷拍日韩校园综合在线| 蜜臀久久99精品久久久画质超高清 | 久久电影网电视剧免费观看| 久久精品久久精品| 国产一区二区不卡| 丁香六月综合激情| 91国产丝袜在线播放| 欧美一区二区福利在线| 久久免费国产精品 | 欧美xfplay| 亚洲欧洲另类国产综合| 亚洲高清免费观看 | 午夜伦理一区二区| 久久99精品国产麻豆婷婷| aa级大片欧美| 91精品麻豆日日躁夜夜躁| 国产精品视频第一区| 亚洲成av人综合在线观看| 国产福利精品一区二区| 色噜噜久久综合| 精品国产3级a| 亚洲成人av中文| 成人动漫在线一区| 6080yy午夜一二三区久久| 欧美激情一区二区三区全黄| 婷婷六月综合亚洲| 菠萝蜜视频在线观看一区| 欧美精品日韩精品| 国产精品乱码久久久久久| 人人超碰91尤物精品国产| 一本一本大道香蕉久在线精品| 久久一日本道色综合| 亚洲成人免费av| 波多野结衣亚洲一区| 精品日本一线二线三线不卡| 亚洲一级在线观看| 国产精品99久| 欧美一区二区播放| 一区二区三区欧美| 美女一区二区在线观看| 91福利资源站| 亚洲三级在线看| 日本va欧美va精品| 日本韩国精品在线| 国产日产亚洲精品系列| 亚洲国产精品久久久久秋霞影院| 成人网页在线观看| 久久精品亚洲国产奇米99| 麻豆极品一区二区三区| 欧美疯狂做受xxxx富婆| 亚洲欧美色综合| 成人高清av在线| 国产精品色哟哟网站| 国产一区二区美女诱惑| 91精品麻豆日日躁夜夜躁| 性感美女久久精品| 欧洲一区二区三区在线| 亚洲人成网站色在线观看| 97国产精品videossex| 亚洲欧美在线视频观看| 99久久99久久免费精品蜜臀| 国产精品每日更新| 国产 欧美在线| 日本一区二区三区电影| 国产福利91精品一区二区三区| 久久久精品欧美丰满| 国产91精品露脸国语对白| 久久人人爽爽爽人久久久| 精品一区二区三区免费| 欧美不卡激情三级在线观看| 精品无人区卡一卡二卡三乱码免费卡| 欧美一区二区三区公司| 美女在线观看视频一区二区| 日韩一二三区不卡| 韩国在线一区二区| 日本一区二区视频在线观看| www.激情成人| 亚洲最大色网站| 精品国产免费一区二区三区香蕉| 福利一区福利二区| 一区二区三区四区在线免费观看| 91精品国产品国语在线不卡| 岛国精品在线播放| 首页亚洲欧美制服丝腿|