📄 test_mimostfa.c
字号:
/*************************************************************************** test_mimostfa.c - Module for testing multiple STFAs ------------------- begin : 2003-02 authors : Linus Gasser emails : ineiti ***************************************************************************//*************************************************************************** Changes ------- date - name - description 03/11/x - 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""A first test for the MIMO-STFAs. A special emulation-mode for the channel\n""is used, where the channel-matrix H is an identity-matrix. Furthermore,\n""each transmitted slot is received one slot later. Well, for testing\n""purposes, really. The output should be the test-phrase.\n\n";#include "spc.h"#include "std.h"#include "stfa.h"#define DBG_LVL 4struct chain_t *test_chain, *test_chain2;void *start_it( void *arg ) { swr_sdb_id source, sink1, map, stfa[2],join, split, mid_rx[2], mid_tx[2]; PR( "Making 2nd chain\n" ); test_chain = swr_chain_create( NEW_SPC_VAR( "source", source ), NEW_SPC_VAR( "mapper",map ), NEW_SPC_VAR( "split",split ), NEW_SPC_VAR( "midamble", mid_tx[ 0 ] ), NEW_SPC( "rrc" ), NEW_SPC_VAR_OUT( "stfa", stfa[0],1), NEW_SPC_VAR( "matched_filter", mid_rx[ 0 ] ), NEW_SPC_VAR("join",join), NEW_SPC( "slicer" ), NEW_SPC_VAR( "sink", sink1), CHAIN_END ); test_chain2 = swr_chain_create(OLD_SPC_OUT( split, 1 ), NEW_SPC_VAR( "midamble", mid_tx[ 1 ] ), NEW_SPC( "rrc" ), NEW_SPC_VAR_OUT( "stfa", stfa[1], 1 ), NEW_SPC_VAR( "matched_filter", mid_rx[1] ), OLD_SPC_IN( join, 1 ), CHAIN_END ); swr_sdb_set_config_int( mid_tx[0], "amplitude", 32767/4 ); swr_sdb_set_config_int( map, "amplitude", 32767/4 ); swr_sdb_set_config_int( mid_tx[1], "index", 1 ); swr_sdb_set_config_int( mid_tx[1], "amplitude", 32767/4 ); swr_sdb_set_config_int( mid_rx[1], "index", 1 ); PR( "Setting flag of sink to 1\n" ); swr_sdb_set_config_int( sink1, "flag", 1 ); /* swr_sdb_set_config_int( sink2, "flag", 1 ); */ // Tell the first stfa where he has to look for slot 0 swr_stfa_notice_sdb( stfa[0], 0, source ); swr_stfa_go( stfa[0] ); //swr_stfa_go( stfa[1] ); PR( "Wait a sec.\n" ); usleep( 1000000 ); swr_stfa_stop( stfa[0] ); 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_chain2 ); 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 + -