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

📄 test_sig_double_complex.c

📁 This a framework to test new ideas in transmission technology. Actual development is a LDPC-coder in
💻 C
字号:
/***************************************************************************              test_sig_double_complex.c  -  Double-precision complex signals                            -------------------    begin                :  2003    authors              :  selvan    emails               :  e-mail ***************************************************************************//***************************************************************************                                 Changes                                 ------- date - name - description 03/08/x - selvan - 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""Well, performance-wise it's really not optimal, but with Pentium IV\n""being not even twice as fast with integers compared to double-precision\n""signals, we put also double-precision complex signals in the software-\n""radio.\n""The output should be 100 random double-precision complex numbers\n""between (-10,-10) and (10,10).\n\n";/** * This is a module to write a test for some sort of SPC. Usually * you just create one or two chains in here, and they will be * tested afterwards. */#include "spc.h"#include "std.h"#include <complex.h>#define DBG_LVL 4struct chain_t *test_chain;void *start_it( void *arg ) {  swr_sdb_id rnd, sink;  complex double range= 10 + 10 * I;  test_chain = swr_chain_create( NEW_SPC_VAR_OUT( "rnddouble", rnd, 1 ),                                 NEW_SPC_VAR_IN( "sink", sink, 3 ),                                 CHAIN_END );  // Set the range to -10..10 and show the doubles  swr_sdb_set_config_complex( rnd, "range_complex", range);  swr_sdb_set_config_int( sink, "size", 100 );  swr_sdb_set_config_int( sink, "flag_double_complex", 1 );  swr_sdb_send_msg( rnd, SUBS_MSG_USER, NULL, -1 );  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 + -