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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? block_complex.c

?? 軟件無線電的平臺
?? C
字號:
/*************************************************************************** *    block_mimo.c  - Define a MIMO-block with complex input and output *                           ------------------- *   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 * 04/03/03 - ineiti - added border-zone for input and output * 04/03/04 - ineiti - changed config-structure (arrays instead of variables) * 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 module gives a general 2x2 MIMO block with definable * channel-matrix h and noise-variance sigma. *  Additionally to the size, a precision in bits can be given, * too. This precision is used to cut off the transmitted signal, * which simulates a perfect channel, but with some error due to the * A/D converters. */#include <stdlib.h>#include "spc.h"#define DBG_LVL 0#define RX_TX_DELAY 10#define MALLOC_BORDER 256typedef struct {  // The number of symbols of the block  int size;      // 2560  // The precision of the A/D converter  int precision; // 12    // The variance of the gaussian noise at the receiver  complex double sigma[2]; // 100 + 100j  // The channel matrix  complex double h[2][2]; // identity}config_t;typedef struct {}stats_t;typedef struct {  int size;  int mask;  double sigma_1_real;  double sigma_1_imag;  double sigma_2_real;  double sigma_2_imag;  unsigned short simrand[3];  double h11_real;  double h11_imag;  double h12_real;  double h12_imag;  double h21_real;  double h21_imag;  double h22_real;  double h22_imag;  SYMBOL_COMPLEX *in[2], *out[2];}private_t;/* * The initialisation function, or constructor, * is called the first time this module is instantiated. */int spc_init( swr_sdb_t *context ) {  // Begin system-definitions {  config_t *config;  stats_t *stats;  int i, j;  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;  for ( i=0; i<2; i++ ){    port_in(i).flags |= SWR_PORT_OWN_MALLOC;    port_in(i).data = 0;    port_out(i).flags |= SWR_PORT_OWN_MALLOC;    port_out(i).data = 0;    private->in[i] = private->out[i] = NULL;  }  // We set the standard UMTS-size for the slot  config->size = 2560;  config->precision = 12;  for ( i=0; i<2; i++ ){    config->sigma[i] = 100 + 100 * I;     // Channel parameters    for ( j=0; j<2; j++ ){      config->h[i][j] = i == j;    }  }  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 i;  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 );    for ( i=0; i<2; i++ ){      size_in(i) = config->size;      size_out(i) = config->size;      if ( private->size ){	swr_free( private->in[i] );	swr_free( private->out[i] );      }            private->in[i] = swr_malloc( ( config->size + 2 * MALLOC_BORDER ) *				   sizeof( SYMBOL_COMPLEX ) );      port_in(i).data = private->in[i] + MALLOC_BORDER;            private->out[i] = swr_malloc( ( config->size + 2 * MALLOC_BORDER ) *				 sizeof( SYMBOL_COMPLEX ) );      port_out(i).data = private->out[i] + MALLOC_BORDER;    }    private->size = config->size;  }  private->mask = -1 << ( 16 - config->precision );  private->sigma_1_real = creal( config->sigma[0] );  private->sigma_1_imag = cimag( config->sigma[0] );  private->sigma_2_real = creal( config->sigma[1] );  private->sigma_2_imag = cimag( config->sigma[1] );  private->h11_real   = creal( config->h[0][0] );  private->h11_imag   = cimag( config->h[0][0] );  private->h12_real   = creal( config->h[0][1] );  private->h12_imag   = cimag( config->h[0][1] );  private->h21_real   = creal( config->h[1][0] );  private->h21_imag   = cimag( config->h[1][0] );  private->h22_real   = creal( config->h[1][1] );  private->h22_imag   = cimag( config->h[1][1] );    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;}/* * 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 *in1, *out1;  SYMBOL_COMPLEX *in2, *out2;  int i, re, im;  double h11_real;  double h11_imag;  double h12_real;  double h12_imag;  double h21_real;  double h21_imag;  double h22_real;  double h22_imag;  double a, sigma_max_1, sigma_max_2;  if ( !data_available(0) || !data_available(1) ) {    if ( port_in(0).sdb_id >= 0 && port_in(1).sdb_id >= 0 ){      PR_DBG( 4, "Not all data here yet\n" );      return 0;    } else if ( data_available(0) ){      in1  = in2 = buffer_in(0);      out1 = out2 = buffer_out(0);    } else {      PR_DBG( 4, "No data available. Strange\n" );      return 0;    }  } else {    PR_DBG( 4, "Data is here, going on\n" );    // Just to transmit the PORT_DATA flag from the input    // to the output    in1  = buffer_in(0);    out1 = buffer_out(0);    in2  = buffer_in(1);    out2 = buffer_out(1);  }  h11_real   = private->h11_real;  h11_imag   = private->h11_imag;  h12_real   = private->h12_real;  h12_imag   = private->h12_imag;  h21_real   = private->h21_real;  h21_imag   = private->h21_imag;  h22_real   = private->h22_real;  h22_imag   = private->h22_imag;  sigma_max_1 = max( private->sigma_1_real, private->sigma_1_imag );  sigma_max_2 = max( private->sigma_2_real, private->sigma_2_imag );  a = ( ( 1 << 15 ) - 3 * max( sigma_max_1, sigma_max_2 ) ) / ( 4 * ( 1 << 15 ) );  PR_DBG( 4, "A is %f, mask is %x\n", a, private->mask );    if ( private->size ) {    for ( i=0; i<private->size; i++ ) {      re = (   ( h11_real * in1->real )	     - ( h11_imag * in1->imag )	     + ( h12_real * in2->real )	     - ( h12_imag * in2->imag ) ) * a	   + getSigma( context, private->sigma_1_real );      im = (   ( h11_imag * in1->real )	     + ( h11_real * in1->imag )	     + ( h12_imag * in2->real )	     + ( h12_real * in2->imag ) ) * a	   + getSigma( context, private->sigma_1_imag );      re = max( re, -1 << 15 );      re = min( re,  1 << 15 );      im = max( im, -1 << 15 );      im = min( im,  1 << 15 );      out1->real = re & private->mask;      out1->imag = im & private->mask;      re = (   ( h21_real * in1->real )	     - ( h21_imag * in1->imag )	     + ( h22_real * in2->real )	     - ( h22_imag * in2->imag ) ) * a	   + getSigma( context, private->sigma_2_real );      im = (   ( h21_imag * in1->real )	     + ( h21_real * in1->imag )	     + ( h22_imag * in2->real )	     + ( h22_real * in2->imag ) ) * a	   + getSigma( context, private->sigma_2_imag );      re = max( re, -1 << 15 );      re = min( re,  1 << 15 );      im = max( im, -1 << 15 );      im = min( im,  1 << 15 );      out2->real = re & private->mask;      out2->imag = im & private->mask;      in1++;      in2++;      out1++;      out2++;    }  }  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( 2, 2, 14, 0 );  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( "sigma_1_real" );  UM_CONFIG_DOUBLE( "sigma_1_imag" );  UM_CONFIG_DOUBLE( "sigma_2_real" );  UM_CONFIG_DOUBLE( "sigma_2_imag" );  UM_CONFIG_DOUBLE( "h11_real" );  UM_CONFIG_DOUBLE( "h11_imag" );  UM_CONFIG_DOUBLE( "h12_real" );  UM_CONFIG_DOUBLE( "h12_imag" );  UM_CONFIG_DOUBLE( "h21_real" );  UM_CONFIG_DOUBLE( "h21_imag" );  UM_CONFIG_DOUBLE( "h22_real" );  UM_CONFIG_DOUBLE( "h22_imag" );  /**   * 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_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;  // And register the module in the SPM. Change the name!  cdb_id = swr_cdb_register_spc( &desc, "block_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一区二区三区免费野_久草精品视频
欧美成人aa大片| 白白色 亚洲乱淫| 欧美大片一区二区三区| 免费成人av资源网| 久久久久久夜精品精品免费| 国产高清在线观看免费不卡| 欧美激情在线观看视频免费| 91免费在线播放| 亚洲午夜国产一区99re久久| 日韩三级av在线播放| 国产sm精品调教视频网站| 国产精品电影院| 欧美日韩中文字幕一区| 蜜臀av一区二区三区| 久久精品一区二区三区不卡牛牛 | 精品一区二区三区不卡| 国产无遮挡一区二区三区毛片日本| 成人成人成人在线视频| 亚洲影院理伦片| 日韩欧美亚洲一区二区| 国产99久久久国产精品| 亚洲精品综合在线| 91精品久久久久久蜜臀| 粉嫩一区二区三区性色av| 亚洲综合色婷婷| www久久精品| 色哦色哦哦色天天综合| 精品中文字幕一区二区| 亚洲精品免费在线播放| 91精品国产91综合久久蜜臀| 成人激情校园春色| 日韩一区精品视频| 国产精品美女久久久久久久网站| 欧美另类高清zo欧美| 成人av免费观看| 日韩不卡一区二区三区| 综合中文字幕亚洲| 日韩精品中文字幕在线不卡尤物 | 天天免费综合色| 国产午夜久久久久| 欧美一级视频精品观看| 99国产欧美另类久久久精品 | 午夜精品一区在线观看| 国产欧美精品日韩区二区麻豆天美| 欧美午夜精品久久久久久超碰| 国产成人免费9x9x人网站视频| 婷婷开心激情综合| 亚洲精品视频在线观看网站| 久久久久久久久一| 日韩一区二区三区av| 色综合天天在线| 国产福利一区在线观看| 奇米影视7777精品一区二区| 一区二区视频在线| 国产精品天美传媒沈樵| 久久久久久久电影| 精品女同一区二区| 91精品国产品国语在线不卡| 在线观看免费一区| 91婷婷韩国欧美一区二区| 成人午夜电影小说| 国产一区二区三区四区在线观看| 日韩精品电影在线| 日韩在线一区二区三区| 亚洲国产日韩一级| 亚洲午夜av在线| 亚洲精品成人在线| 亚洲人成网站精品片在线观看 | 欧美草草影院在线视频| 91精品国产91久久综合桃花 | 国产一区二区三区免费在线观看 | 国产ts人妖一区二区| 激情文学综合丁香| 精品亚洲国内自在自线福利| 美女免费视频一区二区| 免费观看日韩av| 久久国产精品99精品国产| 日韩激情一二三区| 日本成人超碰在线观看| 日韩专区一卡二卡| 蜜臀va亚洲va欧美va天堂| 另类小说一区二区三区| 国内偷窥港台综合视频在线播放| 久久成人18免费观看| 国内久久婷婷综合| 懂色一区二区三区免费观看| 成人精品gif动图一区| 91在线国内视频| 91传媒视频在线播放| 欧美日韩国产首页| 91精品国产综合久久蜜臀| 日韩精品一区二区三区中文精品| 精品福利av导航| 国产精品免费丝袜| 亚洲人成在线播放网站岛国| 亚洲不卡av一区二区三区| 久久精品国产一区二区| 国产成人激情av| 91免费看`日韩一区二区| 欧美性猛交xxxx乱大交退制版| 欧美日韩精品欧美日韩精品 | 欧美国产日韩一二三区| 亚洲人成伊人成综合网小说| 亚洲v日本v欧美v久久精品| 蜜桃一区二区三区在线观看| 高清beeg欧美| 欧美视频在线一区二区三区| 日韩一级完整毛片| 中国av一区二区三区| 亚洲福利视频导航| 国产一区二区三区视频在线播放| 91免费看视频| 精品理论电影在线观看| 亚洲三级免费电影| 捆绑调教美女网站视频一区| av中文一区二区三区| 欧美高清一级片在线| 国产精品久久久久三级| 日韩国产成人精品| 成人aa视频在线观看| 欧美一区二区在线视频| 国产精品每日更新在线播放网址 | 91蜜桃在线免费视频| 日韩午夜激情av| 樱花草国产18久久久久| 狠狠久久亚洲欧美| 欧美专区亚洲专区| 国产日韩欧美不卡| 玖玖九九国产精品| 在线免费不卡电影| 久久综合色鬼综合色| 亚洲尤物在线视频观看| 成人黄色免费短视频| 欧美大片免费久久精品三p| 自拍偷拍亚洲综合| 国产在线视视频有精品| 欧美日韩第一区日日骚| 亚洲麻豆国产自偷在线| 丰满放荡岳乱妇91ww| 精品福利二区三区| 日韩国产成人精品| 欧美日韩精品一区二区三区四区| 国产精品福利一区| 国产成人鲁色资源国产91色综| 日韩午夜激情av| 日韩制服丝袜av| 欧美三级电影精品| 亚洲欧美区自拍先锋| www.欧美亚洲| 中文字幕一区二区视频| 国产成人av一区二区三区在线观看| 日韩限制级电影在线观看| 亚洲午夜视频在线| 欧美在线视频不卡| 亚洲综合av网| 日本电影欧美片| 亚洲欧美一区二区三区国产精品 | 日本亚洲天堂网| 欧美日韩一区二区在线观看| 亚洲精品网站在线观看| 91色porny| 亚洲一区二区五区| 欧美系列日韩一区| 亚洲国产日韩在线一区模特| 色乱码一区二区三区88| 亚洲精品一二三四区| 色哟哟日韩精品| 亚洲成人免费看| 欧美精品精品一区| 免播放器亚洲一区| 欧美一区二区黄| 国产一区二区在线视频| 国产欧美日韩在线| 成人黄页在线观看| 亚洲精品免费在线观看| 欧美三级电影在线看| 五月综合激情婷婷六月色窝| 在线成人高清不卡| 精品一区二区三区的国产在线播放 | 久久综合久色欧美综合狠狠| 国产一区二区三区四区五区入口| 国产亚洲一区字幕| 99天天综合性| 亚洲高清不卡在线| 精品女同一区二区| 国产suv一区二区三区88区| 亚洲免费在线看| 欧美军同video69gay| 激情综合网最新| 中文字幕在线不卡一区| 欧美一a一片一级一片| 秋霞国产午夜精品免费视频| 久久久噜噜噜久噜久久综合| 91小视频免费观看| 三级成人在线视频| 久久亚洲综合色一区二区三区| 成人av网址在线观看| 婷婷综合另类小说色区| 久久精品免视看| 欧美日韩另类国产亚洲欧美一级|