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

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

?? block_complex.c

?? This a framework to test new ideas in transmission technology. Actual development is a LDPC-coder in
?? 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一区二区三区免费野_久草精品视频
亚洲在线成人精品| 91视频在线看| 成人深夜视频在线观看| 国产成人免费视频网站 | 石原莉奈在线亚洲二区| 蜜臀av一区二区在线免费观看| 国产一区二区精品在线观看| 欧美日韩成人高清| 久久九九99视频| 偷窥少妇高潮呻吟av久久免费 | 一区二区三区四区国产精品| 日韩精品成人一区二区三区| 久久国产精品色| 欧美日韩国产首页| 国产精品久久久久久福利一牛影视| 亚洲欧洲精品一区二区精品久久久 | 亚洲精品一二三四区| 蜜桃精品在线观看| 欧美日韩国产精品成人| 国产精品久久久久久一区二区三区| 亚洲国产日产av| 色老汉av一区二区三区| 久久午夜羞羞影院免费观看| 免费看欧美女人艹b| 欧美综合色免费| 欧美mv日韩mv国产网站| 麻豆精品久久精品色综合| 日本韩国欧美国产| 亚洲蜜臀av乱码久久精品蜜桃| 黄色日韩三级电影| 日韩免费视频线观看| 亚洲国产精品一区二区久久恐怖片| 9人人澡人人爽人人精品| 欧美国产成人精品| 国产成人夜色高潮福利影视| 亚洲精品一区二区三区精华液 | 国产一二三精品| 91精品国产色综合久久不卡蜜臀| 亚洲福利视频三区| 欧美亚洲禁片免费| 伊人夜夜躁av伊人久久| 欧美偷拍一区二区| 一区二区三区四区亚洲| 日本韩国一区二区三区视频| 最新热久久免费视频| 色婷婷国产精品综合在线观看| 午夜精品福利一区二区三区蜜桃| 91精品办公室少妇高潮对白| 亚洲午夜免费电影| 色狠狠一区二区| 麻豆一区二区三区| 久久综合九色综合97婷婷| 懂色av中文一区二区三区| 欧美韩日一区二区三区| 国精产品一区一区三区mba桃花| 国产欧美日韩麻豆91| 国产精品自拍在线| 亚洲精品第一国产综合野| 欧美性生活久久| 婷婷丁香久久五月婷婷| 日韩一区国产二区欧美三区| 精品在线免费视频| 国产蜜臀av在线一区二区三区| 国产91精品久久久久久久网曝门 | 亚洲日本护士毛茸茸| 欧美色男人天堂| 毛片av一区二区三区| 亚洲欧洲成人精品av97| 欧美在线观看一区二区| 激情综合网天天干| 国产精品久久久久久久久晋中 | 久久免费美女视频| 国产精品一二二区| 亚洲国产另类精品专区| 欧美一区二区三区影视| 国产综合一区二区| 亚洲18色成人| 久久影视一区二区| 欧美日韩国产免费| 国产东北露脸精品视频| 性感美女久久精品| 久久免费视频色| 久久av中文字幕片| 亚洲午夜视频在线观看| 欧美大黄免费观看| 欧美亚洲禁片免费| 激情六月婷婷综合| 亚洲成va人在线观看| 2022国产精品视频| 51精品秘密在线观看| 成人黄色免费短视频| 亚洲精品乱码久久久久久 | 久久久久久久久久久电影| 99国产欧美另类久久久精品| 七七婷婷婷婷精品国产| 成人欧美一区二区三区1314| 欧美大胆一级视频| 欧美午夜精品电影| 粉嫩绯色av一区二区在线观看| 日韩av中文在线观看| 国产精品美女一区二区| 久久日韩精品一区二区五区| 色婷婷久久久亚洲一区二区三区| 国产成人免费在线观看| 秋霞成人午夜伦在线观看| 亚洲激情在线播放| 国产精品视频观看| 精品国产成人在线影院| 日韩免费性生活视频播放| 91美女视频网站| 91麻豆文化传媒在线观看| 国产一区二区看久久| 国产在线一区二区| 日韩中文字幕一区二区三区| 国产精品嫩草久久久久| 欧美精品一区二区三区在线播放 | 日韩女优电影在线观看| 99国产精品国产精品久久| 成人aa视频在线观看| 国模大尺度一区二区三区| 麻豆一区二区99久久久久| 婷婷国产在线综合| 日韩精品1区2区3区| 五月婷婷综合在线| 精品久久国产97色综合| 久久综合狠狠综合久久综合88| 91麻豆精品国产自产在线观看一区| 这里只有精品视频在线观看| 欧美网站一区二区| 欧美一区二区高清| 日韩写真欧美这视频| 久久精品一级爱片| 国产欧美日韩综合| 中文字幕佐山爱一区二区免费| 亚洲欧洲色图综合| 欧美经典一区二区三区| 国产欧美一区二区精品忘忧草| 国产日韩欧美一区二区三区综合| 国产精品欧美一级免费| 日韩伦理电影网| 丝袜美腿高跟呻吟高潮一区| 日本成人在线不卡视频| 国产精品1区二区.| www.欧美亚洲| 9191成人精品久久| 欧美大片拔萝卜| 自拍偷在线精品自拍偷无码专区| 亚洲精品少妇30p| 久久精品国产一区二区| 国产福利91精品一区| 国产传媒久久文化传媒| 欧美视频完全免费看| 日韩女优视频免费观看| 欧美激情综合五月色丁香 | 久久久久久久久蜜桃| 中文字幕一区二区三区在线不卡 | 国产精品亚洲一区二区三区妖精| 国产一区欧美一区| 欧美午夜不卡在线观看免费| 在线成人小视频| 一区在线观看免费| 亚洲va在线va天堂| 成人h版在线观看| 欧美日韩国产美女| 亚洲日本va在线观看| 天天av天天翘天天综合网| 国产 日韩 欧美大片| 欧美天天综合网| 国产亚洲一区二区三区在线观看| 亚洲免费在线观看| 日韩中文字幕区一区有砖一区 | 久久久综合激的五月天| 亚洲综合一二区| 成人小视频免费观看| 欧美日韩中文字幕精品| 中文字幕一区二区在线播放 | 亚洲精品成人天堂一二三| 日韩国产精品91| 不卡一区二区在线| 制服.丝袜.亚洲.另类.中文| 欧美激情一区二区三区| 蜜桃av一区二区| 一道本成人在线| 精品国产欧美一区二区| 亚洲成人你懂的| 99久久伊人网影院| 久久九九99视频| 久久国产精品99久久人人澡| 欧美日韩国产精品自在自线| 亚洲婷婷国产精品电影人久久| 成人免费视频一区| 日韩免费福利电影在线观看| 天天综合网 天天综合色| 99久久国产综合精品色伊| 国产日韩欧美在线一区| 久久99国产精品免费| 日韩欧美中文字幕精品| 亚洲一区二区三区三| 91福利视频网站| 亚洲精品乱码久久久久久久久|