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

📄 test_ofdm.c

📁 This a framework to test new ideas in transmission technology. Actual development is a LDPC-coder in
💻 C
字号:
/***************************************************************************              test_ofdm.c  -  Tests the OFDM-module                            -------------------    begin                :  2003/05/26    authors              :  Linus Gasser    emails               :  linus.gasser@epfl.ch ***************************************************************************//***************************************************************************                                 Changes                                 ------- date - name - description 03/05/26 - ineiti - begin 04/03/03 - ineiti - added a small 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.                                   * *                                                                         * ***************************************************************************/char desc[] ="Description:\n""Runs the OFDM-modules 10 times and shows the time-statistics of the\n""calls. This can be used to compare to a 'matched_filter', which\n""includes a FFT made with MMX-instructions.\n\n";#include "spc.h"#include "std.h"#define DBG_LVL 4#define SIZE_POT 8#define DATA_LEN ( 1 << SIZE_POT )struct chain_t *test_chain;void *start_it( void *arg ) {  swr_sdb_id source, sink, ofdm_send, ofdm_rcv, block;  SYMBOL_COMPLEX *data;  int i;  // Create a chain from a complex source to a complex sink  test_chain = swr_chain_create( NEW_SPC_VAR_OUT( "source", source, 1 ),                                 NEW_SPC_VAR( "ofdm_send", ofdm_send ),                                 NEW_SPC( "midamble" ),                                 NEW_SPC( "rrc" ),                                 NEW_SPC_VAR( "block", block ),                                 NEW_SPC( "matched_filter" ),                                 NEW_SPC_VAR("ofdm_rcv",ofdm_rcv),                                 NEW_SPC_VAR_IN( "sink", sink, 1 ),                                 CHAIN_END );  // Allocate some dat  data = swr_malloc( sizeof( SYMBOL_COMPLEX ) * DATA_LEN );  for ( i=0; i<DATA_LEN; i++ ) {    data[i].real = 32;    data[i].imag = 1;  }  // Set the data-pointer in the source-module  swr_sdb_set_config_pointer( source, "data", data );  swr_sdb_set_config_int( source, "len", DATA_LEN );  swr_sdb_set_config_int( source, "complex_type", 1 );  // Set the correct size in the block  swr_sdb_set_config_int( block, "size", DATA_LEN * 4 + 580 );  // Get the sink to output nothing  swr_sdb_set_config_int( sink, "flag_complex", 0 );  // Set up the ofdm_send  swr_sdb_set_config_int( ofdm_send, "size_pot", SIZE_POT );  swr_sdb_set_config_int(ofdm_rcv,"size_pot", SIZE_POT );  // And call the chain once  for ( i=0; i<10; i++ ) {    swr_sdb_send_msg( source, SUBS_MSG_USER, NULL, -1 );  }  swr_sdb_show_profile( ofdm_send );  swr_sdb_show_profile( ofdm_rcv );  // Cleanup  swr_free( data );  PR( "Finished\n" );  return 0;}swr_spc_id_t spm_id;struct thread start;/** * This function is called upon "insmod" and is used to register the * different parts of the module to the SPM. */int um_module_init(void) {  PR_CL( desc );  test_chain = NULL;  if ( swr_thread_init( &start, start_it, NULL ) < 0 )    goto first_no_stack;  return 0;first_no_stack:  PR_DBG( 0, "Couldn't allocate stack\n" );  return -1;}void um_module_exit( void ) {  swr_thread_free( &start, NULL );  swr_chain_destroy( test_chain );}module_init( um_module_init );module_exit( um_module_exit );

⌨️ 快捷键说明

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