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

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

?? sic.c

?? 軟件無線電的平臺
?? C
字號:
/*************************************************************************** *    sic.c  - Successive Interference Cancellation 2 x 2  *                           ------------------- *   begin                : 20 Aug 2003  *   authors              : Selvavinayagam Gunabalan *   emails               : selvan@kth.se ***************************************************************************//*************************************************************************** *                                Changes *                                ------- * date - name - description * 08/20/2003 - selvan - Begin * 09/16/2003 - Information bits are 'buffered out' in every iteration * 04/03/08 - ineiti - adjusted description **************************************************************************//*************************************************************************** *                                                                         * *   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.                                   * *                                                                         * ***************************************************************************//** * Successive Interference Cancellation (SIC) :-) */#include "spc.h"#include "std.h"#include <math.h>#define DBG_LVL 0typedef struct {  // The first ChEst id  int chest_1; // -1  // The second ChEst id  int chest_2; // -1  // The id of the ldpc-decoder  int ldpc; // -1  // Number of times the soft-values are iterated with LDPC before decision  int num_of_outer_loops; // 4  // Whether the data-port should be outputted on each iteration  // (for debugging and tracing purposes)  int data_always; // 0}config_t;typedef struct {  // The calculated SNR from ChEst 1  double snr_1;  // The calculated SNR from ChEst 2  double snr_2;  // The real part of some internal var  double int_re;  // The imag part of some internal var  double int_im;  int iterations;}stats_t;typedef struct {  int chest_1;  int chest_2;  int num_of_outer_loops;  int dnodes;  int iterations;  int ldpc;  int data_always;}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;  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  config->chest_1            = -1;  config->chest_2            = -1;  config->ldpc               = -1;  config->num_of_outer_loops = 4;  config->data_always        = 0;  stats->iterations          = 0;  // 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;  swr_sdb_get_config_struct( context->id, (void**)&config );  if (config->chest_1 != -1 && config->chest_2 != -1) {    private->chest_1 = config->chest_1;    private->chest_2 = config->chest_2;  } else {    PR_DBG( 4, "Channel Estimates Mandatory for this block\n" );  }  private->ldpc = config->ldpc;  private->data_always = config->data_always;  private->num_of_outer_loops = config->num_of_outer_loops;  // Definition - don't touch  swr_sdb_free_config_struct( context->id, (void**)&config );  return 0;}int spc_configure_outputs( swr_sdb_t *context ) {  config_t *config;  swr_sdb_get_config_struct( context->id, (void**)&config );  if ( size_in(0) == 0) //LDPC decoder not yet initialised  {    swr_sdb_free_config_struct( context->id, (void**)&config );    return 0;  } else {    if ( config->ldpc >= 0 ) {      private->dnodes = swr_sdb_get_stats_int( config->ldpc, "dnodes" );      PR_DBG( 4, "size_in(2) = %i, size_out(0) = %i, dnodes = %i, new_size_out = %i\n",              size_in(2), size_out(0), private->dnodes,              private->dnodes / 2 );      size_out(0) = private->dnodes / 2;    } else {      size_out(0) = 0;    }    size_out(1) = size_in(0);  }  swr_sdb_free_config_struct( context->id, (void**)&config );  return 0;}/* * 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_ant1, *in_ant2, *out_data, *out_decode;  SYMBOL_COMPLEX h11,h12,h21,h22;  double_complex *in_ldpc;  double int1mag,int1_re, int1_im,a,b,c;  double var_int_noise1, var_int_noise2;  double var_xhat_1, var_xhat_2;  int re1, im1, re2, im2;  block_t h1,h2;  int i;  double snr_1 = 1.;  double snr_2 = 1.;  int noise_var1 = 10;  int noise_var2 = 10;  PR_DBG( 4, "Inputs: %i, %i, %i\n",          data_available(0), data_available(1), data_available(2) );  if((!data_available(1) || !data_available(2))  && !data_available(0) ) {    PR_DBG( 3, "No data on any of the inputs\n" );    return 0;  }  in_ldpc = buffer_in( 0 );  if( data_available(1) ) {    //This cond is true only in the first iteration.    //Bcos of the flag reset by the following buffer_in macro    PR_DBG( 3, "Going to clear memory\n" );    memset(in_ldpc, 0, size_in(0) * sizeof( double_complex ) );    private->iterations = 0;    // This resets the ldpc-decoder    swr_sdb_send_msg( private->ldpc, SUBS_MSG_RECONFIG, NULL, -1 );  }  in_ant1 = buffer_in( 1 );  in_ant2 = buffer_in( 2 );  //Get the channel coefficients h11,h12,h21,h22,noise variances from the chest blocks  //Data will not be available on the first output in the first iteration  //Since the first iteration does not contain the estimated symbol  out_data = NULL;  out_decode = NULL;  //this if is necessary for the termination of the outer loop  PR_DBG( 4, "Doing iteration %i\n", private->iterations);  h1 = swr_sdb_get_stats_block( private->chest_1, "channel" );  h2 = swr_sdb_get_stats_block( private->chest_2, "channel" );  noise_var1 = swr_sdb_get_stats_int( private->chest_1, "noise_var" );  noise_var2 = swr_sdb_get_stats_int( private->chest_2, "noise_var" );  h11.real = ((SYMBOL_COMPLEX *)h1.data)->real;  h11.imag = ((SYMBOL_COMPLEX *)h1.data)->imag;  //16 -> channel Length, to be Generalized  h12.real = ((SYMBOL_COMPLEX *)h1.data + 16)->real;  h12.imag = ((SYMBOL_COMPLEX *)h1.data + 16)->imag;  h21.real = ((SYMBOL_COMPLEX *)h2.data)->real;  h21.imag = ((SYMBOL_COMPLEX *)h2.data)->imag;  h22.real = ((SYMBOL_COMPLEX *)h2.data + 16)->real;  h22.imag = ((SYMBOL_COMPLEX *)h2.data + 16)->imag;  int1_re =  h11.real * h12.real + h11.imag * h12.imag +             h21.real * h22.real + h21.imag * h22.imag;  int1_im =  h11.real * h12.imag - h11.imag * h12.real +             h21.real * h22.imag - h21.imag * h22.real;  PR_DBG(4,"h11=%i+j%i  h12=%i+j%i  h21=%i+j%i  h22=%i+j%i\n",         h11.real,h11.imag,h12.real,h12.imag,h21.real,h21.imag,h22.real,h22.imag);  //dumb loops, MMX,sse optimizations later  if ( ++private->iterations <= private->num_of_outer_loops ) {    PR_DBG( 4, "Calculating loop: %i\n", private->iterations );    out_decode = buffer_out(1);    for (i = 0; i < size_out( 1 )/2 ; i++ ) {      a  = h11.real * in_ant1[ i ].real + h11.imag * in_ant1[ i ].imag;      b  = h21.real * in_ant2[ i ].real + h21.imag * in_ant2[ i ].imag;      c  = in_ldpc[ 2*i + 1].real;      re1 = a + b - c;      PR_DBG(4,"Real:\na = %g\n b =%g\n c =%g\n", a, b, c);      a  = h11.real * in_ant1[ i ].imag - h11.imag * in_ant1[ i ].real;      b  = h21.real * in_ant2[ i ].imag - h21.imag * in_ant2[ i ].real;      c  = in_ldpc[ 2*i + 1].imag;      im1 = a + b - c;      PR_DBG(4,"Img:\na = %g\n b =%g\n c =%g\n", a, b, c);      re2 = h12.real * in_ant1[ i ].real + h12.imag * in_ant1[ i ].imag            + h22.real * in_ant2[ i ].real + h22.imag * in_ant2[ i ].imag            - in_ldpc[ 2*i ].real;      im2 = h12.real * in_ant1[ i ].imag - h12.imag * in_ant1[ i ].real            + h22.real * in_ant2[ i ].imag - h22.imag * in_ant2[ i ].real            - in_ldpc[ 2*i ].imag;      out_decode[2*i].real = re1 >> 12;      out_decode[2*i].imag = im1 >> 12;      out_decode[2*i+1].real = re2 >> 12;      out_decode[2*i+1].imag = im2 >> 12;    }    // If it's the last iteration, or if we have data_always, we fill the    // data-output    if ( ( private->iterations == private->num_of_outer_loops ) ||         ( private->data_always ) ) {      out_data = buffer_out(0);      memcpy(out_data,out_decode,size_out(0)*sizeof(SYMBOL_COMPLEX));      PR_DBG(4,"In sic module for loop, %i,%i",out_data[0].real,private->iterations);    }    // If it's the last iteration, don't allow the decoder to work    if ( private->iterations == private->num_of_outer_loops ) {      buffer_out_clr( 1 );    }  }  var_xhat_1 = swr_sdb_get_stats_double( private->ldpc, "var_xhat_1" );  var_xhat_2 = swr_sdb_get_stats_double( private->ldpc, "var_xhat_2" );  int1mag = int1_re * int1_re  + int1_im * int1_im;  a  = ( 1 - var_xhat_2) * int1mag;  b  = (double)noise_var1 * ( h11.real * h11.real + h11.imag * h11.imag );  c  = (double)noise_var2 * ( h21.real * h21.real + h21.imag * h21.imag );  var_int_noise1  = a + b + c;  PR_DBG(4,"\n a = %g \n b =%g \n c=%g \n noise_var= %i \n"         " h11.real = %i \n h11.imag = %i \n h21.real =%i \n h21.imag = %i \n"         " var_int_noise1 = %g\n bagain = %g\n",         a,b,c,noise_var1,h11.real,h11.imag,h21.real,h21.imag,         var_int_noise1, (double)noise_var1 * ( h11.real * h11.real +                                                h11.imag * h11.imag ));  a  = ( 1 - var_xhat_1) * int1mag;  b  = (double)noise_var1 * ( h12.real * h12.real + h12.imag * h12.imag );  c  = (double)noise_var2 * ( h22.real * h22.real + h22.imag * h22.imag );  var_int_noise2  = a + b + c;  PR_DBG(4,"\n a = %g \n b =%g \n c=%g \n var_int_noise2 = %g\n",         a,b,c, var_int_noise2);  snr_1   = (h11.real * h11.real + h11.imag * h11.imag +             h21.real * h21.real + h21.imag * h21.imag);  snr_2   = (h12.real * h12.real + h12.imag * h12.imag +             h22.real * h22.real + h22.imag * h22.imag);  PR_DBG( 4," Var_xhat_1 = %g \n Var_xhat_2 = %g \n snr_1 = %g\n snr_2 = %g\n  int1mag = %g\n noise_var1 = %i\n noise_var2 = %i\n",var_xhat_1,var_xhat_2,snr_1,snr_2,int1mag,noise_var1,noise_var2);  PR_DBG( 3," %g \t  %g ;\n",var_xhat_1,var_xhat_2);  swr_sdb_get_stats_struct( context->id, (void**)&stats );  stats->snr_1 = snr_1 / var_int_noise1;  stats->snr_2 = snr_2 / var_int_noise2;  stats->int_re = int1_re;  stats->int_im = int1_im;  stats->iterations = private->iterations;  PR_DBG( 4,"snr_1 = %g   snr_2 = %g\n", stats->snr_1,stats->snr_2);  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( 3, 2, 5, 5 );  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( "chest_1" );  UM_CONFIG_INT( "chest_2" );  UM_CONFIG_INT( "ldpc" );  UM_CONFIG_INT( "num_of_outer_loops" );  UM_CONFIG_INT( "data_always" );  UM_STATS_DOUBLE( "snr_1" );  UM_STATS_DOUBLE( "snr_2" );  UM_STATS_DOUBLE( "int_re" );  UM_STATS_DOUBLE( "int_im" );  UM_STATS_INT( "iterations" );  /*   * 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_DOUBLE_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 );  // 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_outputs = spc_configure_outputs;  // And register the module in the SPM. Change the name!  cdb_id = swr_cdb_register_spc( &desc, "sic" );  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一区二区三区免费野_久草精品视频
高清在线不卡av| 日韩高清不卡一区二区| 亚洲国产精品一区二区久久| 韩国女主播成人在线观看| 欧美曰成人黄网| 中文字幕精品—区二区四季| 石原莉奈在线亚洲三区| 99精品视频一区二区三区| 2021中文字幕一区亚洲| 欧美精品99久久久**| 久久久久久影视| 欧美a一区二区| 欧美三级中文字幕在线观看| 亚洲美女免费视频| 成人av资源站| 欧美激情一区二区在线| 国产成人自拍网| 精品福利一区二区三区免费视频| 亚洲国产一区二区视频| 91美女片黄在线观看| 综合色中文字幕| 国产一区二区三区免费在线观看| 7777精品久久久大香线蕉| 亚洲成在线观看| 欧美日韩精品一区二区| 亚洲第一狼人社区| 欧美日韩国产综合一区二区| 亚洲国产综合在线| 欧美色图在线观看| 亚洲1区2区3区4区| 欧美丝袜第三区| 亚洲成人在线免费| 91麻豆精品国产自产在线| 亚洲一级片在线观看| 欧美日本在线一区| 蜜芽一区二区三区| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 欧美日韩精品一区二区在线播放| 亚洲欧美日韩电影| 欧美日韩国产一区二区三区地区| 五月婷婷久久丁香| 精品国产成人在线影院| 豆国产96在线|亚洲| ...av二区三区久久精品| 色综合久久久久| 亚洲大片一区二区三区| 日韩精品一区二区三区视频播放| 国产真实乱偷精品视频免| 亚洲国产精品二十页| 色婷婷综合久色| 免费视频一区二区| 欧美国产欧美综合| 精品污污网站免费看| 日本欧美大码aⅴ在线播放| 精品国产乱码久久久久久久久| 高清不卡在线观看| 亚洲综合视频网| 精品对白一区国产伦| 99国产精品视频免费观看| 日韩在线一二三区| 2017欧美狠狠色| 欧美在线看片a免费观看| 久久99精品国产.久久久久久| 国产嫩草影院久久久久| 在线精品观看国产| 国产九九视频一区二区三区| 一区二区三区在线免费观看| 日韩精品专区在线| 91麻豆自制传媒国产之光| 久久精品噜噜噜成人av农村| 中文字幕一区二区三区精华液| 欧美日韩不卡在线| av电影在线观看完整版一区二区| 日韩成人免费看| 亚洲丝袜精品丝袜在线| 日韩午夜激情免费电影| 一本高清dvd不卡在线观看| 韩国三级在线一区| 婷婷国产在线综合| 国产精品超碰97尤物18| 日韩免费电影网站| 在线观看91视频| 成人18视频在线播放| 日本女人一区二区三区| 一区二区三区在线视频观看| 欧美激情综合五月色丁香| 91精品在线一区二区| 在线观看视频91| 成人av综合在线| 韩国精品主播一区二区在线观看 | 亚洲综合999| 国产精品高潮呻吟久久| 精品嫩草影院久久| 欧美一级久久久久久久大片| 欧美在线观看一区二区| 99麻豆久久久国产精品免费| 高清不卡在线观看| 国产91精品一区二区麻豆网站 | 国产亚洲欧美激情| 欧美v亚洲v综合ⅴ国产v| 制服丝袜亚洲网站| 欧美手机在线视频| 欧美综合一区二区三区| 在线观看不卡一区| 欧美性感一类影片在线播放| 91久久国产综合久久| 日本精品一区二区三区高清| 91麻豆精品秘密| 91视频免费播放| 9i在线看片成人免费| 99国产麻豆精品| 91亚洲精品乱码久久久久久蜜桃| a在线欧美一区| 99免费精品视频| 色婷婷久久久久swag精品 | 色综合欧美在线视频区| av在线播放一区二区三区| 成人激情免费网站| 9人人澡人人爽人人精品| 91网站最新地址| 日本丰满少妇一区二区三区| 91成人在线观看喷潮| 精品视频123区在线观看| 欧美美女网站色| 日韩久久免费av| 欧美—级在线免费片| 亚洲欧美日韩国产手机在线| 一二三区精品视频| 爽好多水快深点欧美视频| 蓝色福利精品导航| 国产不卡在线一区| 色哟哟欧美精品| 欧美日韩一级大片网址| 日韩精品影音先锋| 国产精品天干天干在观线| 一二三四社区欧美黄| 日韩av一区二区在线影视| 国产成人精品免费在线| 在线一区二区三区四区五区 | 9191精品国产综合久久久久久| 7777精品伊人久久久大香线蕉完整版| 日韩欧美中文字幕精品| 国产女人18毛片水真多成人如厕 | 亚洲一二三四久久| 蜜桃av噜噜一区二区三区小说| 国产馆精品极品| 欧美性大战久久久| 久久久国产精品午夜一区ai换脸| 亚洲女同一区二区| 久久99久久久久久久久久久| 不卡一区中文字幕| 欧美一卡二卡在线观看| 日韩毛片一二三区| 韩国在线一区二区| 在线视频中文字幕一区二区| 久久网站最新地址| 亚洲国产日韩a在线播放| 国产精品1区2区| 欧美精品一二三| 亚洲欧美日韩电影| 国产精品一区二区在线看| 欧美精品第1页| 成人免费小视频| 国产一区二区三区四| 欧美日韩国产高清一区二区| 国产精品视频观看| 免费看日韩a级影片| 欧美在线观看视频在线| 国产精品免费丝袜| 老司机精品视频在线| 欧美在线999| 亚洲三级电影网站| 成人免费视频播放| 久久欧美一区二区| 日产精品久久久久久久性色| 在线观看一区日韩| 国产精品国产三级国产aⅴ中文| 狠狠色2019综合网| 制服丝袜亚洲色图| 亚洲午夜久久久久久久久久久| 不卡视频免费播放| 国产欧美一区二区精品婷婷| 欧美aaa在线| 日韩一级片在线观看| 天堂一区二区在线| 欧美乱熟臀69xxxxxx| 亚洲大片精品永久免费| 欧美亚洲综合色| 亚洲一区二三区| 欧洲日韩一区二区三区| 亚洲精品免费在线观看| 色呦呦日韩精品| 亚洲制服丝袜av| 91久久精品国产91性色tv| 亚洲综合视频在线观看| 91国产成人在线| 亚洲大尺度视频在线观看| 欧美日韩国产大片| 青青草国产成人av片免费| 欧美一区二区在线观看|