├── VERSION ├── .gitignore ├── tests ├── operators_test.ref ├── galois_test.ref ├── timer_test.ref ├── itfile_test_data.it ├── demapper_test.ref ├── rec_syst_conv_code_test.ref ├── integration_test.ref ├── rand_core_test.ref ├── error_count_test.ref ├── stc_test.ref ├── fastmath_test.ref ├── exit_test.ref ├── source_test.ref ├── integration_test.cpp ├── commfunc_test.ref ├── array_test.ref ├── freq_filt_test.ref ├── fastmath_test.cpp ├── cholesky_test.ref ├── lu_test.ref ├── svd_test.ref ├── interleaver_test.ref ├── schur_test.ref ├── gf2mat_test.ref ├── siso_test.ref ├── converters_test.ref ├── stat_test.ref ├── galois_test.cpp ├── fix_test.ref ├── det_test.ref ├── eigen_test.ref ├── commfunc_test.cpp ├── linspace_test.ref ├── specmat_test.ref ├── freq_filt_test.cpp ├── CMakeLists.txt ├── parser_test_data.txt ├── circular_buffer_test.ref ├── svd_test.cpp ├── lu_test.cpp ├── rand_test.ref ├── timer_test.cpp ├── poly_test.ref ├── inv_test.cpp └── det_test.cpp ├── Makefile.common ├── extras ├── test_pyitpp.it ├── txt2man.sh ├── Makefile.am ├── html2text.sh ├── gen_vcproj_tests.sh ├── astylerc ├── astylerc_old ├── mkl_tests_vcproj.template ├── acml_tests_vcproj.template ├── itpp-config.t2t └── setenv.bat ├── doc ├── images │ ├── favicon.ico │ ├── itpp_logo.png │ ├── itpp_logga.jpg │ ├── itpp_logga.xcf │ ├── Makefile.am │ └── itpp_logga.fig ├── tutorial │ ├── src │ │ ├── timer.ref │ │ ├── bpsk.ref │ │ ├── interleaver.ref │ │ ├── vector_and_matrix.ref │ │ ├── reedsolomon.ref │ │ ├── convcode.ref │ │ ├── read_it_file.cpp │ │ ├── qpsk_simulation.ref │ │ ├── timer.cpp │ │ ├── write_it_file.cpp │ │ ├── rayleigh.cpp │ │ ├── vector_and_matrix.cpp │ │ ├── interleaver.cpp │ │ ├── bpsk.cpp │ │ ├── dump_it_file.cpp │ │ ├── CMakeLists.txt │ │ ├── reedsolomon.cpp │ │ └── Makefile.am │ ├── ldpc_gen_codes.doc │ ├── Makefile.am │ ├── mog.doc │ ├── interleaver.doc │ ├── timer.doc │ ├── convcode.doc │ ├── vector_and_matrix.doc │ ├── demapper_mimo.doc │ ├── bpsk.doc │ ├── ldpc_bersim_awgn.doc │ ├── reedsolomon.doc │ ├── mimoconv.doc │ ├── spread.doc │ ├── sccc_bersim_awgn.doc │ ├── rayleigh.doc │ ├── tutorial.doc │ ├── turbo_equalizer_bersim_multipath.doc │ ├── exit_pccc.doc │ ├── sources.mk │ ├── itfile.doc │ ├── pccc_bersim_awgn.doc │ └── qpsk_simulation.doc ├── local │ ├── Makefile.am │ ├── itpp_footer.html │ ├── sources.mk │ ├── itpp_header.html │ ├── help_wanted.doc │ ├── authors.doc │ └── test.doc └── Makefile.am ├── gtests ├── g711_ref_data.it ├── itfile_test_data.it ├── audiofile_ref_data.au ├── galois_test.cpp ├── svd_test.cpp ├── timer_test.cpp ├── lu_test.cpp ├── parser_test_data.txt ├── schur_test.cpp └── error_count_test.cpp ├── itpp ├── signal │ ├── transforms.cpp │ ├── Makefile.am │ ├── sources.mk │ └── freq_filt.cpp ├── optim │ ├── sources.mk │ └── Makefile.am ├── base │ ├── bessel │ │ ├── Makefile.am │ │ ├── sources.mk │ │ └── bessel_internal.h │ ├── math │ │ ├── Makefile.am │ │ ├── sources.mk │ │ ├── misc.cpp │ │ ├── log_exp.cpp │ │ ├── trig_hyp.cpp │ │ └── integration.cpp │ ├── algebra │ │ ├── Makefile.am │ │ ├── sources.mk │ │ └── det.h │ ├── Makefile.am │ ├── binary.cpp │ ├── fastmath.h │ ├── ittypes.h │ ├── sources.mk │ └── base_exports.h ├── comm │ ├── Makefile.am │ ├── pulse_shape.cpp │ ├── sources.mk │ └── interleave.cpp ├── stat │ ├── Makefile.am │ └── sources.mk ├── fixed │ ├── Makefile.am │ ├── sources.mk │ ├── fixed.cpp │ └── cfixed.cpp ├── srccode │ ├── Makefile.am │ └── sources.mk ├── protocol │ ├── Makefile.am │ └── sources.mk ├── sources.mk ├── itoptim.h ├── itfixed.h ├── itprotocol.h ├── itsrccode.h ├── itexports.h.cmake └── itsignal.h ├── win32 ├── Makefile.am ├── itpp_mkl.sln ├── itpp_acml.sln ├── itpp_acml.vs2005.sln ├── itpp_mkl.vs2005.sln ├── itpp_acml_tests │ └── Makefile.am └── itpp_mkl_tests │ └── Makefile.am ├── shell.nix ├── itpp.pc.in ├── itpp_debug.pc.in ├── itpp.pc.cmake.in ├── cmake └── Modules │ └── CheckFunctionExists.cpp ├── Makefile.am ├── AUTHORS ├── autogen.sh ├── NEWS ├── README └── default.nix /VERSION: -------------------------------------------------------------------------------- 1 | 4.3 8:2:0 git 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | *.patch 3 | *.diff 4 | -------------------------------------------------------------------------------- /tests/operators_test.ref: -------------------------------------------------------------------------------- 1 | operators test successful 2 | -------------------------------------------------------------------------------- /tests/galois_test.ref: -------------------------------------------------------------------------------- 1 | a=alpha^4, b=alpha^2 2 | c=alpha^1 3 | -------------------------------------------------------------------------------- /Makefile.common: -------------------------------------------------------------------------------- 1 | @SET_MAKE@ 2 | AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) 3 | -------------------------------------------------------------------------------- /extras/test_pyitpp.it: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nvmd/itpp/HEAD/extras/test_pyitpp.it -------------------------------------------------------------------------------- /tests/timer_test.ref: -------------------------------------------------------------------------------- 1 | CPU_Timer is OK 2 | Real_Timer is OK 3 | tic() and toc() are OK 4 | -------------------------------------------------------------------------------- /doc/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nvmd/itpp/HEAD/doc/images/favicon.ico -------------------------------------------------------------------------------- /doc/images/itpp_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nvmd/itpp/HEAD/doc/images/itpp_logo.png -------------------------------------------------------------------------------- /gtests/g711_ref_data.it: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nvmd/itpp/HEAD/gtests/g711_ref_data.it -------------------------------------------------------------------------------- /doc/images/itpp_logga.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nvmd/itpp/HEAD/doc/images/itpp_logga.jpg -------------------------------------------------------------------------------- /doc/images/itpp_logga.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nvmd/itpp/HEAD/doc/images/itpp_logga.xcf -------------------------------------------------------------------------------- /gtests/itfile_test_data.it: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nvmd/itpp/HEAD/gtests/itfile_test_data.it -------------------------------------------------------------------------------- /itpp/signal/transforms.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nvmd/itpp/HEAD/itpp/signal/transforms.cpp -------------------------------------------------------------------------------- /tests/itfile_test_data.it: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nvmd/itpp/HEAD/tests/itfile_test_data.it -------------------------------------------------------------------------------- /gtests/audiofile_ref_data.au: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nvmd/itpp/HEAD/gtests/audiofile_ref_data.au -------------------------------------------------------------------------------- /doc/images/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/Makefile.common 2 | 3 | EXTRA_DIST = itpp_logo.png favicon.ico 4 | -------------------------------------------------------------------------------- /doc/tutorial/src/timer.ref: -------------------------------------------------------------------------------- 1 | Elapsed time = 0.000797055 seconds 2 | The sum of all integers from 0 to 999999 equals 1783293664 3 | -------------------------------------------------------------------------------- /tests/demapper_test.ref: -------------------------------------------------------------------------------- 1 | Hassibi_maxlogMAP, BER = 0 2 | GA, BER = 0 3 | sGA, BER = 0 4 | mmsePIC, BER = 0 5 | zfPIC, BER = 0 6 | -------------------------------------------------------------------------------- /extras/txt2man.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ -f itpp-config.t2t ]; then 3 | txt2tags -i itpp-config.t2t -o ../itpp-config.1.in 4 | fi 5 | -------------------------------------------------------------------------------- /doc/tutorial/ldpc_gen_codes.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page ldpc_gen_codes Generation of LDPC codes 3 | 4 | \include ldpc_gen_codes.cpp 5 | 6 | */ 7 | -------------------------------------------------------------------------------- /tests/rec_syst_conv_code_test.ref: -------------------------------------------------------------------------------- 1 | uncoded_bits = [0 1 1 0 1 0 1] 2 | tail_bits = [1 1 0 1] 3 | decoded_bits = [0 1 1 0 1 0 1 1 1 0 1] 4 | -------------------------------------------------------------------------------- /extras/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/Makefile.common 2 | 3 | dist_pkgdata_DATA = itload.m itsave.m pyitpp.py 4 | EXTRA_DIST = gdb_macros_for_itpp 5 | -------------------------------------------------------------------------------- /doc/local/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/Makefile.common 2 | include $(srcdir)/sources.mk 3 | 4 | EXTRA_DIST = $(doc_local_sources) $(html_local_sources) 5 | -------------------------------------------------------------------------------- /doc/tutorial/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/Makefile.common 2 | include $(srcdir)/sources.mk 3 | 4 | SUBDIRS = src 5 | 6 | EXTRA_DIST = $(doc_tutorial_sources) 7 | -------------------------------------------------------------------------------- /itpp/optim/sources.mk: -------------------------------------------------------------------------------- 1 | h_optim_sources = \ 2 | $(top_srcdir)/itpp/optim/newton_search.h 3 | 4 | cpp_optim_sources = \ 5 | $(top_srcdir)/itpp/optim/newton_search.cpp 6 | -------------------------------------------------------------------------------- /win32/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/Makefile.common 2 | 3 | SUBDIRS = itpp_acml_tests itpp_mkl_tests 4 | 5 | EXTRA_DIST = itpp_acml.sln itpp_acml.vcproj itpp_mkl.sln itpp_mkl.vcproj 6 | -------------------------------------------------------------------------------- /doc/tutorial/src/bpsk.ref: -------------------------------------------------------------------------------- 1 | There were 39224 received bits in error. 2 | There were 460776 correctly received bits. 3 | The error probability was 0.078448 4 | The theoretical error probability is 0.0786496 5 | -------------------------------------------------------------------------------- /extras/html2text.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | w3m -dump -cols 78 $1 \ 3 | | sed '1,/IT++ Compilation and Installation using Microsoft Visual/d' \ 4 | | sed '/How To Set Up a Local/,$d' \ 5 | | recode -f utf8..ascii 6 | 7 | -------------------------------------------------------------------------------- /doc/tutorial/src/interleaver.ref: -------------------------------------------------------------------------------- 1 | input = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20] 2 | output = [1 5 9 13 17 2 6 10 14 18 3 7 11 15 19 4 8 12 16 20] 3 | deinterleaved = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20] 4 | -------------------------------------------------------------------------------- /tests/integration_test.ref: -------------------------------------------------------------------------------- 1 | ========================================= 2 | Test of numerical integration routines 3 | ========================================= 4 | Integration of f(x)=x*log(x) over [1.5,3.5] 5 | quad = 4.71702 6 | quadl = 4.71702 7 | -------------------------------------------------------------------------------- /tests/rand_core_test.ref: -------------------------------------------------------------------------------- 1 | ----------------------------------------- 2 | RNG core tests: 3 | ----------------------------------------- 4 | genrand_close1_open2() test: PASSED 5 | genrand_open_close() test: PASSED 6 | multithreading test: PASSED 7 | ----------------------------------------- 8 | -------------------------------------------------------------------------------- /doc/tutorial/src/vector_and_matrix.ref: -------------------------------------------------------------------------------- 1 | a = [1 1.11111 1.22222 1.33333 1.44444 1.55556 1.66667 1.77778 1.88889 2] 2 | b = [0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1] 3 | c = [1.1 1.31111 1.52222 1.73333 1.94444 2.15556 2.36667 2.57778 2.78889 3] 4 | A = [[1 2] 5 | [3 4]] 6 | B = [[-2 1] 7 | [1.5 -0.5]] 8 | -------------------------------------------------------------------------------- /doc/tutorial/mog.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page mog Using Mixture of Gaussians (MOG) module to model data 3 | 4 | This example demonstrates how to find the parameters of 5 | a MOG model via using the kmeans and EM based optimisers. 6 | Synthetic data is utilised. 7 | 8 | \include mog.cpp 9 | 10 | 11 | */ 12 | -------------------------------------------------------------------------------- /doc/tutorial/src/reedsolomon.ref: -------------------------------------------------------------------------------- 1 | Number of Reed-Solomon code-words to simulate: 1000 2 | BSC Error probability : 0.01 3 | RS m: 3 4 | RS t: 2 5 | Simulating an Reed-Solomon code with the following parameters: 6 | n = 7 7 | k = 3 8 | q = 8 9 | The bit error probability after decoding is 0.000333333 10 | -------------------------------------------------------------------------------- /tests/error_count_test.ref: -------------------------------------------------------------------------------- 1 | ========================== 2 | BERC and BLER test 3 | ========================== 4 | 5 | BLER = 0.8 6 | Block errors = 80 7 | Correct blocks = 20 8 | Total blocks = 100 9 | 10 | BER = 0.16 11 | Bit errors = 320 12 | Correct bits = 1680 13 | Total bits = 2000 14 | -------------------------------------------------------------------------------- /doc/tutorial/interleaver.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page interleaver Interleaving and de-interleaving of data 3 | 4 | This example shows how to use one of the interleaving classes. 5 | 6 | \include interleaver.cpp 7 | 8 | When you run this program, the output will look like this: 9 | 10 | \include interleaver.ref 11 | 12 | */ 13 | -------------------------------------------------------------------------------- /shell.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import {} }: 2 | 3 | pkgs.mkShell rec { 4 | 5 | nativeBuildInputs = with pkgs; [ 6 | cmake 7 | python 8 | graphviz 9 | doxygen 10 | rsync 11 | 12 | # debugging tools 13 | gdb 14 | ]; 15 | 16 | buildInputs = with pkgs; [ 17 | openblas 18 | lapack-reference 19 | fftw 20 | ]; 21 | } -------------------------------------------------------------------------------- /doc/tutorial/timer.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page timer Using timers to measure execution time 3 | 4 | In this example we are using the Real_Timer class to measure the execution time of a simple program. The Real_Timer class is included in the itmisc library. 5 | 6 | \include timer.cpp 7 | 8 | When you run this program, the output will look something like this: 9 | 10 | \include timer.ref 11 | 12 | */ 13 | -------------------------------------------------------------------------------- /doc/tutorial/convcode.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page convcode Simulation of a convolutional encoder and decoder 3 | 4 | In this example we will show how to use the convolutional encoder/decoder class in it++. The Viterbi decoder uses the soft received values. 5 | 6 | \include convcode.cpp 7 | 8 | When you run this program, the output will look something like this: 9 | 10 | \include convcode.ref 11 | 12 | */ 13 | -------------------------------------------------------------------------------- /doc/tutorial/src/convcode.ref: -------------------------------------------------------------------------------- 1 | Now simulating point 1 out of 5 2 | Breaking on point 1 with 3297 errors. 3 | Now simulating point 2 out of 5 4 | Breaking on point 2 with 781 errors. 5 | Now simulating point 3 out of 5 6 | Breaking on point 3 with 112 errors. 7 | Now simulating point 4 out of 5 8 | Now simulating point 5 out of 5 9 | BER = [0.330858 0.0783743 0.00280983 0 0] 10 | EbN0dB = [-2 0 2 4 6] 11 | -------------------------------------------------------------------------------- /tests/stc_test.ref: -------------------------------------------------------------------------------- 1 | Space Time Code class test started 2 | Checking V-BLAST 3 | Checking improved V-BLAST 4 | Checking Alamouti code 5 | Checking switched Alamouti code 6 | Checking double Alamouti code 7 | Checking Jafarkhani code 8 | Checking Golden code 9 | Checking Damen code 10 | Checking orthogonal code 3xN 11 | Checking 36 LD code 3xN 12 | Checking 37 LD code 3xN 13 | Checking 39 LD code 3xN 14 | Space Time Code class test finished 15 | -------------------------------------------------------------------------------- /doc/tutorial/vector_and_matrix.doc: -------------------------------------------------------------------------------- 1 | /*! \page vector_and_matrix A very simple tutorial about vectors and matrices 2 | 3 | Let's start with a really simple example. Try to complile the following program: 4 | 5 | \include vector_and_matrix.cpp 6 | 7 | When you run this program, the output shall look like this 8 | 9 | \include vector_and_matrix.ref 10 | 11 | If this is what you see, then congratulations! You have managed to compile your first it++ program! 12 | 13 | */ 14 | -------------------------------------------------------------------------------- /itpp.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: @PACKAGE_NAME@ 7 | Description: @PACKAGE_NAME@ is a C++ library of mathematical, signal processing, speech processing, and communications classes and functions 8 | Version: @PACKAGE_VERSION@ 9 | URL: http://itpp.sourceforge.net/ 10 | Libs: -L${libdir} -l@PACKAGE@@EXPLICIT_LIBS@ 11 | Libs.private:@PRIVATE_LIBS@ 12 | Cflags: -I${includedir} @CXXFLAGS_OPT@ 13 | -------------------------------------------------------------------------------- /extras/gen_vcproj_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TESTS_DIR="../tests" 3 | MKL_VCPROJ_DIR="../win32/itpp_mkl_tests" 4 | ACML_VCPROJ_DIR="../win32/itpp_acml_tests" 5 | for i in "${TESTS_DIR}"/*.cpp; do 6 | TEST_FILE=`basename "${i}" .cpp` 7 | sed -e "s/TEST_BASENAME/${TEST_FILE}/g" acml_tests_vcproj.template > \ 8 | "${ACML_VCPROJ_DIR}/${TEST_FILE}.vcproj" 9 | sed -e "s/TEST_BASENAME/${TEST_FILE}/g" mkl_tests_vcproj.template > \ 10 | "${MKL_VCPROJ_DIR}/${TEST_FILE}.vcproj" 11 | done 12 | -------------------------------------------------------------------------------- /itpp_debug.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: @PACKAGE_NAME@ 7 | Description: @PACKAGE_NAME@ is a C++ library of mathematical, signal processing, speech processing, and communications classes and functions 8 | Version: @PACKAGE_VERSION@ 9 | URL: http://itpp.sourceforge.net/ 10 | Libs: -L${libdir} -l@PACKAGE_DEBUG@@EXPLICIT_LIBS@ 11 | Libs.private:@PRIVATE_LIBS@ 12 | Cflags: -I${includedir} @CXXFLAGS_DEBUG@ 13 | -------------------------------------------------------------------------------- /tests/fastmath_test.ref: -------------------------------------------------------------------------------- 1 | ==================================================== 2 | Test of fastmath 3 | ==================================================== 4 | sub_v_vT_m: the slow and fast way 5 | [[-41 -52 -63] 6 | [-59 -76 -93] 7 | [-14 -19 -24]] 8 | [[-41 -52 -63] 9 | [-59 -76 -93] 10 | [-14 -19 -24]] 11 | 12 | sub_m_v_vT: the slow and fast way 13 | [[-21 -31 -8] 14 | [-54 -82 -23] 15 | [-87 -133 -38]] 16 | [[-21 -31 -8] 17 | [-54 -82 -23] 18 | [-87 -133 -38]] 19 | -------------------------------------------------------------------------------- /doc/tutorial/src/read_it_file.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace itpp; 4 | 5 | int main() 6 | { 7 | // Declare the it_file class 8 | it_file ff; 9 | 10 | // Open the file "it_file_test.it" for reading 11 | ff.open("it_file_test.it"); 12 | 13 | // Read the variable a from the file. Put result in vector a. 14 | vec a; 15 | ff >> Name("a") >> a; 16 | 17 | // Print the result 18 | std::cout << "a = " << a << std::endl; 19 | 20 | // Exit the program 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /itpp/base/bessel/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/Makefile.common 2 | include $(srcdir)/sources.mk 3 | 4 | noinst_LTLIBRARIES = libbessel.la 5 | if ENABLE_DEBUG 6 | noinst_LTLIBRARIES += libbessel_debug.la 7 | endif 8 | 9 | libbessel_la_SOURCES = $(noinst_h_base_bessel_sources) \ 10 | $(cpp_base_bessel_sources) 11 | libbessel_la_CXXFLAGS = $(CXXFLAGS_OPT) 12 | 13 | libbessel_debug_la_SOURCES = $(noinst_h_base_bessel_sources) \ 14 | $(cpp_base_bessel_sources) 15 | libbessel_debug_la_CXXFLAGS = $(CXXFLAGS_DEBUG) 16 | 17 | -------------------------------------------------------------------------------- /doc/local/itpp_footer.html: -------------------------------------------------------------------------------- 1 |
2 | SourceForge Logo 3 |

Generated on $datetime for $projectname by Doxygen $doxygenversion

4 |
5 | 6 | 7 | -------------------------------------------------------------------------------- /doc/tutorial/demapper_mimo.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page demapper_mimo Simulation of SISO demappers using ST codes in ideal MIMO channels 3 | 4 | This program shows the usage of Soft-Input Soft-Output (SISO) demappers with 5 | Space Time (ST) codes in Multiple-Input Multiple-Output (MIMO) channels. 6 | The ST codes are generated using the STC class, the MIMO channels are ideal 7 | (no multi-antenna interferrence and no noise) and the receiver 8 | is implemented by the demapper method of the SISO class. 9 | 10 | \include stbicm.cpp 11 | 12 | */ 13 | -------------------------------------------------------------------------------- /doc/tutorial/bpsk.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page bpsk BPSK modulation over an AWGN channel 3 | 4 | As a first example we will generate a sequence of 500000 random bits {0,1} and 5 | BPSK modulate these. Thereafter the BPSK signals will be transmitted over 6 | an AWGN channel with a signal-to-noise ratio \f$E_b/N_0 = 0\f$ dB. The received signal 7 | is then decoded and the number of bit errors are calculated. 8 | 9 | \include bpsk.cpp 10 | 11 | When you run this program, the output will look something like this: 12 | 13 | \include bpsk.ref 14 | 15 | */ 16 | -------------------------------------------------------------------------------- /itpp/comm/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/Makefile.common 2 | include $(srcdir)/sources.mk 3 | 4 | noinst_LTLIBRARIES = libcomm.la 5 | if ENABLE_DEBUG 6 | noinst_LTLIBRARIES += libcomm_debug.la 7 | endif 8 | 9 | libcomm_la_SOURCES = $(h_comm_sources) $(cpp_comm_sources) 10 | libcomm_la_CXXFLAGS = $(CXXFLAGS_OPT) 11 | 12 | libcomm_debug_la_SOURCES = $(h_comm_sources) $(cpp_comm_sources) 13 | libcomm_debug_la_CXXFLAGS = $(CXXFLAGS_DEBUG) 14 | 15 | pkgincludedir = $(includedir)/@PACKAGE@/comm 16 | pkginclude_HEADERS = $(h_comm_sources) 17 | -------------------------------------------------------------------------------- /itpp/stat/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/Makefile.common 2 | include $(srcdir)/sources.mk 3 | 4 | noinst_LTLIBRARIES = libstat.la 5 | if ENABLE_DEBUG 6 | noinst_LTLIBRARIES += libstat_debug.la 7 | endif 8 | 9 | libstat_la_SOURCES = $(h_stat_sources) $(cpp_stat_sources) 10 | libstat_la_CXXFLAGS = $(CXXFLAGS_OPT) 11 | 12 | libstat_debug_la_SOURCES = $(h_stat_sources) $(cpp_stat_sources) 13 | libstat_debug_la_CXXFLAGS = $(CXXFLAGS_DEBUG) 14 | 15 | pkgincludedir = $(includedir)/@PACKAGE@/stat 16 | pkginclude_HEADERS = $(h_stat_sources) 17 | -------------------------------------------------------------------------------- /itpp.pc.cmake.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=@CMAKE_INSTALL_PREFIX@ 3 | libdir=@CMAKE_INSTALL_PREFIX@/lib@LIB_SUFFIX@ 4 | includedir=@CMAKE_INSTALL_PREFIX@/include 5 | 6 | Name: @PACKAGE_NAME@ 7 | Description: @PACKAGE_NAME@ is a C++ library of mathematical, signal processing, speech processing, and communications classes and functions 8 | Version: @PACKAGE_VERSION@ 9 | URL: http://itpp.sourceforge.net/ 10 | Libs: -L${libdir} -l@libitpp_target@ 11 | Libs.private:@ITPP_LIBS@ 12 | Cflags: -I${includedir} @CMAKE_CXX_FLAGS_RELEASE@ 13 | -------------------------------------------------------------------------------- /itpp/fixed/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/Makefile.common 2 | include $(srcdir)/sources.mk 3 | 4 | noinst_LTLIBRARIES = libfixed.la 5 | if ENABLE_DEBUG 6 | noinst_LTLIBRARIES += libfixed_debug.la 7 | endif 8 | 9 | libfixed_la_SOURCES = $(h_fixed_sources) $(cpp_fixed_sources) 10 | libfixed_la_CXXFLAGS = $(CXXFLAGS_OPT) 11 | 12 | libfixed_debug_la_SOURCES = $(h_fixed_sources) $(cpp_fixed_sources) 13 | libfixed_debug_la_CXXFLAGS = $(CXXFLAGS_DEBUG) 14 | 15 | pkgincludedir = $(includedir)/@PACKAGE@/fixed 16 | pkginclude_HEADERS = $(h_fixed_sources) 17 | -------------------------------------------------------------------------------- /itpp/optim/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/Makefile.common 2 | include $(srcdir)/sources.mk 3 | 4 | noinst_LTLIBRARIES = liboptim.la 5 | if ENABLE_DEBUG 6 | noinst_LTLIBRARIES += liboptim_debug.la 7 | endif 8 | 9 | liboptim_la_SOURCES = $(h_optim_sources) $(cpp_optim_sources) 10 | liboptim_la_CXXFLAGS = $(CXXFLAGS_OPT) 11 | 12 | liboptim_debug_la_SOURCES = $(h_optim_sources) $(cpp_optim_sources) 13 | liboptim_debug_la_CXXFLAGS = $(CXXFLAGS_DEBUG) 14 | 15 | pkgincludedir = $(includedir)/@PACKAGE@/optim 16 | pkginclude_HEADERS = $(h_optim_sources) 17 | -------------------------------------------------------------------------------- /tests/exit_test.ref: -------------------------------------------------------------------------------- 1 | ============================================= 2 | Starting Simulation 3 | Extrinsic Mutual Information (IE) as a function of A priori Mutual Information (IA) 4 | ============================================= 5 | Block length = 1000 6 | Generator polynomials = [7 5] 7 | Turbo encoder rate 1/3 (plus tail bits) 8 | ============================================= 9 | IA = [0.000018 0.485944 0.912822 0.999023] 10 | IE = [0.574743 0.790818 0.981918 0.997540] 11 | IE^p = [0.031706 0.338378 0.932759 0.997101] 12 | -------------------------------------------------------------------------------- /tests/source_test.ref: -------------------------------------------------------------------------------- 1 | Source sim mean sim var 2 | ============================================================================ 3 | Sine 0.00000000 0.50000500 4 | Square 0.00002000 1.00001000 5 | Triangle 0.00000000 0.33333677 6 | Sawtooth 0.00020000 0.33333665 7 | Impulse 0.00019000 0.00018997 8 | Pattern 2.00000000 1.00001000 9 | -------------------------------------------------------------------------------- /doc/tutorial/ldpc_bersim_awgn.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page ldpc_bersim_awgn Simulation of LDPC codes the AWGN channel 3 | 4 | This program simulates the performance of LDPC codes on the AWGN channel. Since the channel is symmetric, the zero codeword is used. 5 | 6 | \include ldpc_bersim_awgn.cpp 7 | To simulate the code "RU_10000.it" over a range of SNR (see \ref ldpc_gen_codes for how to generate codec) 8 | \code 9 | ./ldpc_bersim_awgn RU_10000.it 10 | \endcode 11 | 12 | To simulate at Eb/N0=1.1 dB 13 | \code 14 | ./ldpc_bersim_awgn RU_10000.it 1.1 15 | \endcode 16 | */ 17 | -------------------------------------------------------------------------------- /itpp/signal/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/Makefile.common 2 | include $(srcdir)/sources.mk 3 | 4 | noinst_LTLIBRARIES = libsignal.la 5 | if ENABLE_DEBUG 6 | noinst_LTLIBRARIES += libsignal_debug.la 7 | endif 8 | 9 | libsignal_la_SOURCES = $(h_signal_sources) $(cpp_signal_sources) 10 | libsignal_la_CXXFLAGS = $(CXXFLAGS_OPT) 11 | 12 | libsignal_debug_la_SOURCES = $(h_signal_sources) $(cpp_signal_sources) 13 | libsignal_debug_la_CXXFLAGS = $(CXXFLAGS_DEBUG) 14 | 15 | pkgincludedir = $(includedir)/@PACKAGE@/signal 16 | pkginclude_HEADERS = $(h_signal_sources) 17 | -------------------------------------------------------------------------------- /itpp/stat/sources.mk: -------------------------------------------------------------------------------- 1 | h_stat_sources = \ 2 | $(top_srcdir)/itpp/stat/histogram.h \ 3 | $(top_srcdir)/itpp/stat/misc_stat.h \ 4 | $(top_srcdir)/itpp/stat/mog_diag.h \ 5 | $(top_srcdir)/itpp/stat/mog_diag_em.h \ 6 | $(top_srcdir)/itpp/stat/mog_diag_kmeans.h \ 7 | $(top_srcdir)/itpp/stat/mog_generic.h 8 | 9 | cpp_stat_sources = \ 10 | $(top_srcdir)/itpp/stat/misc_stat.cpp \ 11 | $(top_srcdir)/itpp/stat/mog_diag.cpp \ 12 | $(top_srcdir)/itpp/stat/mog_diag_em.cpp \ 13 | $(top_srcdir)/itpp/stat/mog_diag_kmeans.cpp \ 14 | $(top_srcdir)/itpp/stat/mog_generic.cpp 15 | -------------------------------------------------------------------------------- /itpp/base/math/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/Makefile.common 2 | include $(srcdir)/sources.mk 3 | 4 | noinst_LTLIBRARIES = libmath.la 5 | if ENABLE_DEBUG 6 | noinst_LTLIBRARIES += libmath_debug.la 7 | endif 8 | 9 | libmath_la_SOURCES = $(h_base_math_sources) $(cpp_base_math_sources) 10 | libmath_la_CXXFLAGS = $(CXXFLAGS_OPT) 11 | 12 | libmath_debug_la_SOURCES = $(h_base_math_sources) $(cpp_base_math_sources) 13 | libmath_debug_la_CXXFLAGS = $(CXXFLAGS_DEBUG) 14 | 15 | pkgincludedir = $(includedir)/@PACKAGE@/base/math 16 | pkginclude_HEADERS = $(h_base_math_sources) 17 | -------------------------------------------------------------------------------- /itpp/srccode/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/Makefile.common 2 | include $(srcdir)/sources.mk 3 | 4 | noinst_LTLIBRARIES = libsrccode.la 5 | if ENABLE_DEBUG 6 | noinst_LTLIBRARIES += libsrccode_debug.la 7 | endif 8 | 9 | libsrccode_la_SOURCES = $(h_srccode_sources) $(cpp_srccode_sources) 10 | libsrccode_la_CXXFLAGS = $(CXXFLAGS_OPT) 11 | 12 | libsrccode_debug_la_SOURCES = $(h_srccode_sources) $(cpp_srccode_sources) 13 | libsrccode_debug_la_CXXFLAGS = $(CXXFLAGS_DEBUG) 14 | 15 | pkgincludedir = $(includedir)/@PACKAGE@/srccode 16 | pkginclude_HEADERS = $(h_srccode_sources) 17 | -------------------------------------------------------------------------------- /itpp/protocol/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/Makefile.common 2 | include $(srcdir)/sources.mk 3 | 4 | noinst_LTLIBRARIES = libprotocol.la 5 | if ENABLE_DEBUG 6 | noinst_LTLIBRARIES += libprotocol_debug.la 7 | endif 8 | 9 | libprotocol_la_SOURCES = $(h_protocol_sources) $(cpp_protocol_sources) 10 | libprotocol_la_CXXFLAGS = $(CXXFLAGS_OPT) 11 | 12 | libprotocol_debug_la_SOURCES = $(h_protocol_sources) $(cpp_protocol_sources) 13 | libprotocol_debug_la_CXXFLAGS = $(CXXFLAGS_DEBUG) 14 | 15 | pkgincludedir = $(includedir)/@PACKAGE@/protocol 16 | pkginclude_HEADERS = $(h_protocol_sources) 17 | -------------------------------------------------------------------------------- /itpp/srccode/sources.mk: -------------------------------------------------------------------------------- 1 | h_srccode_sources = \ 2 | $(top_srcdir)/itpp/srccode/audiofile.h \ 3 | $(top_srcdir)/itpp/srccode/gmm.h \ 4 | $(top_srcdir)/itpp/srccode/lpcfunc.h \ 5 | $(top_srcdir)/itpp/srccode/pnm.h \ 6 | $(top_srcdir)/itpp/srccode/vq.h \ 7 | $(top_srcdir)/itpp/srccode/vqtrain.h 8 | 9 | cpp_srccode_sources = \ 10 | $(top_srcdir)/itpp/srccode/audiofile.cpp \ 11 | $(top_srcdir)/itpp/srccode/gmm.cpp \ 12 | $(top_srcdir)/itpp/srccode/lpcfunc.cpp \ 13 | $(top_srcdir)/itpp/srccode/pnm.cpp \ 14 | $(top_srcdir)/itpp/srccode/vq.cpp \ 15 | $(top_srcdir)/itpp/srccode/vqtrain.cpp 16 | -------------------------------------------------------------------------------- /cmake/Modules/CheckFunctionExists.cpp: -------------------------------------------------------------------------------- 1 | #ifdef CHECK_FUNCTION_EXISTS 2 | 3 | //only for std:isfinite, std::isinf and std::isnan 4 | 5 | #include 6 | 7 | #ifdef __CLASSIC_C__ 8 | int main(){ 9 | int ac; 10 | char*av[]; 11 | #else 12 | int main(int ac, char*av[]){ 13 | #endif 14 | double arg = 0.0; 15 | CHECK_FUNCTION_EXISTS(arg); 16 | if(ac > 1000) 17 | { 18 | return *av[0]; 19 | } 20 | return 0; 21 | } 22 | 23 | #else /* CHECK_FUNCTION_EXISTS */ 24 | 25 | # error "CHECK_FUNCTION_EXISTS has to specify the function" 26 | 27 | #endif /* CHECK_FUNCTION_EXISTS */ 28 | -------------------------------------------------------------------------------- /itpp/sources.mk: -------------------------------------------------------------------------------- 1 | h_sources = $(top_srcdir)/itpp/itbase.h \ 2 | $(top_srcdir)/itpp/itstat.h \ 3 | $(top_srcdir)/itpp/itmex.h 4 | 5 | if ENABLE_COMM 6 | h_sources += $(top_srcdir)/itpp/itcomm.h 7 | endif 8 | if ENABLE_FIXED 9 | h_sources += $(top_srcdir)/itpp/itfixed.h 10 | endif 11 | if ENABLE_OPTIM 12 | h_sources += $(top_srcdir)/itpp/itoptim.h 13 | endif 14 | if ENABLE_PROTOCOL 15 | h_sources += $(top_srcdir)/itpp/itprotocol.h 16 | endif 17 | if ENABLE_SIGNAL 18 | h_sources += $(top_srcdir)/itpp/itsignal.h 19 | endif 20 | if ENABLE_SRCCODE 21 | h_sources += $(top_srcdir)/itpp/itsrccode.h 22 | endif 23 | -------------------------------------------------------------------------------- /doc/local/sources.mk: -------------------------------------------------------------------------------- 1 | doc_local_sources = \ 2 | $(top_srcdir)/doc/local/authors.doc \ 3 | $(top_srcdir)/doc/local/codingrules.doc \ 4 | $(top_srcdir)/doc/local/copyright.doc \ 5 | $(top_srcdir)/doc/local/documentation.doc \ 6 | $(top_srcdir)/doc/local/features.doc \ 7 | $(top_srcdir)/doc/local/help_wanted.doc \ 8 | $(top_srcdir)/doc/local/installation.doc \ 9 | $(top_srcdir)/doc/local/linking.doc \ 10 | $(top_srcdir)/doc/local/test.doc \ 11 | $(top_srcdir)/doc/local/users_guide.doc \ 12 | $(top_srcdir)/doc/local/verification.doc 13 | 14 | html_local_sources = \ 15 | $(top_srcdir)/doc/local/itpp_footer.html \ 16 | $(top_srcdir)/doc/local/itpp_header.html 17 | -------------------------------------------------------------------------------- /itpp/base/math/sources.mk: -------------------------------------------------------------------------------- 1 | h_base_math_sources = \ 2 | $(top_srcdir)/itpp/base/math/elem_math.h \ 3 | $(top_srcdir)/itpp/base/math/error.h \ 4 | $(top_srcdir)/itpp/base/math/integration.h \ 5 | $(top_srcdir)/itpp/base/math/log_exp.h \ 6 | $(top_srcdir)/itpp/base/math/min_max.h \ 7 | $(top_srcdir)/itpp/base/math/misc.h \ 8 | $(top_srcdir)/itpp/base/math/trig_hyp.h 9 | 10 | cpp_base_math_sources = \ 11 | $(top_srcdir)/itpp/base/math/elem_math.cpp \ 12 | $(top_srcdir)/itpp/base/math/error.cpp \ 13 | $(top_srcdir)/itpp/base/math/integration.cpp \ 14 | $(top_srcdir)/itpp/base/math/log_exp.cpp \ 15 | $(top_srcdir)/itpp/base/math/misc.cpp \ 16 | $(top_srcdir)/itpp/base/math/trig_hyp.cpp 17 | -------------------------------------------------------------------------------- /doc/local/itpp_header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Welcome to $projectname! 6 | 7 | 8 | 9 | 10 | 11 |
12 | IT++ Logo 13 |
14 | -------------------------------------------------------------------------------- /doc/tutorial/src/qpsk_simulation.ref: -------------------------------------------------------------------------------- 1 | Now simulating Eb/N0 value number 1 of 10 2 | Now simulating Eb/N0 value number 2 of 10 3 | Now simulating Eb/N0 value number 3 of 10 4 | Now simulating Eb/N0 value number 4 of 10 5 | Now simulating Eb/N0 value number 5 of 10 6 | Now simulating Eb/N0 value number 6 of 10 7 | Now simulating Eb/N0 value number 7 of 10 8 | Now simulating Eb/N0 value number 8 of 10 9 | Now simulating Eb/N0 value number 9 of 10 10 | Now simulating Eb/N0 value number 10 of 10 11 | Elapsed time = 0.460899 seconds 12 | 13 | EbN0dB = [0 1 2 3 4 5 6 7 8 9] [dB] 14 | BER = [0.07968 0.0559 0.03729 0.02294 0.01243 0.0058 0.0025 0.00076 0.00013 6e-05] 15 | Saving results to ./qpsk_result_file.it 16 | 17 | -------------------------------------------------------------------------------- /itpp/base/algebra/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/Makefile.common 2 | include $(srcdir)/sources.mk 3 | 4 | noinst_LTLIBRARIES = libalgebra.la 5 | if ENABLE_DEBUG 6 | noinst_LTLIBRARIES += libalgebra_debug.la 7 | endif 8 | 9 | libalgebra_la_SOURCES = $(noinst_h_base_algebra_sources) \ 10 | $(h_base_algebra_sources) \ 11 | $(cpp_base_algebra_sources) 12 | libalgebra_la_CXXFLAGS = $(CXXFLAGS_OPT) 13 | 14 | libalgebra_debug_la_SOURCES = $(noinst_h_base_algebra_sources) \ 15 | $(h_base_algebra_sources) \ 16 | $(cpp_base_algebra_sources) 17 | libalgebra_debug_la_CXXFLAGS = $(CXXFLAGS_DEBUG) 18 | 19 | pkgincludedir = $(includedir)/@PACKAGE@/base/algebra 20 | pkginclude_HEADERS = $(h_base_algebra_sources) 21 | -------------------------------------------------------------------------------- /tests/integration_test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using std::cout; 4 | using std::endl; 5 | using namespace itpp; 6 | 7 | 8 | double f(const double x) 9 | { 10 | return x*log(x); 11 | } 12 | 13 | int main() 14 | { 15 | cout << "=========================================" << endl; 16 | cout << " Test of numerical integration routines" << endl; 17 | cout << "=========================================" << endl; 18 | 19 | double res = itpp::quad(f, 1.5, 3.5); 20 | double res2 = itpp::quadl(f, 1.5, 3.5); 21 | 22 | cout << "Integration of f(x)=x*log(x) over [1.5,3.5]" << endl; 23 | cout << "quad = " << res << endl; 24 | cout << "quadl = " << res2 << endl; 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /doc/tutorial/reedsolomon.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page reedsolomon Simulation of a Reed-Solomon Block Code 3 | 4 | A Reed-Solomon code is a \f$q^m\f$-ary BCH code of length \f$q^m-1\f$. The generator polynomial for a \f$t\f$-error correcting code is \f$g(x) = (x-\alpha) (x-\alpha^1) \ldots (x-\alpha^{2t-1})\f$. The decoder uses the Berlkamp-Massey algorithm for decoding as described in: S. B. Wicker, "Error Control Systems for digital communication and storage," Prentice Hall. The following example simulates a binary (i.e. \f$q=2\f$) Reed-Solomon code with parameters \f$m\f$ and \f$t\f$: 5 | 6 | \include reedsolomon.cpp 7 | 8 | A typical run of this program can look like this: 9 | 10 | \include reedsolomon.ref 11 | 12 | */ 13 | -------------------------------------------------------------------------------- /itpp/base/bessel/sources.mk: -------------------------------------------------------------------------------- 1 | noinst_h_base_bessel_sources = \ 2 | $(top_srcdir)/itpp/base/bessel/bessel_internal.h 3 | 4 | cpp_base_bessel_sources = \ 5 | $(top_srcdir)/itpp/base/bessel/airy.cpp \ 6 | $(top_srcdir)/itpp/base/bessel/chbevl.cpp \ 7 | $(top_srcdir)/itpp/base/bessel/gamma.cpp \ 8 | $(top_srcdir)/itpp/base/bessel/hyperg.cpp \ 9 | $(top_srcdir)/itpp/base/bessel/i0.cpp \ 10 | $(top_srcdir)/itpp/base/bessel/i1.cpp \ 11 | $(top_srcdir)/itpp/base/bessel/iv.cpp \ 12 | $(top_srcdir)/itpp/base/bessel/jv.cpp \ 13 | $(top_srcdir)/itpp/base/bessel/k0.cpp \ 14 | $(top_srcdir)/itpp/base/bessel/k1.cpp \ 15 | $(top_srcdir)/itpp/base/bessel/kn.cpp \ 16 | $(top_srcdir)/itpp/base/bessel/polevl.cpp \ 17 | $(top_srcdir)/itpp/base/bessel/struve.cpp 18 | -------------------------------------------------------------------------------- /tests/commfunc_test.ref: -------------------------------------------------------------------------------- 1 | [[0 0 0 0 0] 2 | [0 0 0 0 1] 3 | [0 0 0 1 1] 4 | [0 0 0 1 0] 5 | [0 0 1 1 0] 6 | [0 0 1 1 1] 7 | [0 0 1 0 1] 8 | [0 0 1 0 0] 9 | [0 1 1 0 0] 10 | [0 1 1 0 1] 11 | [0 1 1 1 1] 12 | [0 1 1 1 0] 13 | [0 1 0 1 0] 14 | [0 1 0 1 1] 15 | [0 1 0 0 1] 16 | [0 1 0 0 0] 17 | [1 1 0 0 0] 18 | [1 1 0 0 1] 19 | [1 1 0 1 1] 20 | [1 1 0 1 0] 21 | [1 1 1 1 0] 22 | [1 1 1 1 1] 23 | [1 1 1 0 1] 24 | [1 1 1 0 0] 25 | [1 0 1 0 0] 26 | [1 0 1 0 1] 27 | [1 0 1 1 1] 28 | [1 0 1 1 0] 29 | [1 0 0 1 0] 30 | [1 0 0 1 1] 31 | [1 0 0 0 1] 32 | [1 0 0 0 0]] 33 | 6 34 | 4 35 | [0 0 0.001] 36 | [0 0 0.01] 37 | [0 0 0.1] 38 | [0 0.166667 0.333333] 39 | [0 0.416667 0.583333] 40 | [1.27778 1.77778 1.94444] 41 | [32.9444 33.4444 33.6111] 42 | -------------------------------------------------------------------------------- /itpp/fixed/sources.mk: -------------------------------------------------------------------------------- 1 | h_fixed_sources = \ 2 | $(top_srcdir)/itpp/fixed/cfixed.h \ 3 | $(top_srcdir)/itpp/fixed/cfix.h \ 4 | $(top_srcdir)/itpp/fixed/fix_base.h \ 5 | $(top_srcdir)/itpp/fixed/fixed.h \ 6 | $(top_srcdir)/itpp/fixed/fix_factory.h \ 7 | $(top_srcdir)/itpp/fixed/fix_functions.h \ 8 | $(top_srcdir)/itpp/fixed/fix.h \ 9 | $(top_srcdir)/itpp/fixed/fix_operators.h 10 | 11 | cpp_fixed_sources = \ 12 | $(top_srcdir)/itpp/fixed/cfix.cpp \ 13 | $(top_srcdir)/itpp/fixed/cfixed.cpp \ 14 | $(top_srcdir)/itpp/fixed/fix_base.cpp \ 15 | $(top_srcdir)/itpp/fixed/fix.cpp \ 16 | $(top_srcdir)/itpp/fixed/fixed.cpp \ 17 | $(top_srcdir)/itpp/fixed/fix_factory.cpp \ 18 | $(top_srcdir)/itpp/fixed/fix_functions.cpp \ 19 | $(top_srcdir)/itpp/fixed/fix_operators.cpp 20 | -------------------------------------------------------------------------------- /tests/array_test.ref: -------------------------------------------------------------------------------- 1 | Testing simple Arrays of integers: 2 | A1 = {1 1 42 1 1 1 1 1 1 1} 3 | A2 = {5 5 5 5 5 5 5 5 5 5 5 5 5 5 5} 4 | 5 | Testing Array initialisation with: "{[1 1] [1 0 1 0] [0 0 1]}": 6 | A3 = {[1 1] [1 0 1 0] [0 0 1]} 7 | 8 | Testing Array initialisation with: "{{[5 3; 020 4] [1 0; 3 9]} {[0 -3; 1 0xa]}}": 9 | A4 = {{[[5 3] 10 | [16 4]] [[1 0] 11 | [3 9]]} {[[0 -3] 12 | [1 10]]}} 13 | 14 | Testing Array::operator(): 15 | A4(1) = {[[0 -3] 16 | [1 10]]} 17 | A4(0)(1) = [[1 0] 18 | [3 9]] 19 | 20 | Testing Array::left(), Array::right() and Array::mid(): 21 | A1.left(4) = {1 1 42 1} 22 | A1.right(5) = {1 1 1 1 1} 23 | A1.mid(2, 3) = {42 1 1} 24 | 25 | Testing A4.swap(0, 1): 26 | {{[[0 -3] 27 | [1 10]]} {[[5 3] 28 | [16 4]] [[1 0] 29 | [3 9]]}} 30 | -------------------------------------------------------------------------------- /doc/tutorial/mimoconv.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page mimoconv MIMO (spatial multiplexing) with convolutional coding 3 | 4 | This example demonstrates how to use the \c Modulator_ND (MIMO) class 5 | for soft-output demodulation. The program simulates a simple 6 | convolutionally coded spatial-multiplexing (V-BLAST style) MIMO system 7 | with maximum-likelihood, alternatively zero-forcing, demodulation and 8 | soft Viterbi decoding, but no iteration between the demodulator and 9 | the decoder. 10 | 11 | \include mimoconv.cpp 12 | 13 | To run the program, 14 | 15 | \code 16 | mimoconv nTx nRx nC Tc 17 | \endcode 18 | where 19 | - nTx=number of transmit antennas 20 | - nRx=number of receive antennas 21 | - nC=constellation (1=QPSK, 2=16-QAM, 3=64-QAM) 22 | - Tc=coherence time (channel uses) 23 | 24 | */ 25 | -------------------------------------------------------------------------------- /doc/tutorial/src/timer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace itpp; 4 | 5 | //These lines are needed for use of cout and endl 6 | using std::cout; 7 | using std::endl; 8 | 9 | int main() 10 | { 11 | //Declare the scalars used: 12 | long i, sum, N; 13 | 14 | //Declare tt as an instance of the timer class: 15 | Real_Timer tt; 16 | 17 | //Initiate the variables: 18 | N = 1000000; 19 | sum = 0; 20 | 21 | //Start and reset the timer: 22 | tt.tic(); 23 | 24 | //Do some processing 25 | for (i = 0; i < N; i++) { 26 | sum += i; 27 | } 28 | 29 | // Print the elapsed time 30 | tt.toc_print(); 31 | 32 | //Print the result of the processing: 33 | cout << "The sum of all integers from 0 to " << N - 1 << " equals " << sum << endl; 34 | 35 | //Exit program: 36 | return 0; 37 | 38 | } 39 | -------------------------------------------------------------------------------- /itpp/protocol/sources.mk: -------------------------------------------------------------------------------- 1 | h_protocol_sources = \ 2 | $(top_srcdir)/itpp/protocol/events.h \ 3 | $(top_srcdir)/itpp/protocol/front_drop_queue.h \ 4 | $(top_srcdir)/itpp/protocol/packet_channel.h \ 5 | $(top_srcdir)/itpp/protocol/packet_generator.h \ 6 | $(top_srcdir)/itpp/protocol/packet.h \ 7 | $(top_srcdir)/itpp/protocol/selective_repeat.h \ 8 | $(top_srcdir)/itpp/protocol/signals_slots.h \ 9 | $(top_srcdir)/itpp/protocol/tcp_client_server.h \ 10 | $(top_srcdir)/itpp/protocol/tcp.h 11 | 12 | cpp_protocol_sources = \ 13 | $(top_srcdir)/itpp/protocol/events.cpp \ 14 | $(top_srcdir)/itpp/protocol/front_drop_queue.cpp \ 15 | $(top_srcdir)/itpp/protocol/packet_channel.cpp \ 16 | $(top_srcdir)/itpp/protocol/packet_generator.cpp \ 17 | $(top_srcdir)/itpp/protocol/selective_repeat.cpp \ 18 | $(top_srcdir)/itpp/protocol/tcp.cpp 19 | -------------------------------------------------------------------------------- /tests/freq_filt_test.ref: -------------------------------------------------------------------------------- 1 | 8 2 | 5 3 | [1 2 3 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 4 | [0 0.10101 0.40404 1.0101 2.0202 3.0303 4.0404 5.05051 6.06061 7.07071 8.08081 9.09091 10.101 11.1111 12.1212 13.1313 14.1414 15.1515 16.1616 17.1717 18.1818 19.1919 20.202 21.2121 22.2222 23.2323 24.2424 25.2525 26.2626 27.2727 28.2828 29.2929 30.303 31.3131 32.3232 33.3333 34.3434 35.3535 36.3636 37.3737 38.3838 39.3939 40.404 41.4141 42.4242 43.4343 44.4444 45.4545 46.4646 47.4747 48.4848 49.4949 50.5051 51.5152 52.5253 53.5354 54.5455 55.5556 56.5657 57.5758 58.5859 59.596 60.6061 61.6162 62.6263 63.6364 64.6465 65.6566 66.6667 67.6768 68.6869 69.697 70.7071 71.7172 72.7273 73.7374 74.7475 75.7576 76.7677 77.7778 78.7879 79.798 80.8081 81.8182 82.8283 83.8384 84.8485 85.8586 86.8687 87.8788 88.8889 89.899 90.9091 91.9192 92.9293 93.9394 94.9495 95.9596 96.9697 97.9798] 5 | -------------------------------------------------------------------------------- /tests/fastmath_test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using std::cout; 4 | using std::endl; 5 | using namespace itpp; 6 | 7 | int main(void) 8 | { 9 | cout << "====================================================" << endl; 10 | cout << " Test of fastmath" << endl; 11 | cout << "====================================================" << endl; 12 | 13 | mat m0("1 2 3;4 5 6;7 8 9"), mv0("2;3;1"); 14 | vec v0("2 3 1"); 15 | 16 | cout << "sub_v_vT_m: the slow and fast way" << endl; 17 | cout << (m0 - mv0*transpose(mv0)*m0) << endl; 18 | sub_v_vT_m(m0, v0); 19 | cout << m0 << endl; 20 | 21 | m0 = "1 2 3;4 5 6;7 8 9"; 22 | 23 | cout << endl << "sub_m_v_vT: the slow and fast way" << endl; 24 | cout << (m0 - m0*mv0*transpose(mv0)) << endl; 25 | sub_m_v_vT(m0, v0); 26 | cout << m0 << endl; 27 | 28 | return 0; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /doc/tutorial/src/write_it_file.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace itpp; 4 | 5 | int main() 6 | { 7 | // Declare the it_file class 8 | it_file ff; 9 | 10 | // Open a file with the name "it_file_test.it" 11 | ff.open("it_file_test.it"); 12 | 13 | // Create some data to put into the file 14 | vec a = linspace(1, 20, 20); 15 | 16 | // Put the variable a into the file. The Name("a") tells the file class 17 | // that the next variable shall be named "a". 18 | ff << Name("a") << a; 19 | 20 | // Force the file to be written to disc. This is useful when performing 21 | // iterations and ensures that the information is not stored in any cache 22 | // memory. In this simple example it is not necessary to flush the file. 23 | ff.flush(); 24 | 25 | // Close the file 26 | ff.close(); 27 | 28 | // Exit program 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /doc/tutorial/spread.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page spread Simulation of a Multicode CDMA system on an AWGN channel 3 | 4 | In this example we will introduce the multi-code spreading class \c Multicode_Spread_2d. This is the most general spreading class availiable in it++. Different spreading codes may be assigned to the I and Q branches. The number of multiple spreading codes and the spreading factor is determined by the number of rows and collumns respectively that is used when calling the member function set_codes. In this example we will use four Hadamard sequenced of length four, and the same spreading sequences will be used for the I and Q brances. 5 | 6 | \include spread.cpp 7 | 8 | A typical run of this program will look like this: 9 | 10 | \include spread.ref 11 | 12 | Use copy-and-paste to insert the variables \c EbN0dB and \c ber into Matlab and plot the result. 13 | 14 | */ 15 | -------------------------------------------------------------------------------- /doc/tutorial/sccc_bersim_awgn.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page sccc_bersim_awgn Simulation of SCCCs in an AWGN channel 3 | 4 | This program simulates Serially Concatenated Convolutional Codes (SCCCs) of coding rate 1/4 5 | using a turbo decoder with a SISO NSC module and a SISO RSC module. 6 | 7 | Reference: S. Benedetto, D. Divsalar, G. Motorsi and F. Pollara, "A Soft-Input Soft-Output Maximum A posteriori (MAP) Module to Decode Parallel and Serial Concatenated Codes", TDA Progress Report, nov. 1996 8 | 9 | \include sccc_bersim_awgn.cpp 10 | 11 | When you run this program, the results (BER and EbN0_dB) are saved into sccc_bersim_awgn.it file. Using the following MATLAB script 12 | \code 13 | clear all 14 | itload('sccc_bersim_awgn.it'); 15 | figure 16 | semilogy(EbN0_dB, BER, 'o-') 17 | grid on 18 | xlabel('E_b/N_0 [dB]') 19 | ylabel('BER') 20 | \endcode 21 | the results can be displayed. 22 | */ 23 | -------------------------------------------------------------------------------- /doc/tutorial/src/rayleigh.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace itpp; 4 | 5 | int main() 6 | { 7 | // Declare my_channel variable as an instance of the Rayleigh_Channel 8 | // class 9 | TDL_Channel my_channel; 10 | 11 | // The normalized Doppler frequency is set to 0.1 12 | double norm_dopp = 0.1; 13 | my_channel.set_norm_doppler(norm_dopp); 14 | 15 | // Generate nrof_samples of the fading process and store them in ch_coeffs 16 | // matrix 17 | int nrof_samples = 10000; 18 | cmat ch_coeffs; 19 | my_channel.generate(nrof_samples, ch_coeffs); 20 | 21 | // Open an output file "rayleigh_test.it" 22 | it_file ff("rayleigh_test.it"); 23 | 24 | // Save channel coefficients to the output file 25 | ff << Name("ch_coeffs") << ch_coeffs; 26 | 27 | // Close the output file 28 | ff.close(); 29 | 30 | // Exit program 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /tests/cholesky_test.ref: -------------------------------------------------------------------------------- 1 | ================================ 2 | Test of Cholesky routines 3 | ================================ 4 | Real matrix 5 | X = [[6.75107 -4.11024 7.57353 -6.9009 0.784665] 6 | [-4.11024 3.8051 -6.47556 4.54544 -2.45177] 7 | [7.57353 -6.47556 13.9033 -8.85583 3.75844] 8 | [-6.9009 4.54544 -8.85583 9.84391 -1.34372] 9 | [0.784665 -2.45177 3.75844 -1.34372 3.26664]] 10 | norm(X - F^T*F) = 0 11 | 12 | Complex matrix 13 | X = [[5.65948+0i -3.48645-1.42956i -1.91953+1.49454i -3.25204+0.21731i 0.998051+1.40267i] 14 | [-3.48645+1.42956i 5.1323+0i 0.0659595+0.413262i 2.0106-2.66829i -0.0618241-1.24643i] 15 | [-1.91953-1.49454i 0.0659595-0.413262i 5.3992+0i 0.745831+3.55662i -1.5896-2.13185i] 16 | [-3.25204-0.21731i 2.0106+2.66829i 0.745831-3.55662i 6.26614+0i -1.2381+0.228838i] 17 | [0.998051-1.40267i -0.0618241+1.24643i -1.5896+2.13185i -1.2381-0.228838i 2.4179+0i]] 18 | norm(X - F^H*F) = 0 19 | -------------------------------------------------------------------------------- /doc/tutorial/rayleigh.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page rayleigh Generating a correlated Rayleigh fading process 3 | 4 | In this example we will generate a correlated Rayleigh fading process with a 5 | normaized Doppler frequency equal to 0.1. The normalized Doppler is defined 6 | as the multiplication of the maximum Doppler frequency by the sampling time 7 | (i.e. \f$f_d = F_d T_s\f$). 8 | 9 | \include rayleigh.cpp 10 | 11 | You can use Matlab or Octave to examine the channel fading process that is 12 | stored int the output file \c rayleigh_test.it. Try the followigh code to 13 | view a part of the fading process: 14 | 15 | \code 16 | itload("rayleigh_test.it") 17 | figure(1); clf; 18 | semilogy(abs(ch_coeffs(1:200))) 19 | \endcode 20 | 21 | Note: Make sure that the folder $PREFIX/share/itpp is included your 22 | Matlab/Octave path variable (\c $PREFIX is the IT++ installation prefix: 23 | /usr/local by default). 24 | */ 25 | -------------------------------------------------------------------------------- /win32/itpp_mkl.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "itpp_mkl", "itpp_mkl.vcxproj", "{C069ECD3-26E8-437C-8B20-3A5D68B22F2A}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {C069ECD3-26E8-437C-8B20-3A5D68B22F2A}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {C069ECD3-26E8-437C-8B20-3A5D68B22F2A}.Debug|Win32.Build.0 = Debug|Win32 14 | {C069ECD3-26E8-437C-8B20-3A5D68B22F2A}.Release|Win32.ActiveCfg = Release|Win32 15 | {C069ECD3-26E8-437C-8B20-3A5D68B22F2A}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /win32/itpp_acml.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "itpp_acml", "itpp_acml.vcxproj", "{C069ECD3-26E8-437C-8B20-3A5D68B22F2A}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {C069ECD3-26E8-437C-8B20-3A5D68B22F2A}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {C069ECD3-26E8-437C-8B20-3A5D68B22F2A}.Debug|Win32.Build.0 = Debug|Win32 14 | {C069ECD3-26E8-437C-8B20-3A5D68B22F2A}.Release|Win32.ActiveCfg = Release|Win32 15 | {C069ECD3-26E8-437C-8B20-3A5D68B22F2A}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /win32/itpp_acml.vs2005.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 9.00 2 | # Visual Studio 2005 3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "itpp_acml", "itpp_acml.vs2005.vcproj", "{C069ECD3-26E8-437C-8B20-3A5D68B22F2A}" 4 | EndProject 5 | Global 6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 7 | Debug|Win32 = Debug|Win32 8 | Release|Win32 = Release|Win32 9 | EndGlobalSection 10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 11 | {C069ECD3-26E8-437C-8B20-3A5D68B22F2A}.Debug|Win32.ActiveCfg = Debug|Win32 12 | {C069ECD3-26E8-437C-8B20-3A5D68B22F2A}.Debug|Win32.Build.0 = Debug|Win32 13 | {C069ECD3-26E8-437C-8B20-3A5D68B22F2A}.Release|Win32.ActiveCfg = Release|Win32 14 | {C069ECD3-26E8-437C-8B20-3A5D68B22F2A}.Release|Win32.Build.0 = Release|Win32 15 | EndGlobalSection 16 | GlobalSection(SolutionProperties) = preSolution 17 | HideSolutionNode = FALSE 18 | EndGlobalSection 19 | EndGlobal 20 | -------------------------------------------------------------------------------- /itpp/signal/sources.mk: -------------------------------------------------------------------------------- 1 | h_signal_sources = \ 2 | $(top_srcdir)/itpp/signal/fastica.h \ 3 | $(top_srcdir)/itpp/signal/filter_design.h \ 4 | $(top_srcdir)/itpp/signal/filter.h \ 5 | $(top_srcdir)/itpp/signal/freq_filt.h \ 6 | $(top_srcdir)/itpp/signal/poly.h \ 7 | $(top_srcdir)/itpp/signal/resampling.h \ 8 | $(top_srcdir)/itpp/signal/sigfun.h \ 9 | $(top_srcdir)/itpp/signal/source.h \ 10 | $(top_srcdir)/itpp/signal/transforms.h \ 11 | $(top_srcdir)/itpp/signal/window.h 12 | 13 | cpp_signal_sources = \ 14 | $(top_srcdir)/itpp/signal/fastica.cpp \ 15 | $(top_srcdir)/itpp/signal/filter_design.cpp \ 16 | $(top_srcdir)/itpp/signal/filter.cpp \ 17 | $(top_srcdir)/itpp/signal/freq_filt.cpp \ 18 | $(top_srcdir)/itpp/signal/poly.cpp \ 19 | $(top_srcdir)/itpp/signal/resampling.cpp \ 20 | $(top_srcdir)/itpp/signal/sigfun.cpp \ 21 | $(top_srcdir)/itpp/signal/source.cpp \ 22 | $(top_srcdir)/itpp/signal/transforms.cpp \ 23 | $(top_srcdir)/itpp/signal/window.cpp 24 | -------------------------------------------------------------------------------- /win32/itpp_mkl.vs2005.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "itpp_mkl", "itpp_mkl.vs2005.vcproj", "{C069ECD3-26E8-437C-8B20-3A5D68B22F2A}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {C069ECD3-26E8-437C-8B20-3A5D68B22F2A}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {C069ECD3-26E8-437C-8B20-3A5D68B22F2A}.Debug|Win32.Build.0 = Debug|Win32 14 | {C069ECD3-26E8-437C-8B20-3A5D68B22F2A}.Release|Win32.ActiveCfg = Release|Win32 15 | {C069ECD3-26E8-437C-8B20-3A5D68B22F2A}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /doc/tutorial/tutorial.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page tutorial Tutorials 3 | \addindex Tutorial 4 | 5 | This page contains some tutorial examples that will help you getting 6 | started using IT++. Most examples show how to construct some simple 7 | communication system simulations. The source codes for these examples 8 | can be found in \c {ITPP_HOME}/doc/tutorial/src. 9 | 10 | Examples of basic functionality: 11 | - \ref vector_and_matrix 12 | - \ref itfile 13 | - \ref timer 14 | 15 | Examples of communications related functions: 16 | - \ref bpsk 17 | - \ref interleaver 18 | - \ref qpsk_simulation 19 | - \ref reedsolomon 20 | - \ref convcode 21 | - \ref spread 22 | - \ref rayleigh 23 | 24 | More specialized examples: 25 | - \ref mimoconv 26 | - \ref ldpc_gen_codes 27 | - \ref ldpc_bersim_awgn 28 | - \ref pccc_bersim_awgn 29 | - \ref exit_pccc 30 | - \ref sccc_bersim_awgn 31 | - \ref turbo_equalizer_bersim_multipath 32 | - \ref mog 33 | 34 | Other: 35 | - \ref matlab_itpp 36 | 37 | */ 38 | -------------------------------------------------------------------------------- /doc/tutorial/src/vector_and_matrix.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace itpp; 4 | 5 | //These lines are needed for use of cout and endl 6 | using std::cout; 7 | using std::endl; 8 | 9 | int main() 10 | { 11 | //Declare vectors and matricies: 12 | vec a, b, c; 13 | mat A, B; 14 | 15 | //Use the function linspace to define a vector: 16 | a = linspace(1.0, 2.0, 10); 17 | 18 | //Use a string of values to define a vector: 19 | b = "0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0"; 20 | 21 | //Add two vectors: 22 | c = a + b; 23 | 24 | //Print results: 25 | cout << "a = " << a << endl; 26 | cout << "b = " << b << endl; 27 | cout << "c = " << c << endl; 28 | 29 | //Use a string to define a matrix: 30 | A = "1.0 2.0;3.0 4.0"; 31 | 32 | //Calculate the inverse of matrix A: 33 | B = inv(A); 34 | 35 | //Print results: 36 | cout << "A = " << A << endl; 37 | cout << "B = " << B << endl; 38 | 39 | //Exit program: 40 | return 0; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /tests/lu_test.ref: -------------------------------------------------------------------------------- 1 | ================================= 2 | Test of LU factorization routines 3 | ================================= 4 | Real matrix 5 | X = [[-0.283885 0.56497 -1.0746 -0.732016 -0.869443] 6 | [1.36446 -0.596145 2.36476 -2.10553 -0.0504762] 7 | [0.906001 -1.19732 2.36508 -0.923457 0.799682] 8 | [1.24942 -1.26756 1.22804 -1.89227 1.02849] 9 | [1.55783 -0.300385 0.234136 -0.664315 -0.900489]] 10 | norm(X - P^T*L*U) = 0 11 | Complex matrix 12 | X = [[-0.160972-1.29916i 0.794379+1.03288i -0.127081+0.388325i 1.13396-0.225782i 0.562993-0.0690923i] 13 | [0.0361926+1.01917i -0.190616-0.710921i -0.572027-1.62447i 1.07734-0.884797i -0.822132+0.953281i] 14 | [-1.04693+0.760191i 1.32367+0.349763i -0.320883+0.1836i 0.465648-0.60769i -0.128067+0.278311i] 15 | [-0.280465+0.361084i 0.510483+0.174148i -1.02371+0.214321i 0.0533137-0.121635i 0.598587-0.190616i] 16 | [0.780099+0.643584i 0.475202-0.708159i -0.98353+0.261137i -0.848777-1.28903i -0.13041+0.0775548i]] 17 | norm(X - P^H*L*U = 0 18 | -------------------------------------------------------------------------------- /doc/tutorial/turbo_equalizer_bersim_multipath.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page turbo_equalizer_bersim_multipath Simulation of turbo equalizer in multipath channels 3 | 4 | The turbo equalizer uses a SISO NSC module and a SISO equalizer module. Optionally a precoder can be used at the channel input 5 | (by default the precoder is enabled). 6 | 7 | Reference: R. Koetter, A. C. Singer, and M. Tuchler, ''Turbo equalization: an iterative equalization and decoding 8 | technique for coded data transmision,`` IEEE Signal Processing Magazine, pp. 67-80, Jan. 2004 9 | 10 | \include turbo_equalizer_bersim_multipath.cpp 11 | 12 | When you run this program, the results (BER and EbN0_dB) are saved into turbo_equalizer_bersim_multipath.it file. 13 | Using the following MATLAB script 14 | \code 15 | clear all 16 | itload('turbo_equalizer_bersim_multipath.it'); 17 | figure 18 | semilogy(EbN0_dB, BER, 'o-') 19 | grid on 20 | xlabel('E_b/N_0 [dB]') 21 | ylabel('BER') 22 | \endcode 23 | the results can be displayed. 24 | */ 25 | -------------------------------------------------------------------------------- /tests/svd_test.ref: -------------------------------------------------------------------------------- 1 | ================================ 2 | Test of svd routines 3 | ================================ 4 | Real matrix 5 | A = [[-0.283885 0.56497 -1.0746 -0.732016 -0.869443] 6 | [1.36446 -0.596145 2.36476 -2.10553 -0.0504762] 7 | [0.906001 -1.19732 2.36508 -0.923457 0.799682] 8 | [1.24942 -1.26756 1.22804 -1.89227 1.02849] 9 | [1.55783 -0.300385 0.234136 -0.664315 -0.900489]] 10 | norm(A - U*diag(S)*V^T) = 0 11 | 12 | Complex matrix 13 | A = [[-0.160972-1.29916i 0.794379+1.03288i -0.127081+0.388325i 1.13396-0.225782i 0.562993-0.0690923i] 14 | [0.0361926+1.01917i -0.190616-0.710921i -0.572027-1.62447i 1.07734-0.884797i -0.822132+0.953281i] 15 | [-1.04693+0.760191i 1.32367+0.349763i -0.320883+0.1836i 0.465648-0.60769i -0.128067+0.278311i] 16 | [-0.280465+0.361084i 0.510483+0.174148i -1.02371+0.214321i 0.0533137-0.121635i 0.598587-0.190616i] 17 | [0.780099+0.643584i 0.475202-0.708159i -0.98353+0.261137i -0.848777-1.28903i -0.13041+0.0775548i]] 18 | norm(A - U*diag(S)*V^H) = 0 19 | -------------------------------------------------------------------------------- /itpp/base/algebra/sources.mk: -------------------------------------------------------------------------------- 1 | noinst_h_base_algebra_sources = \ 2 | $(top_srcdir)/itpp/base/algebra/lapack.h 3 | 4 | h_base_algebra_sources = \ 5 | $(top_srcdir)/itpp/base/algebra/cholesky.h \ 6 | $(top_srcdir)/itpp/base/algebra/det.h \ 7 | $(top_srcdir)/itpp/base/algebra/eigen.h \ 8 | $(top_srcdir)/itpp/base/algebra/inv.h \ 9 | $(top_srcdir)/itpp/base/algebra/ls_solve.h \ 10 | $(top_srcdir)/itpp/base/algebra/lu.h \ 11 | $(top_srcdir)/itpp/base/algebra/qr.h \ 12 | $(top_srcdir)/itpp/base/algebra/schur.h \ 13 | $(top_srcdir)/itpp/base/algebra/svd.h 14 | 15 | cpp_base_algebra_sources = \ 16 | $(top_srcdir)/itpp/base/algebra/cholesky.cpp \ 17 | $(top_srcdir)/itpp/base/algebra/det.cpp \ 18 | $(top_srcdir)/itpp/base/algebra/eigen.cpp \ 19 | $(top_srcdir)/itpp/base/algebra/inv.cpp \ 20 | $(top_srcdir)/itpp/base/algebra/ls_solve.cpp \ 21 | $(top_srcdir)/itpp/base/algebra/lu.cpp \ 22 | $(top_srcdir)/itpp/base/algebra/qr.cpp \ 23 | $(top_srcdir)/itpp/base/algebra/schur.cpp \ 24 | $(top_srcdir)/itpp/base/algebra/svd.cpp 25 | 26 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/Makefile.common 2 | 3 | ACLOCAL_AMFLAGS = -I m4 4 | 5 | AUTOMAKE_OPTIONS = dist-bzip2 6 | 7 | if HTML_DOC 8 | HTML_DOC_DIR = doc 9 | endif 10 | 11 | if RUN_TESTS 12 | TEST_DIR = tests 13 | endif 14 | 15 | SUBDIRS = itpp extras win32 $(HTML_DOC_DIR) $(TEST_DIR) 16 | 17 | EXTRA_DIST = \ 18 | autogen.sh \ 19 | ChangeLog-2005 \ 20 | ChangeLog-2006 \ 21 | ChangeLog-2007 \ 22 | ChangeLog-2008 \ 23 | configure.ac.in \ 24 | itpp-config.1.in \ 25 | itpp.spec \ 26 | itpp.spec.in \ 27 | Makefile.common \ 28 | NEWS-3.10 \ 29 | NEWS-3.9 \ 30 | NEWS-3.99 \ 31 | NEWS-4.0 \ 32 | TODO \ 33 | VERSION 34 | 35 | dist_man_MANS = itpp-config.1 36 | 37 | bin_SCRIPTS = itpp-config 38 | 39 | pkgconfigdir = $(libdir)/pkgconfig 40 | pkgconfig_DATA = itpp.pc 41 | if ENABLE_DEBUG 42 | pkgconfig_DATA += itpp_debug.pc 43 | endif 44 | 45 | clean-local: 46 | rm -f config_summary.log 47 | 48 | uninstall-local: 49 | rm -rf $(DESTDIR)$(includedir)/itpp 50 | 51 | dist-html: 52 | $(MAKE) -C doc dist-html 53 | 54 | -------------------------------------------------------------------------------- /itpp/base/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/Makefile.common 2 | include $(srcdir)/sources.mk 3 | 4 | SUBDIRS = algebra bessel math 5 | 6 | noinst_LTLIBRARIES = libbase.la 7 | if ENABLE_DEBUG 8 | noinst_LTLIBRARIES += libbase_debug.la 9 | endif 10 | 11 | libbase_la_SOURCES = $(noinst_h_base_sources) $(h_base_sources) \ 12 | $(cpp_base_sources) 13 | libbase_la_CXXFLAGS = $(CXXFLAGS_OPT) 14 | libbase_la_LIBADD = \ 15 | $(top_builddir)/@PACKAGE@/base/algebra/libalgebra.la \ 16 | $(top_builddir)/@PACKAGE@/base/bessel/libbessel.la \ 17 | $(top_builddir)/@PACKAGE@/base/math/libmath.la 18 | 19 | libbase_debug_la_SOURCES = $(noinst_h_base_sources) $(h_base_sources) \ 20 | $(cpp_base_sources) 21 | libbase_debug_la_CXXFLAGS = $(CXXFLAGS_DEBUG) 22 | libbase_debug_la_LIBADD = \ 23 | $(top_builddir)/@PACKAGE@/base/algebra/libalgebra_debug.la \ 24 | $(top_builddir)/@PACKAGE@/base/bessel/libbessel_debug.la \ 25 | $(top_builddir)/@PACKAGE@/base/math/libmath_debug.la 26 | 27 | pkgincludedir = $(includedir)/@PACKAGE@/base 28 | pkginclude_HEADERS = $(h_base_sources) 29 | -------------------------------------------------------------------------------- /tests/interleaver_test.ref: -------------------------------------------------------------------------------- 1 | Testing Block_Interleaver: 2 | input = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20] 3 | output = [1 5 9 13 17 2 6 10 14 18 3 7 11 15 19 4 8 12 16 20] 4 | deinterleaved = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20] 5 | =============================================================== 6 | Testing Cross_Interleaver: 7 | input = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25] 8 | output = [1 0 0 0 0 6 2 0 0 0 11 7 3 0 0 16 12 8 4 0 21 17 13 9 5 0 22 18 14 10 0 0 23 19 15 0 0 0 24 20 0 0 0 0 25 0 0 0 0 0] 9 | deinterleaved = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25] 10 | =============================================================== 11 | Testing Sequence_Interleaver: 12 | input = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25] 13 | output = [22 4 8 15 11 16 12 3 24 6 17 23 25 5 21 19 14 10 1 20 13 2 18 7 9] 14 | deinterleaved = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25] 15 | =============================================================== 16 | -------------------------------------------------------------------------------- /doc/tutorial/exit_pccc.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page exit_pccc EXIT chart of PCCCs 3 | 4 | This program computes the EXtrinsic Information Transfer (EXIT) chart for 5 | Parallel Concatenated Convolutional Codes (PCCCs) of coding rate 1/3. Actually the Transfer Characteristics 6 | (TCs) of the two SISO RSC modules used in the turbo decoder are computed at a given Signal to Noise Ratio (SNR). 7 | 8 | Reference: S. ten Brink, ''Convergence behavior of iteratively decoded parallel concatenated codes,`` IEEE Transactions on Communications, vol. 49, pp. 1727-1737, Oct. 2001 9 | 10 | \include exit_pccc.cpp 11 | 12 | When you run this program, the results (mutual a priori and extrinsic information, EbN0_dB, etc.) are saved into exit_pccc.it file. 13 | Using the following MATLAB script 14 | \code 15 | clear all 16 | itload('exit_pccc.it') 17 | plot(IA, IE, 'LineWidth', 3) 18 | hold on 19 | plot(IE_p, IA, 'LineWidth', 3) 20 | xlabel('I_A^{(up)}, I_E^{(low)}') 21 | ylabel('I_E^{(up)}, I_A^{(low)}') 22 | grid on 23 | title(['E_b/N_0 = ' num2str(EbN0_dB) ' dB']) 24 | \endcode 25 | the EXIT chart can be displayed. 26 | */ 27 | -------------------------------------------------------------------------------- /doc/tutorial/sources.mk: -------------------------------------------------------------------------------- 1 | doc_tutorial_sources = \ 2 | $(top_srcdir)/doc/tutorial/bpsk.doc \ 3 | $(top_srcdir)/doc/tutorial/convcode.doc \ 4 | $(top_srcdir)/doc/tutorial/interleaver.doc \ 5 | $(top_srcdir)/doc/tutorial/itfile.doc \ 6 | $(top_srcdir)/doc/tutorial/qpsk_simulation.doc \ 7 | $(top_srcdir)/doc/tutorial/rayleigh.doc \ 8 | $(top_srcdir)/doc/tutorial/reedsolomon.doc \ 9 | $(top_srcdir)/doc/tutorial/spread.doc \ 10 | $(top_srcdir)/doc/tutorial/timer.doc \ 11 | $(top_srcdir)/doc/tutorial/tutorial.doc \ 12 | $(top_srcdir)/doc/tutorial/vector_and_matrix.doc \ 13 | $(top_srcdir)/doc/tutorial/mimoconv.doc \ 14 | $(top_srcdir)/doc/tutorial/demapper_mimo.doc \ 15 | $(top_srcdir)/doc/tutorial/matlab_itpp.doc \ 16 | $(top_srcdir)/doc/tutorial/mog.doc \ 17 | $(top_srcdir)/doc/tutorial/ldpc_gen_codes.doc \ 18 | $(top_srcdir)/doc/tutorial/ldpc_bersim_awgn.doc \ 19 | $(top_srcdir)/doc/tutorial/pccc_bersim_awgn.doc \ 20 | $(top_srcdir)/doc/tutorial/exit_pccc.doc \ 21 | $(top_srcdir)/doc/tutorial/sccc_bersim_awgn.doc \ 22 | $(top_srcdir)/doc/tutorial/turbo_equalizer_bersim_multipath.doc 23 | -------------------------------------------------------------------------------- /doc/tutorial/itfile.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page itfile Writing and reading data from files 3 | 4 | Here we will use the \c it_file class to store some data. The program \c 5 | write_it_file.cpp looks as follows: 6 | 7 | \include write_it_file.cpp 8 | 9 | When you run this program you will obtain a file called \c it_file_test.it 10 | in your current directory. You can read the file into Matlab/Octave to view 11 | the data by using the following commands: 12 | 13 | \code 14 | itload('it_file_test.it') 15 | figure(1); clf; 16 | plot(a) 17 | \endcode 18 | 19 | Note: Make sure that $PREFIX/share/itpp is in your Matlab/Octave 20 | path and that you run the code above from the directory where \c 21 | it_file_test.it is located (\c $PREFIX is the IT++ installation prefix; 22 | /usr/local by default). 23 | 24 | The IT++ program \c read_it_file.cpp that reads the file and prints its 25 | content can look like this: 26 | 27 | \include read_it_file.cpp 28 | 29 | Here is the output of the program: 30 | 31 | \verbatim 32 | a = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20] 33 | \endverbatim 34 | */ 35 | -------------------------------------------------------------------------------- /tests/schur_test.ref: -------------------------------------------------------------------------------- 1 | ========================================== 2 | Test of Schur decomposition routines 3 | ========================================== 4 | Real matrix 5 | A = [[-0.283885 0.56497 -1.0746 -0.732016 -0.869443] 6 | [1.36446 -0.596145 2.36476 -2.10553 -0.0504762] 7 | [0.906001 -1.19732 2.36508 -0.923457 0.799682] 8 | [1.24942 -1.26756 1.22804 -1.89227 1.02849] 9 | [1.55783 -0.300385 0.234136 -0.664315 -0.900489]] 10 | norm(A - U*T*U^T) = 0 11 | norm(I - U*U^T) = 0 12 | norm(lower triangular part of T) = 0 13 | 14 | Complex matrix 15 | A = [[-0.160972-1.29916i 0.794379+1.03288i -0.127081+0.388325i 1.13396-0.225782i 0.562993-0.0690923i] 16 | [0.0361926+1.01917i -0.190616-0.710921i -0.572027-1.62447i 1.07734-0.884797i -0.822132+0.953281i] 17 | [-1.04693+0.760191i 1.32367+0.349763i -0.320883+0.1836i 0.465648-0.60769i -0.128067+0.278311i] 18 | [-0.280465+0.361084i 0.510483+0.174148i -1.02371+0.214321i 0.0533137-0.121635i 0.598587-0.190616i] 19 | [0.780099+0.643584i 0.475202-0.708159i -0.98353+0.261137i -0.848777-1.28903i -0.13041+0.0775548i]] 20 | norm(A - U*T*U^H) = 0 21 | norm(I - U*U^H) = 0 22 | norm(lower triangular part of T) = 0 23 | -------------------------------------------------------------------------------- /tests/gf2mat_test.ref: -------------------------------------------------------------------------------- 1 | =========================================================== 2 | gf2mat_test: Test of matrix operations in gfmat.h/gfmat.cpp 3 | =========================================================== 4 | A=---- GF(2) matrix of dimension 3*3 -- Density: 0.333333 ---- 5 | 1 0 0 6 | 0 0 1 7 | 0 1 0 8 | 9 | A*A=---- GF(2) matrix of dimension 3*3 -- Density: 0.333333 ---- 10 | 1 0 0 11 | 0 1 0 12 | 0 0 1 13 | 14 | A*A'=---- GF(2) matrix of dimension 3*3 -- Density: 0.333333 ---- 15 | 1 0 0 16 | 0 1 0 17 | 0 0 1 18 | 19 | B=---- GF(2) matrix of dimension 3*3 -- Density: 0.333333 ---- 20 | 1 0 0 21 | 0 0 1 22 | 0 1 0 23 | 24 | B.get_row(1)=[0 0 1] 25 | B.get_col(2)=[0 1 0] 26 | v=[1 1 0] 27 | A*v=[1 0 1] 28 | rank(A)=3 29 | inv(A)=---- GF(2) matrix of dimension 3*3 -- Density: 0.333333 ---- 30 | 1 0 0 31 | 0 0 1 32 | 0 1 0 33 | 34 | C=---- GF(2) matrix of dimension 3*3 -- Density: 0.333333 ---- 35 | 1 0 0 36 | 0 1 0 37 | 0 0 1 38 | 39 | D=---- GF(2) matrix of dimension 3*3 -- Density: 0.333333 ---- 40 | 1 0 0 41 | 0 1 0 42 | 0 0 1 43 | 44 | p=[0 2 1] 45 | -------------------------------------------------------------------------------- /tests/siso_test.ref: -------------------------------------------------------------------------------- 1 | ============================================= 2 | Starting Simulation 3 | Bit error rate as a function of Eb/N0 4 | ============================================= 5 | Block length = 16384 6 | Generator polynomials = [7 5] 7 | Number of iterations = 10 8 | Max number of errors = 300 9 | Max number of tx bits = 10000 10 | Turbo encoder rate 1/3 (plus tail bits) 11 | ============================================= 12 | Now simulating EbN0db = 0 13 | Now simulating EbN0db = 0.5 14 | Now simulating EbN0db = 1 15 | Now simulating EbN0db = 1.5 16 | Now simulating EbN0db = 2 17 | Results for maxlogMAP algorithm 18 | Eb/N0 = [0.000000 0.500000 1.000000 1.500000 2.000000] [dB] 19 | BER = [[0.158039 0.110731 0.077036 0.044561 0.023501] 20 | [0.141680 0.078318 0.027347 0.004944 0.001282] 21 | [0.141375 0.056586 0.008180 0.000305 0.000000] 22 | [0.142412 0.042119 0.000733 0.000000 0.000000] 23 | [0.144244 0.028202 0.000183 0.000000 0.000000] 24 | [0.145587 0.014223 0.000000 0.000000 0.000000] 25 | [0.148517 0.007142 0.000000 0.000000 0.000000] 26 | [0.141619 0.002259 0.000000 0.000000 0.000000] 27 | [0.149676 0.000549 0.000000 0.000000 0.000000] 28 | [0.144610 0.000000 0.000000 0.000000 0.000000]] 29 | -------------------------------------------------------------------------------- /doc/local/help_wanted.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page help_wanted Make a Difference 3 | 4 | Do not ask what IT++ can do for you. Ask what you can do for IT++. 5 | 6 | You can help us to develop the IT++ library. There are always a lot of things 7 | you can do: 8 | 9 | - Start using IT++ 10 | - Tell your friends about IT++ and help them to get started using it 11 | - If you find a bug, report it to us. Without your help we can never hope to 12 | produce a bug free code. 13 | - Help us to improve the documentation by providing information about 14 | documentation bugs 15 | - Answer support requests in the IT++ discussion forums on SourceForge. If 16 | you know the answer to a question, help others to overcome their IT++ 17 | problems. 18 | - Help us to improve our algorithms. If you know of a better way (e.g. that 19 | is faster or requires less memory) to implement some of our algorithms, then 20 | let us know. 21 | - Help us to port IT++ to new platforms. If you manage to compile IT++ on a 22 | new platform, then tell us how you did it. 23 | - Send us your code. If you have a good IT++ compatible code, which you can 24 | release under the GPL, and you think it should be included in IT++, then 25 | send it to us. 26 | - Become an IT++ developer. Send us an e-mail and tell what you can do for 27 | IT++. 28 | 29 | */ 30 | -------------------------------------------------------------------------------- /doc/tutorial/pccc_bersim_awgn.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page pccc_bersim_awgn Simulation of PCCCs in an AWGN channel 3 | 4 | This program simulates Parallel Concatenated Convolutional Codes (PCCCs) of coding rate 1/3 5 | using a turbo decoder with two SISO RSC modules. 6 | 7 | Reference: S. Benedetto, D. Divsalar, G. Motorsi and F. Pollara, "A Soft-Input Soft-Output Maximum A posteriori (MAP) Module to Decode Parallel and Serial Concatenated Codes", TDA Progress Report, nov. 1996 8 | 9 | \include pccc_bersim_awgn.cpp 10 | 11 | When you run this program, the results (BER and EbN0_dB) are saved into pccc_bersim_awgn.it file. 12 | Using the following MATLAB script: 13 | \code 14 | clear all 15 | itload('pccc_bersim_awgn.it'); 16 | figure 17 | semilogy(EbN0_dB, BER, 'o-') 18 | grid on 19 | xlabel('E_b/N_0 [dB]') 20 | ylabel('BER') 21 | \endcode 22 | the results can be displayed. 23 | 24 | Similarly, the results can be displayed using the following Python script (pyitpp, numpy and matplotlib 25 | modules are required): 26 | \code 27 | #!/usr/bin/env python 28 | 29 | from pyitpp import itload 30 | from matplotlib.pyplot import * 31 | 32 | out = itload('pccc_bersim_awgn.it') 33 | 34 | semilogy(out['EbN0_dB'], out['BER'].T, 'o-') 35 | grid() 36 | xlabel('$E_b/N_0 [dB]$') 37 | ylabel('$BER$') 38 | show() 39 | \endcode 40 | */ 41 | -------------------------------------------------------------------------------- /doc/tutorial/src/interleaver.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace itpp; 4 | 5 | //These lines are needed for use of cout and endl 6 | using std::cout; 7 | using std::endl; 8 | 9 | int main() 10 | { 11 | //Declare scalars and vectors: 12 | int rows, cols; 13 | ivec input, output, deinterleaved; 14 | 15 | //Declare the interleaver. The interleaver classes are templated, and therefore we must specify 16 | //the type of the data elements. In this example we are using integers: 17 | Block_Interleaver my_interleaver; 18 | 19 | //Initialize the interleaver class. Note that this can be done already in the declaration by writing 20 | //Block_Interleaver my_interleaver(rows,cols); 21 | rows = 4; 22 | cols = 5; 23 | my_interleaver.set_rows(rows); 24 | my_interleaver.set_cols(cols); 25 | 26 | //Define the input to the interleaver: 27 | input = "1:20"; 28 | 29 | //Do the interleaving: 30 | output = my_interleaver.interleave(input); 31 | 32 | //Do the de-interleaving: 33 | deinterleaved = my_interleaver.deinterleave(output); 34 | 35 | //Print the results: 36 | cout << "input = " << input << endl; 37 | cout << "output = " << output << endl; 38 | cout << "deinterleaved = " << deinterleaved << endl; 39 | 40 | //Exit program: 41 | return 0; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /extras/astylerc: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- 2 | # This is an astyle configuration file, which can be used for indenting, 3 | # formatting and beautifying IT++ header and source files. The Artistic 4 | # Style (astyle) program can be downloaded from the following site: 5 | # http://astyle.sourceforge.net/ 6 | # To filter a source or header file using this option please use the 7 | # following command: 8 | # $ astyle --options=/extras/astylerc file.cpp 9 | # 10 | # Similar indentation style can be obtained in GNU emacs editor by 11 | # adding these settings to the default .emacs configuration file: 12 | # 13 | # (defun it++-mode () 14 | # "C++ mode with adjusted defaults for use with the IT++ project." 15 | # (interactive) 16 | # (c++-mode) 17 | # (c-set-style "gnu") 18 | # (c-set-offset 'innamespace 0) 19 | # (setq c-basic-offset 2) 20 | # (setq indent-tabs-mode nil) 21 | # (setq c-block-comment-prefix "* ")) 22 | # 23 | # (setq auto-mode-alist (cons '("itpp.*/.*\\.\\(h\\|cpp\\)$" . it++-mode) 24 | # auto-mode-alist)) 25 | # ---------------------------------------------------------------------- 26 | indent=spaces=2 27 | brackets=linux 28 | break-closing-brackets 29 | indent-labels 30 | pad-oper 31 | unpad-paren 32 | keep-one-line-blocks 33 | convert-tabs 34 | -------------------------------------------------------------------------------- /tests/converters_test.ref: -------------------------------------------------------------------------------- 1 | ================================== 2 | Test of conversion functions 3 | ================================== 4 | v = [-4 -3.5 -3 -2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 -15.6777 17.2892 8.12002 14.9884 21.1566 1.29941 -21.9229 -33.9464 -35.3513 -16.0077] 5 | 6 | round(v) = [-4 -4 -3 -2 -2 -2 -1 0 0 0 1 2 2 2 3 4 4 4 5 6 -16 17 8 15 21 1 -22 -34 -35 -16] 7 | round_i(v) = [-4 -4 -3 -2 -2 -2 -1 0 0 0 1 2 2 2 3 4 4 4 5 6 -16 17 8 15 21 1 -22 -34 -35 -16] 8 | 9 | ceil(v) = [-4 -3 -3 -2 -2 -1 -1 0 0 1 1 2 2 3 3 4 4 5 5 6 -15 18 9 15 22 2 -21 -33 -35 -16] 10 | ceil_i(v) = [-4 -3 -3 -2 -2 -1 -1 0 0 1 1 2 2 3 3 4 4 5 5 6 -15 18 9 15 22 2 -21 -33 -35 -16] 11 | 12 | floor(v) = [-4 -4 -3 -3 -2 -2 -1 -1 0 0 1 1 2 2 3 3 4 4 5 5 -16 17 8 14 21 1 -22 -34 -36 -17] 13 | floor_i(v) = [-4 -4 -3 -3 -2 -2 -1 -1 0 0 1 1 2 2 3 3 4 4 5 5 -16 17 8 14 21 1 -22 -34 -36 -17] 14 | 15 | b = [1 1 0 0 1 1 0 0 0 0 0 1 0 1 0] 16 | 17 | bin2dec(b) = 26122 18 | dec2bin(bin2dec(b)) = [1 1 0 0 1 1 0 0 0 0 0 1 0 1 0] 19 | bin2dec(b, false) = 10291 20 | dec2bin(bin2dec(b, false), false) = [1 1 0 0 1 1 0 0 0 0 0 1 0 1] 21 | 22 | bin2oct(b) = [6 3 0 1 2] 23 | oct2bin(bin2oct(b)) = [1 1 0 0 1 1 0 0 0 0 0 1 0 1 0] 24 | oct2bin(bin2oct(b), 1) = [1 1 0 0 1 1 0 0 0 0 0 1 0 1 0] 25 | 26 | bin2pol(b) = [-1 -1 1 1 -1 -1 1 1 1 1 1 -1 1 -1 1] 27 | pol2bin(bin2pol(b)) = [1 1 0 0 1 1 0 0 0 0 0 1 0 1 0] 28 | 29 | -------------------------------------------------------------------------------- /tests/stat_test.ref: -------------------------------------------------------------------------------- 1 | ================================= 2 | Test of statistical routines 3 | ================================= 4 | a = [-0.283885 1.36446 0.906001 1.24942 1.55783] 5 | 6 | max(a) = 1.55783 7 | min(a) = -0.283885 8 | mean(a) = 0.958766 9 | geometric_mean(abs(a)) = 0.926599 10 | norm(a) = 2.59828 11 | norm(a, 2) = 2.59828 12 | norm(a, 1) = 5.3616 13 | norm(a, "fro") = 2.59828 14 | energy(a) = 6.75107 15 | variance(a) = 0.538728 16 | moment(a, 1) = 0 17 | moment(a, 2) = 0.430982 18 | moment(a, 3) = -0.322541 19 | skewness(a) = -1.21597 20 | kurtosisexcess(a) = -0.977874 21 | kurtosis(a) = 2.02213 22 | 23 | A = [[0.56497 -1.0746 -0.732016 -0.869443 -0.227649] 24 | [-0.596145 2.36476 -2.10553 -0.0504762 -1.83729] 25 | [-1.19732 2.36508 -0.923457 0.799682 0.0511841] 26 | [-1.26756 1.22804 -1.89227 1.02849 1.44132] 27 | [-0.300385 0.234136 -0.664315 -0.900489 -1.48058]] 28 | 29 | max(A) = [0.56497 2.36508 -0.664315 1.02849 1.44132] 30 | max(A, 1) = [0.56497 2.36508 -0.664315 1.02849 1.44132] 31 | max(A, 2) = [0.56497 2.36476 2.36508 1.44132 0.234136] 32 | min(A) = [-1.26756 -1.0746 -2.10553 -0.900489 -1.83729] 33 | min(A, 1) = [-1.26756 -1.0746 -2.10553 -0.900489 -1.83729] 34 | min(A, 2) = [-1.0746 -2.10553 -1.19732 -1.89227 -1.48058] 35 | mean(A) = -0.241675 36 | geometric_mean(abs(A)) = 0.748042 37 | norm(A) = 5.02569 38 | norm(A, 2) = 5.02569 39 | norm(A, 1) = 7.26662 40 | norm(A, "fro") = 6.20633 41 | 42 | -------------------------------------------------------------------------------- /doc/tutorial/src/bpsk.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace itpp; 4 | 5 | //These lines are needed for use of cout and endl 6 | using std::cout; 7 | using std::endl; 8 | 9 | int main() 10 | { 11 | //Scalars 12 | int N; 13 | double N0; 14 | 15 | //Vectors 16 | bvec bits, dec_bits; 17 | vec symbols, rec; 18 | 19 | //Classes 20 | BPSK bpsk; //The BPSK modulator/debodulator class 21 | BERC berc; //The Bit Error Rate Counter class 22 | 23 | //Init 24 | N = 500000; //The number of bits to simulate 25 | N0 = 1; //0 dB SNR 26 | 27 | //Randomize the random number generator 28 | RNG_randomize(); 29 | 30 | //Generate the bits: 31 | bits = randb(N); 32 | 33 | //Do the BPSK modulation 34 | bpsk.modulate_bits(bits, symbols); 35 | 36 | //Add the AWGN 37 | rec = symbols + sqrt(N0 / 2) * randn(N); 38 | 39 | //Decode the received bits 40 | bpsk.demodulate_bits(rec, dec_bits); 41 | 42 | //Count the number of errors 43 | berc.count(bits, dec_bits); 44 | 45 | //Print the results 46 | cout << "There were " << berc.get_errors() << " received bits in error." << endl; 47 | cout << "There were " << berc.get_corrects() << " correctly received bits." << endl; 48 | cout << "The error probability was " << berc.get_errorrate() << endl; 49 | cout << "The theoretical error probability is " << 0.5*erfc(1.0) << endl; 50 | 51 | //Exit program: 52 | return 0; 53 | 54 | } 55 | -------------------------------------------------------------------------------- /itpp/fixed/fixed.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Implementation of a fixed-point data type Fixed 4 | * \author Johan Bergman 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | 31 | 32 | namespace itpp 33 | { 34 | 35 | // Template instantiations 36 | template class ITPP_EXPORT Fixed<64, TC, WRAP>; 37 | 38 | } // namespace itpp 39 | -------------------------------------------------------------------------------- /itpp/fixed/cfixed.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Implementation of a complex fixed-point data type CFixed 4 | * \author Johan Bergman 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | 31 | 32 | namespace itpp 33 | { 34 | 35 | // Template instantiations 36 | template class ITPP_EXPORT CFixed<64, TC, WRAP>; 37 | 38 | } // namespace itpp 39 | -------------------------------------------------------------------------------- /doc/tutorial/src/dump_it_file.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace itpp; 6 | using namespace std; 7 | 8 | int main(int argc, char *argv[]) 9 | { 10 | it_ifile ff; 11 | 12 | if (1 >= argc) 13 | { 14 | cout << "Usage: " << argv[0] << " file.it" << endl; 15 | return EXIT_FAILURE; 16 | } 17 | 18 | for (int i = 1; i < argc; ++i) 19 | { 20 | ff.open(argv[i]); 21 | cout << "Opening " << argv[i] << endl; 22 | int n = 0; 23 | string name; 24 | string type; 25 | string desc; 26 | uint64_t bytes; 27 | while(true == ff.seek(n++)) 28 | { 29 | ff.info(name, type, desc, bytes); 30 | cout << name << ": "; 31 | if ("dmat" == type) 32 | { 33 | mat tmp; 34 | ff >> tmp; 35 | cout << tmp; 36 | } else if ("imat" == type) 37 | { 38 | imat tmp; 39 | ff >> tmp; 40 | cout << tmp; 41 | } else if ("dvec" == type) 42 | { 43 | vec tmp; 44 | ff >> tmp; 45 | cout << tmp; 46 | } else if ("ivec" == type) 47 | { 48 | ivec tmp; 49 | ff >> tmp; 50 | cout << tmp; 51 | } else if ("float64" == type) 52 | { 53 | double tmp; 54 | ff >> tmp; 55 | cout << tmp; 56 | } else if ("int32" == type) 57 | { 58 | int tmp; 59 | ff >> tmp; 60 | cout << tmp; 61 | } else 62 | { 63 | cout << type; 64 | } 65 | cout << endl; 66 | } 67 | ff.close(); 68 | } 69 | return EXIT_SUCCESS; 70 | } 71 | -------------------------------------------------------------------------------- /doc/tutorial/qpsk_simulation.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page qpsk_simulation Simulation of QPSK modulation on an AWGN channel 3 | 4 | In this example we will introduce a few new features compared to the BPSK example. We will use the it_ifile class to store the results of the simulation. We will use the Real_Timer class to measure the execution time of our program. Furthermore we will use one of the channel classes, the AWGN_Channel. We will also show how to read the results in to Matlab with the load_it function. The program is as follows: 5 | 6 | \include qpsk_simulation.cpp 7 | 8 | When you run this program, the output will look something like this: 9 | 10 | \include qpsk_simulation.ref 11 | 12 | Now it is time to plot the simulation results in Matlab and compare with theory using the Matlab code below. 13 | The results will be stored in a file called "qpsk_result_file.it". Make sure load_it.m is in your Matlab path 14 | (look in $(ITXX_HOME)/matlab) and that you run the example code below from the directory where qpsk_result_file.it is located 15 | 16 | \code 17 | figure(1); clf; 18 | load_it qpsk_result_file.it 19 | h1 = semilogy(EbN0dB,ber,'*-r'); hold on 20 | ebn0db = 0:.1:10; 21 | ebn0 = 10.^(ebn0db/10); 22 | Pb = 0.5 * erfc(sqrt(ebn0)); 23 | h2 = semilogy(ebn0db,Pb); 24 | set(gca,'fontname','times','fontsize',16); 25 | xlabel('{\it E_b} / {\it N}_0 [dB]'); 26 | ylabel('BER') 27 | title('QPSK on an AWGN Channel'); 28 | legend([h1 h2],'Simulation','Theory'); 29 | grid on; 30 | \endcode 31 | 32 | */ 33 | -------------------------------------------------------------------------------- /extras/astylerc_old: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- 2 | # This is an astyle configuration file, which can be used for indenting, 3 | # formatting and beautifying IT++ header and source files. The Artistic 4 | # Style (astyle) program can be downloaded from the following site: 5 | # http://astyle.sourceforge.net/ 6 | # 7 | # Please note that this file is compatible with older version of astyle, 8 | # i.e. 1.x series (e.g. 1.24) 9 | # 10 | # To filter a source or header file using this option please use the 11 | # following command: 12 | # $ astyle --options=/extras/astylerc_old file.cpp 13 | # 14 | # Similar indentation style can be obtained in GNU emacs editor by 15 | # adding these settings to the default .emacs configuration file: 16 | # 17 | # (defun it++-mode () 18 | # "C++ mode with adjusted defaults for use with the IT++ project." 19 | # (interactive) 20 | # (c++-mode) 21 | # (c-set-style "gnu") 22 | # (c-set-offset 'innamespace 0) 23 | # (setq c-basic-offset 2) 24 | # (setq indent-tabs-mode nil) 25 | # (setq c-block-comment-prefix "* ")) 26 | # 27 | # (setq auto-mode-alist (cons '("itpp.*/.*\\.\\(h\\|cpp\\)$" . it++-mode) 28 | # auto-mode-alist)) 29 | # ---------------------------------------------------------------------- 30 | indent=spaces=2 31 | brackets=linux 32 | brackets=break-closing 33 | indent-labels 34 | pad=oper 35 | unpad=paren 36 | one-line=keep-blocks 37 | convert-tabs 38 | -------------------------------------------------------------------------------- /itpp/itoptim.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Include file for the IT++ optimization module 4 | * \author Adam Piatyszek 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #ifndef ITOPTIM_H 30 | #define ITOPTIM_H 31 | 32 | /*! 33 | * \defgroup optimization Numerical Optimization Module 34 | * @{ 35 | */ 36 | 37 | /*! 38 | * @} 39 | */ 40 | 41 | #include 42 | #include 43 | 44 | #endif // #ifndef ITOPTIM_H 45 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | IT++ People 2 | =========== 3 | 4 | Project Admins 5 | -------------- 6 | o Bogdan Cristea (cristeab) 7 | o Tony Ottosson (tonyottosson) 8 | o Adam Piatyszek (ediap) 9 | 10 | Developers 11 | ---------- 12 | o Mirsad Čirkić (mirsadcirkic) 13 | o Johan Bergman (emwjohb) 14 | o Thomas Eriksson (thomases2) 15 | o Pal Frenger (frenger) 16 | o Fredrik Huss (frehu) 17 | o Erik G. Larsson (erik_g_larsson) 18 | o Stephan Ludwig (donludovico) 19 | o Robert Orzechowski (tytusz) 20 | o Andy Panov (andypanov) 21 | o Conrad Sanderson (conrad_s) 22 | o Andreas Wolfgang (andreas-w) 23 | o Simon Wood (sgwoodjr) 24 | 25 | Retired Developers 26 | ------------------ 27 | o Hakan Eriksson (hakanbe) 28 | o Thomas Lemaire 29 | o Anders Persson 30 | o Tobias Ringstrom 31 | o Jonas Samuelsson 32 | 33 | Contributors 34 | ------------ 35 | o Mattias Andersson 36 | o Kumar Appaiah 37 | o Francois Cayre 38 | o Zbigniew Dlugaszewski 39 | o Mark Dobossy 40 | o Sean Finney 41 | o Teddy Furon 42 | o Bjorn Furugard 43 | o Kenneth Hilmersson 44 | o Peter Klotz 45 | o Krister Norlund 46 | o Steve Peters 47 | o Gorka Prieto 48 | o Martin Senst 49 | o Svante Signell 50 | o Vasek Smidl 51 | o Erik Stoy 52 | o Tobias Tynderfeldt 53 | 54 | Distribution Maintainers 55 | ------------------------ 56 | o Kumar Appaiah - Debian 57 | o Gunter Dannoritzer (dannori) - openSUSE 58 | o Markus Dittrich - Gentoo Linux 59 | o Ed Hill (edhill) - Fedora Extras 60 | 61 | -------------------------------------------------------------------------------- /doc/tutorial/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # \file CMakeLists.txt 3 | # \brief cmake configuration file for tutorial examples 4 | # \author Bogdan Cristea 5 | # 6 | # ------------------------------------------------------------------------- 7 | # 8 | # Copyright (C) 1995-2012 (see AUTHORS file for a list of contributors) 9 | # 10 | # This file is part of IT++ - a C++ library of mathematical, signal 11 | # processing, speech processing, and communications classes and functions. 12 | # 13 | # IT++ is free software: you can redistribute it and/or modify it under the 14 | # terms of the GNU General Public License as published by the Free Software 15 | # Foundation, either version 3 of the License, or (at your option) any 16 | # later version. 17 | # 18 | # IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | # details. 22 | # 23 | # You should have received a copy of the GNU General Public License along 24 | # with IT++. If not, see . 25 | # 26 | # ------------------------------------------------------------------------- 27 | 28 | file ( GLOB ITPP_EXAMPLES_SRCS *.cpp ) 29 | 30 | include_directories ( ${PROJECT_SOURCE_DIR} ${CMAKE_BINARY_DIR} ) 31 | 32 | foreach (FILE ${ITPP_EXAMPLES_SRCS}) 33 | get_filename_component ( target ${FILE} NAME_WE ) 34 | add_executable ( ${target} ${FILE} ) 35 | target_link_libraries ( ${target} ${ITPP_LIBS} ${libitpp_target} ) 36 | endforeach (FILE) 37 | -------------------------------------------------------------------------------- /itpp/signal/freq_filt.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Implementation of Freq_Filt Class 4 | * \author Simon Wood 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | 31 | 32 | //! \cond 33 | 34 | namespace itpp 35 | { 36 | 37 | template class ITPP_EXPORT Freq_Filt; 38 | template class ITPP_EXPORT Freq_Filt >; 39 | template class ITPP_EXPORT Freq_Filt; 40 | template class ITPP_EXPORT Freq_Filt; 41 | 42 | } // namespace itpp 43 | 44 | //! \endcond 45 | -------------------------------------------------------------------------------- /tests/galois_test.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Galois Field algebra classes test program 4 | * \author Tony Ottosson and Adam Piatyszek 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | #include 31 | 32 | using namespace itpp; 33 | using namespace std; 34 | 35 | int main() 36 | { 37 | GF a(8), b(8), c(8); 38 | 39 | a = 4; 40 | b = 2; 41 | 42 | c = a + b; 43 | 44 | cout << "a=" << a << ", b=" << b << endl; 45 | cout << "c=" << c << endl; 46 | 47 | return 0; 48 | } 49 | -------------------------------------------------------------------------------- /win32/itpp_acml_tests/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/Makefile.common 2 | 3 | EXTRA_DIST = \ 4 | itpp_acml_tests.sln \ 5 | array_test.vcproj \ 6 | bch_test.vcproj \ 7 | bessel_test.vcproj \ 8 | blas_test.vcproj \ 9 | channel_test.vcproj \ 10 | cholesky_test.vcproj \ 11 | circular_buffer_test.vcproj \ 12 | commfunc_test.vcproj \ 13 | convcode_test.vcproj \ 14 | converters_test.vcproj \ 15 | det_test.vcproj \ 16 | eigen_test.vcproj \ 17 | error_count_test.vcproj \ 18 | fastica_test.vcproj \ 19 | fastmath_test.vcproj \ 20 | filter_design_test.vcproj \ 21 | filter_test.vcproj \ 22 | fix_test.vcproj \ 23 | freq_filt_test.vcproj \ 24 | galois_test.vcproj \ 25 | gf2mat_test.vcproj \ 26 | histogram_test.vcproj \ 27 | integration_test.vcproj \ 28 | interleaver_test.vcproj \ 29 | inv_test.vcproj \ 30 | itfile_test.vcproj \ 31 | ldpc_test.vcproj \ 32 | llr_test.vcproj \ 33 | ls_solve_test.vcproj \ 34 | lu_test.vcproj \ 35 | matfunc_test.vcproj \ 36 | mat_test.vcproj \ 37 | modulator_nd_test.vcproj \ 38 | modulator_test.vcproj \ 39 | newton_search_test.vcproj \ 40 | parser_test.vcproj \ 41 | poly_test.vcproj \ 42 | pulse_shape_test.vcproj \ 43 | qr_test.vcproj \ 44 | rand_test.vcproj \ 45 | rec_syst_conv_code_test.vcproj \ 46 | reedsolomon_test.vcproj \ 47 | schur_test.vcproj \ 48 | sigfun_test.vcproj \ 49 | sort_test.vcproj \ 50 | source_test.vcproj \ 51 | sparse_test.vcproj \ 52 | specmat_test.vcproj \ 53 | stat_test.vcproj \ 54 | svd_test.vcproj \ 55 | timer_test.vcproj \ 56 | transforms_test.vcproj \ 57 | turbo_test.vcproj \ 58 | vec_test.vcproj \ 59 | window_test.vcproj 60 | 61 | -------------------------------------------------------------------------------- /win32/itpp_mkl_tests/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/Makefile.common 2 | 3 | EXTRA_DIST = \ 4 | itpp_mkl_tests.sln \ 5 | array_test.vcproj \ 6 | bch_test.vcproj \ 7 | bessel_test.vcproj \ 8 | blas_test.vcproj \ 9 | channel_test.vcproj \ 10 | cholesky_test.vcproj \ 11 | circular_buffer_test.vcproj \ 12 | commfunc_test.vcproj \ 13 | convcode_test.vcproj \ 14 | converters_test.vcproj \ 15 | det_test.vcproj \ 16 | eigen_test.vcproj \ 17 | error_count_test.vcproj \ 18 | fastica_test.vcproj \ 19 | fastmath_test.vcproj \ 20 | filter_design_test.vcproj \ 21 | filter_test.vcproj \ 22 | fix_test.vcproj \ 23 | freq_filt_test.vcproj \ 24 | galois_test.vcproj \ 25 | gf2mat_test.vcproj \ 26 | histogram_test.vcproj \ 27 | integration_test.vcproj \ 28 | interleaver_test.vcproj \ 29 | inv_test.vcproj \ 30 | itfile_test.vcproj \ 31 | ldpc_test.vcproj \ 32 | llr_test.vcproj \ 33 | ls_solve_test.vcproj \ 34 | lu_test.vcproj \ 35 | matfunc_test.vcproj \ 36 | mat_test.vcproj \ 37 | modulator_nd_test.vcproj \ 38 | modulator_test.vcproj \ 39 | newton_search_test.vcproj \ 40 | parser_test.vcproj \ 41 | poly_test.vcproj \ 42 | pulse_shape_test.vcproj \ 43 | qr_test.vcproj \ 44 | rand_test.vcproj \ 45 | rec_syst_conv_code_test.vcproj \ 46 | reedsolomon_test.vcproj \ 47 | schur_test.vcproj \ 48 | sigfun_test.vcproj \ 49 | sort_test.vcproj \ 50 | source_test.vcproj \ 51 | sparse_test.vcproj \ 52 | specmat_test.vcproj \ 53 | stat_test.vcproj \ 54 | svd_test.vcproj \ 55 | timer_test.vcproj \ 56 | transforms_test.vcproj \ 57 | turbo_test.vcproj \ 58 | vec_test.vcproj \ 59 | window_test.vcproj 60 | 61 | -------------------------------------------------------------------------------- /tests/fix_test.ref: -------------------------------------------------------------------------------- 1 | Testing declaration, initialization and conversion 2 | ================================================== 3 | For double and complex: 4 | real_value = 3.1415927 5 | complex_value = 33.333333+66.666667i 6 | For Fix and CFix: 7 | the_fix = 3.140625 8 | the_cfix = 33.333008+66.666016i 9 | For Fixed and CFixed: 10 | the_fixed = 3.140625 11 | the_cfixed = 33.333008+66.666016i 12 | For Fixed and CFixed declared using a typedef: 13 | the_fixed20 = 3.140625 14 | the_cfixed20 = 33.333008+66.666016i 15 | For Fix and CFix declared using a factory: 16 | the_fix20 = 3.140625 17 | the_cfix20 = 33.333008+66.666016i 18 | 19 | Testing Array/Vec/Mat declarations and operations 20 | ================================================= 21 | For Vec and Vec: 22 | the_fixvec = [3.140625 3.140625] 23 | the_cfixvec = [33.333008+66.666016i 33.333008+66.666016i] 24 | the_cfixvec + the_fixvec = [36.473633+66.666016i 36.473633+66.666016i] 25 | the_cfixvec - the_fixvec = [30.192383+66.666016i 30.192383+66.666016i] 26 | the_cfixvec * the_fixvec = 209.37296+418.74591i 27 | the_cfixvec / the_fix = [10+21i 10+21i] 28 | 29 | Testing functions 30 | ================= 31 | Function is_fix: 32 | is_fix(the_array2d_fixvec) = 1 33 | Function set_fix: 34 | original_float = [0 1 2 3 4 5 6 7] => resulting_fix = [0<0> 1<0> 2<0> 3<0> -4<0> -3<0> -2<0> -1<0>] 35 | original_float = [0 1 2 3 4 5 6 7] => resulting_float = [0 1 2 3 4 5 6 7] 36 | Function lshift_fix: 37 | before lshift: 77<0> , rep: 77 38 | after lshift: 154<1> , rep: 154 39 | Function rshift_fix: 40 | before rshift: 803<8> , rep: 803 41 | after rshift: 13<2> , rep: 13 42 | -------------------------------------------------------------------------------- /doc/local/authors.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page authors IT++ People 3 | 4 | \section admins Project Admins 5 | 6 | - Bogdan Cristea (cristeab) 7 | - Tony Ottosson (tonyottosson) 8 | - Adam Piątyszek (ediap) 9 | 10 | 11 | \section developers Developers 12 | 13 | - Mirsad Čirkić (mirsadcirkic) 14 | - Johan Bergman (emwjohb) 15 | - Thomas Eriksson (thomases2) 16 | - Pål Frenger (frenger) 17 | - Fredrik Huss (frehu) 18 | - Erik G. Larsson (erik_g_larsson) 19 | - Stephan Ludwig (donludovico) 20 | - Robert Orzechowski (tytusz) 21 | - Andy Panov (andypanov) 22 | - Conrad Sanderson (conrad_s) 23 | - Andreas Wolfgang (andreas-w) 24 | - Simon Wood (sgwoodjr) 25 | 26 | 27 | \section retired Retired Developers 28 | 29 | - Håkan Eriksson (hakanbe) 30 | - Thomas Lemaire 31 | - Anders Persson 32 | - Tobias Ringstrom 33 | - Jonas Samuelsson 34 | 35 | 36 | \section contributors Contributors 37 | 38 | - Mattias Andersson 39 | - Kumar Appaiah 40 | - Francois Cayre 41 | - Zbigniew Długaszewski 42 | - Mark Dobossy 43 | - Sean Finney 44 | - Teddy Furon 45 | - Bjorn Furugard 46 | - Kenneth Hilmersson 47 | - Peter Klotz 48 | - Krister Norlund 49 | - Steve Peters 50 | - Gorka Prieto 51 | - Martin Senst 52 | - Svante Signell 53 | - Vasek Smidl 54 | - Erik Stoy 55 | - Tobias Tynderfeldt 56 | 57 | 58 | \section distributors Distribution Maintainers 59 | 60 | - Kumar Appaiah - 61 | Debian GNU/Linux 62 | - Günter Dannoritzer (dannori) - 63 | openSUSE 64 | - Markus Dittrich - 65 | Gentoo Linux 66 | - Ed Hill (edhill) - 67 | Fedora 68 | 69 | */ 70 | -------------------------------------------------------------------------------- /itpp/itfixed.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Include file for the IT++ fixed-point module 4 | * \author Tony Ottosson 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #ifndef ITFIXED_H 30 | #define ITFIXED_H 31 | 32 | /*! 33 | * \defgroup fixed Fixed-point Module 34 | * @{ 35 | */ 36 | 37 | /*! 38 | * @} 39 | */ 40 | 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | 51 | #endif // #ifndef ITFIXED_H 52 | -------------------------------------------------------------------------------- /itpp/base/binary.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Binary class implemenations 4 | * \author Tony Ottosson 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | #include 31 | 32 | 33 | namespace itpp 34 | { 35 | 36 | std::ostream &operator<<(std::ostream &output, const bin &inbin) 37 | { 38 | output << static_cast(inbin); 39 | return output; 40 | } 41 | 42 | std::istream &operator>>(std::istream &input, bin &outbin) 43 | { 44 | int tmp; 45 | input >> tmp; 46 | it_assert((tmp == 0) || (tmp == 1), 47 | "bin::operator>>(): input value must be 0 or 1"); 48 | outbin = tmp; 49 | return input; 50 | } 51 | 52 | } // namespace itpp 53 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Run this to generate all the initial makefiles, etc. 3 | 4 | DIE=no 5 | 6 | check_tool() { 7 | ($1 --version) /dev/null 2>&1 || { 8 | echo "*** Error: You must have \"$1\" installed to compile IT++ SVN sources" 9 | DIE=yes 10 | } 11 | } 12 | 13 | check_tool "autoconf" 14 | check_tool "automake" 15 | check_tool "libtoolize" 16 | check_tool "sed" 17 | 18 | test "$DIE" = yes && exit 1 19 | 20 | srcdir=$(dirname $0) 21 | test -z "${srcdir}" && srcdir=. 22 | ORIGDIR=$(pwd) 23 | cd "${srcdir}" || exit $? 24 | 25 | 26 | PV=$(cat VERSION | cut -d' ' -f1) 27 | LV=$(cat VERSION | cut -d' ' -f2) 28 | if test "x$(cat VERSION | cut -d' ' -f3)" = "xsvn"; then 29 | if test -d ".git/svn"; then 30 | REV=$(LC_ALL=C git svn find-rev HEAD) 31 | elif test -d ".svn"; then 32 | REV=$(LC_ALL=C svn info $0 | sed -n 's/^Revision: //p') 33 | fi 34 | if test "x${REV}" != x; then 35 | PV="${PV}.r${REV}" 36 | else 37 | PV="${PV}.d`LC_ALL=C date +%Y%m%d`" 38 | fi 39 | fi 40 | PD=$(LC_ALL=C date +"%B %Y") 41 | 42 | echo "Bootstapping IT++ version ${PV}" 43 | 44 | sed -e "s/@PACKAGE_VERSION@/${PV}/" -e "s/@LIBRARY_VERSION@/${LV}/" \ 45 | < configure.ac.in > configure.ac || exit $? 46 | sed -e "s/@PACKAGE_VERSION@/${PV}/" \ 47 | < itpp.spec.in > itpp.spec || exit $? 48 | sed -e "s/@PACKAGE_VERSION@/${PV}/" -e "s/@PACKAGE_DATE@/${PD}/" \ 49 | < itpp-config.1.in > itpp-config.1 || exit $? 50 | 51 | test ! -d build-aux && (mkdir build-aux || exit $?) 52 | 53 | aclocal -I m4 || exit $? 54 | libtoolize --copy --force --automake || exit $? 55 | aclocal -I m4 || exit $? 56 | autoconf || exit $? 57 | autoheader || exit $? 58 | automake --add-missing --copy || exit $? 59 | 60 | cd "${ORIGDIR}" || exit $? 61 | -------------------------------------------------------------------------------- /gtests/galois_test.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Galois Field algebra classes test program 4 | * \author Tony Ottosson and Adam Piatyszek 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2013 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | #include 31 | #include "gtest/gtest.h" 32 | 33 | using namespace itpp; 34 | using namespace std; 35 | 36 | TEST (Galois, All) 37 | { 38 | GF a(8), b(8), c(8); 39 | 40 | a = 4; 41 | b = 2; 42 | 43 | c = a + b; 44 | 45 | ostringstream ss(ostringstream::out); 46 | string ref[] = {"a=alpha^4, b=alpha^2", "c=alpha^1"}; 47 | 48 | ss << "a=" << a << ", b=" << b; 49 | ASSERT_TRUE(ss.str() == ref[0]); 50 | ss.str(""); 51 | ss << "c=" << c; 52 | ASSERT_TRUE(ss.str() == ref[1]); 53 | } 54 | 55 | -------------------------------------------------------------------------------- /doc/tutorial/src/reedsolomon.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace itpp; 4 | 5 | //These lines are needed for use of cout and endl 6 | using std::cout; 7 | using std::endl; 8 | 9 | int main() 10 | { 11 | 12 | //Scalars and vectors: 13 | int m, t, n, k, q, NumBits, NumCodeWords; 14 | double p; 15 | bvec uncoded_bits, coded_bits, received_bits, decoded_bits; 16 | 17 | //Set parameters: 18 | NumCodeWords = 1000; //Number of Reed-Solomon code-words to simulate 19 | p = 0.01; //BSC Error probability 20 | m = 3; //Reed-Solomon parameter m 21 | t = 2; //Reed-Solomon parameter t 22 | 23 | cout << "Number of Reed-Solomon code-words to simulate: " << NumCodeWords << endl; 24 | cout << "BSC Error probability : " << p << endl; 25 | cout << "RS m: " << m << endl; 26 | cout << "RS t: " << t << endl; 27 | 28 | //Classes: 29 | Reed_Solomon reed_solomon(m, t); 30 | BSC bsc(p); 31 | BERC berc; 32 | 33 | RNG_randomize(); 34 | 35 | //Calculate parameters for the Reed-Solomon Code: 36 | n = round_i(pow(2.0, m) - 1); 37 | k = round_i(pow(2.0, m)) - 1 - 2 * t; 38 | q = round_i(pow(2.0, m)); 39 | 40 | cout << "Simulating an Reed-Solomon code with the following parameters:" << endl; 41 | cout << "n = " << n << endl; 42 | cout << "k = " << k << endl; 43 | cout << "q = " << q << endl; 44 | 45 | NumBits = m * k * NumCodeWords; 46 | uncoded_bits = randb(NumBits); 47 | coded_bits = reed_solomon.encode(uncoded_bits); 48 | received_bits = bsc(coded_bits); 49 | decoded_bits = reed_solomon.decode(received_bits); 50 | 51 | berc.count(uncoded_bits, decoded_bits); 52 | cout << "The bit error probability after decoding is " << berc.get_errorrate() << endl; 53 | 54 | //Exit program: 55 | return 0; 56 | 57 | } 58 | -------------------------------------------------------------------------------- /itpp/base/fastmath.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Definitions of special operations on vectors and matricies optimized 4 | * for speed 5 | * \author Tony Ottosson and Tobias Ringstrom 6 | * 7 | * ------------------------------------------------------------------------- 8 | * 9 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 10 | * 11 | * This file is part of IT++ - a C++ library of mathematical, signal 12 | * processing, speech processing, and communications classes and functions. 13 | * 14 | * IT++ is free software: you can redistribute it and/or modify it under the 15 | * terms of the GNU General Public License as published by the Free Software 16 | * Foundation, either version 3 of the License, or (at your option) any 17 | * later version. 18 | * 19 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 20 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 21 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 22 | * details. 23 | * 24 | * You should have received a copy of the GNU General Public License along 25 | * with IT++. If not, see . 26 | * 27 | * ------------------------------------------------------------------------- 28 | */ 29 | 30 | #ifndef FASTMATH_H 31 | #define FASTMATH_H 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | namespace itpp 38 | { 39 | 40 | /*! 41 | \relatesalso Mat 42 | \brief Calculates m=m-v*v'*m 43 | */ 44 | ITPP_EXPORT void sub_v_vT_m(mat &m, const vec &v); 45 | 46 | /*! 47 | \relatesalso Mat 48 | \brief Calculates m=m-m*v*v' 49 | */ 50 | ITPP_EXPORT void sub_m_v_vT(mat &m, const vec &v); 51 | 52 | } // namespace itpp 53 | 54 | #endif // #ifndef FASTMATH_H 55 | -------------------------------------------------------------------------------- /itpp/base/ittypes.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief IT++ type definitions 4 | * \author Adam Piatyszek 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2008 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #ifndef ITTYPES_H 30 | #define ITTYPES_H 31 | 32 | //! \cond 33 | 34 | // Fixed size integer types for MSVC++ 35 | #if defined(_MSC_VER) 36 | typedef signed char int8_t; 37 | typedef unsigned char uint8_t; 38 | typedef signed short int16_t; 39 | typedef unsigned short uint16_t; 40 | typedef signed int int32_t; 41 | typedef unsigned int uint32_t; 42 | typedef signed __int64 int64_t; 43 | typedef unsigned __int64 uint64_t; 44 | #else 45 | // Assume that inttypes.h header file is available everywhere 46 | # include 47 | #endif // defined(_MSC_VER) 48 | 49 | //! \endcond 50 | 51 | #endif // ITTYPES_H 52 | -------------------------------------------------------------------------------- /tests/det_test.ref: -------------------------------------------------------------------------------- 1 | =================================== 2 | Test of Determinant routines 3 | =================================== 4 | Real matrix 5 | X = [[-0.283885 0.56497 -1.0746 -0.732016 -0.869443] 6 | [1.36446 -0.596145 2.36476 -2.10553 -0.0504762] 7 | [0.906001 -1.19732 2.36508 -0.923457 0.799682] 8 | [1.24942 -1.26756 1.22804 -1.89227 1.02849] 9 | [1.55783 -0.300385 0.234136 -0.664315 -0.900489]] 10 | det(X) = -3.35694 11 | X = [[-0.227649 1.07507 1.12342 0.494639 -0.179719] 12 | [-1.83729 -0.396638 1.46072 0.721932 0.549174] 13 | [0.0511841 0.51065 -0.269572 0.246282 -0.808968] 14 | [1.44132 1.10323 -1.00539 0.672038 -2.29735] 15 | [-1.48058 0.910165 1.87195 -1.00149 -0.453797]] 16 | det(X) = 3.4773 17 | 18 | Complex matrix 19 | X = [[0.1836-1.02371i -0.60769+0.0533137i 0.278311+0.598587i -0.0820166-0.351743i 0.836821-0.477303i] 20 | [0.214321-0.98353i -0.121635-0.848777i -0.190616-0.13041i 0.221056+0.634561i -0.637571-1.24894i] 21 | [0.261137+1.13396i -1.28903+0.562993i 0.0775548-0.185926i 0.0872567-0.29795i 0.339558+0.0234865i] 22 | [-0.225782+1.07734i -0.0690923-0.822132i -0.664453+0.326851i 0.296357+0.901056i -0.181505-0.863075i] 23 | [-0.884797+0.465648i 0.953281-0.128067i 0.600433-0.218791i -0.232511+0.964179i 0.621065-0.359776i]] 24 | det(X) = 3.06712-4.24441i 25 | X = [[0.61333+0.506973i 0.350946-0.839171i -0.431011-0.173918i 0.43428-0.328699i 0.289013+0.366511i] 26 | [-0.295419+0.675185i 0.530681-0.233433i -0.666422-0.180822i -0.497205+0.369685i 0.840226+0.358469i] 27 | [-0.475898+0.120633i -0.376251+0.957435i 0.135151+0.431443i 1.30784+0.644844i -0.553286+0.0173776i] 28 | [-0.85725-0.0647025i 0.959656+0.279574i 0.735259+0.373431i -0.64014-0.467499i 0.166865+0.139432i] 29 | [0.564002+0.646938i -0.165729-2.07819i -0.43385-0.288087i 0.248209-0.110927i -0.304968+1.67774i]] 30 | det(X) = -0.534835-1.62956i 31 | -------------------------------------------------------------------------------- /doc/local/test.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page test Test Rules 3 | 4 | This section describes rules how the functionality of the IT++ 5 | library should be verified. In the \c `tests' subdirectory test files 6 | are provided. All functionality should be tested using these test 7 | files. 8 | 9 | 10 | \section test_file The Test File 11 | 12 | Each new IT++ module/class should be accompanied with a test file. The 13 | test file is an implementation in C++ that tests the functionality of 14 | a function/class or a group of functions/classes called modules. The 15 | test file should test relevant parameter settings and input/output 16 | relations to guarantee correct functionality of the corresponding 17 | classes/functions. The test files should be maintained using version 18 | control and updated whenever new functionality is added to the IT++ 19 | library. 20 | 21 | The test file should use Google C++ Testing Framework (http://code.google.com/p/googletest/) 22 | for unit tests and should be, if possible, self contained, i.e. no external data needed. 23 | Also, if you use random data, please use IT++ random generators with a fixed seed in order to 24 | ensure the same results on different platforms. 25 | 26 | The test file should be placed in the \c `gtests' subdirectory and 27 | should have a name ending with `_test.cpp'. 28 | 29 | \section testing_using_make Testing IT++ Library 30 | 31 | One can compile and execute all test programs from \c `gtests' 32 | subdirectory by typing 33 | \verbatim 34 | % ./itpp_gtests 35 | \endverbatim after 36 | successful compilation of the IT++ library. Note that unit test compilation must 37 | be enabled by specifying for cmake the path to the folder containing Google C++ 38 | Testing Framework sources. From the build folder the command is: 39 | \verbatim 40 | % cmake .. -DGTEST_DIR=/path/to/gtest 41 | \endverbatim 42 | 43 | */ 44 | -------------------------------------------------------------------------------- /itpp/itprotocol.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Include file for the IT++ protocols module 4 | * \author Tony Ottosson 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #ifndef ITPROTOCOL_H 30 | #define ITPROTOCOL_H 31 | 32 | /*! 33 | * \defgroup protocol Protocols Module 34 | * @{ 35 | */ 36 | 37 | /*! 38 | * @} 39 | */ 40 | 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | 52 | #endif // #ifndef ITPROTOCOL_H 53 | -------------------------------------------------------------------------------- /tests/eigen_test.ref: -------------------------------------------------------------------------------- 1 | ================================ 2 | Test of eigenvalue routines 3 | ================================ 4 | Real symmetric matrix 5 | A = [[6.75107 -4.11024 7.57353 -6.9009 0.784665] 6 | [-4.11024 3.8051 -6.47556 4.54544 -2.45177] 7 | [7.57353 -6.47556 13.9033 -8.85583 3.75844] 8 | [-6.9009 4.54544 -8.85583 9.84391 -1.34372] 9 | [0.784665 -2.45177 3.75844 -1.34372 3.26664]] 10 | norm(A*V-V*diag(d)) = 0 11 | 12 | Real non-symmetric matrix 13 | A = [[-0.227649 1.07507 1.12342 0.494639 -0.179719] 14 | [-1.83729 -0.396638 1.46072 0.721932 0.549174] 15 | [0.0511841 0.51065 -0.269572 0.246282 -0.808968] 16 | [1.44132 1.10323 -1.00539 0.672038 -2.29735] 17 | [-1.48058 0.910165 1.87195 -1.00149 -0.453797]] 18 | norm(A*V-V*diag(d)) = 0 19 | 20 | Complex hermitian matrix 21 | A = [[5.66035+0i -0.828828+0.624351i -0.795847+0.598926i 1.01174-1.23943i 0.243402-0.0850845i] 22 | [-0.828828-0.624351i 4.69172+0i 0.169611-1.02905i -1.92101+1.73425i 1.5394-0.718265i] 23 | [-0.795847-0.598926i 0.169611+1.02905i 1.48641+0i -0.549066-0.315334i 0.543691+0.138787i] 24 | [1.01174+1.23943i -1.92101-1.73425i -0.549066+0.315334i 2.5618+0i -2.13434-0.0421936i] 25 | [0.243402+0.0850845i 1.5394+0.718265i 0.543691-0.138787i -2.13434+0.0421936i 4.30329+0i]] 26 | norm(A*V-V*diag(d)) = 0 27 | 28 | Complex non-hermitian matrix 29 | A = [[0.61333+0.506973i 0.350946-0.839171i -0.431011-0.173918i 0.43428-0.328699i 0.289013+0.366511i] 30 | [-0.295419+0.675185i 0.530681-0.233433i -0.666422-0.180822i -0.497205+0.369685i 0.840226+0.358469i] 31 | [-0.475898+0.120633i -0.376251+0.957435i 0.135151+0.431443i 1.30784+0.644844i -0.553286+0.0173776i] 32 | [-0.85725-0.0647025i 0.959656+0.279574i 0.735259+0.373431i -0.64014-0.467499i 0.166865+0.139432i] 33 | [0.564002+0.646938i -0.165729-2.07819i -0.43385-0.288087i 0.248209-0.110927i -0.304968+1.67774i]] 34 | norm(A*V-V*diag(d)) = 0 35 | -------------------------------------------------------------------------------- /itpp/itsrccode.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Include file for the IT++ source coding module 4 | * \author Tony Ottosson 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #ifndef ITSRCCODE_H 30 | #define ITSRCCODE_H 31 | 32 | /*! 33 | * \defgroup srccode Source Coding Module 34 | * @{ 35 | */ 36 | 37 | //! \defgroup audio Audio 38 | //! \defgroup image Image Functions and Classes 39 | //! \defgroup lpc LPC-related Functions 40 | //! \defgroup sourcecoding Source Coding Routines 41 | 42 | /*! 43 | * @} 44 | */ 45 | 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | 54 | #endif // #ifndef ITSRCCODE_H 55 | -------------------------------------------------------------------------------- /tests/commfunc_test.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Commfunc test program 4 | * \author Erik G. Larsson 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | 31 | using namespace std; 32 | using namespace itpp; 33 | 34 | int main() 35 | { 36 | cout << graycode(5) << endl; 37 | 38 | bvec b1 = randb(10); 39 | bvec b2 = randb(10); 40 | cout << hamming_distance(b1, b2) << endl; 41 | 42 | cout << weight(b1) << endl; 43 | 44 | cout << waterfilling("1 2 3", 0.001) << endl; 45 | cout << waterfilling("1 2 3", 0.01) << endl; 46 | cout << waterfilling("1 2 3", 0.1) << endl; 47 | cout << waterfilling("1 2 3", 0.5) << endl; 48 | cout << waterfilling("1 2 3", 1) << endl; 49 | cout << waterfilling("1 2 3", 5) << endl; 50 | cout << waterfilling("1 2 3", 100) << endl; 51 | return 0; 52 | } 53 | -------------------------------------------------------------------------------- /gtests/svd_test.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief SVD decomposition test program 4 | * \author Tony Ottosson and Adam Piatyszek 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2013 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | #include "gtest/gtest.h" 31 | 32 | using namespace itpp; 33 | 34 | TEST(SVD, All) 35 | { 36 | RNG_reset(0); 37 | static const double tol = 1e-4; 38 | // Test of svd routines 39 | 40 | { 41 | // Real matrix 42 | mat A = randn(5, 5); 43 | mat U, V; 44 | vec S; 45 | svd(A, U, S, V); 46 | ASSERT_NEAR(2.38835e-15, norm(A - U * diag(S) * transpose(V)), tol); 47 | 48 | } 49 | { 50 | // Complex matrix 51 | cmat A = randn_c(5, 5); 52 | cmat U, V; 53 | vec S; 54 | svd(A, U, S, V); 55 | ASSERT_NEAR(6.20568e-15, norm(A - U * diag(S) * hermitian_transpose(V)), tol); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | =============================================================================== 2 | IT++ version 4.3.0 Released: 2013-05-25 3 | ------------------------------------------------------------------------------- 4 | 5 | IT++ 4.3.0 is the next release based on the IT++ stable master branch from git repository. 6 | A list of new features and modifications is presented below: 7 | 8 | 9 | New features: 10 | ------------- 11 | 12 | * The compilation system is replaced with cmake. Thus compilation and installation 13 | on supported OSs (Linux, Windows, MacOS) is handled in an unified way. 14 | 15 | * IT++ library can be compiled as shared library on Windows. This removes an 16 | important limitation of previous releases. 17 | 18 | * Added unit testing support based on Google C++ Testing Framework 19 | 20 | * Added multilateration class for indoor localization 21 | 22 | * Added numerical integration with function objects as integrands 23 | 24 | * Added thread-safe Fourier and cosine transforms 25 | 26 | * Added thread-safe generation of random numbers 27 | 28 | * Added faster LLR demodulator 29 | 30 | * Added non-narrow-sense Reed-Solomon and Erasure Decoding 31 | 32 | * Added lte_turbo_interleaver_sequence 33 | 34 | * Added pyitpp module providing itload() function for Python, similar to MATLAB 35 | itload.m 36 | 37 | * Added punctured turbo codec (PTC) class 38 | 39 | 40 | Modifications: 41 | -------------- 42 | 43 | * fixed errors in Read Solomon and BCH decoders 44 | * fixed FastICA accesses unallocated memory/ bails out if whitenig 45 | * fixed help for OFDM class 46 | * extras/astylerc is now compatible with astyle 2.02.1 47 | * fixed systematic Reed-Solomon decoding 48 | * fixed convolutional Decoder for certain generators 49 | * added operator +- between scalar and complex 50 | * fixed bug in FastICA with APPROACH_DEFL 51 | * added new linspace function 52 | -------------------------------------------------------------------------------- /itpp/base/math/misc.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Miscellaneous functions - source file 4 | * \author Tony Ottosson and Adam Piatyszek 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | 31 | #ifndef _MSC_VER 32 | # include 33 | #else 34 | # include 35 | #endif 36 | 37 | 38 | namespace itpp 39 | { 40 | 41 | std::string itpp_version(void) 42 | { 43 | #ifdef PACKAGE_VERSION 44 | return std::string(PACKAGE_VERSION); 45 | #else 46 | return std::string("Warning: Version unknown!"); 47 | #endif 48 | } 49 | 50 | bool is_bigendian() 51 | { 52 | int i = 1; 53 | char *p = reinterpret_cast(&i); 54 | if (p[0] == 1) // Lowest address contains the least significant byte 55 | return false; // LITTLE_ENDIAN 56 | else 57 | return true; // BIG_ENDIAN 58 | } 59 | 60 | } //namespace itpp 61 | -------------------------------------------------------------------------------- /gtests/timer_test.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Timer classes test program 4 | * \author Thomas Eriksson, Tony Ottosson, Tobias Ringstrom and Adam Piatyszek 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2013 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | #include "gtest/gtest.h" 31 | 32 | using namespace std; 33 | using namespace itpp; 34 | 35 | TEST(Timer, All) 36 | { 37 | const double period = 2.0; 38 | const double relative_error = 0.05; 39 | CPU_Timer t1; 40 | Real_Timer t2; 41 | 42 | t1.start(); 43 | while (t1.get_time() < period) ; 44 | t1.stop(); 45 | 46 | tic(); 47 | t2.start(); 48 | while (t2.get_time() < period) ; 49 | t2.stop(); 50 | double t3 = toc(); 51 | 52 | ASSERT_TRUE(fabs(t1.get_time() - period) <= relative_error * period); 53 | 54 | ASSERT_TRUE(fabs(t2.get_time() - period) <= relative_error * period); 55 | 56 | ASSERT_TRUE(t3 >= t2.get_time()); 57 | } 58 | -------------------------------------------------------------------------------- /gtests/lu_test.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief LU factorization routines test program 4 | * \author Tony Ottosson and Adam Piatyszek 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2013 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | #include "gtest/gtest.h" 31 | 32 | using namespace itpp; 33 | 34 | TEST(LU, All) 35 | { 36 | // Test of LU factorization routines 37 | RNG_reset(0); 38 | static const double tol = 1e-10; 39 | 40 | { 41 | // Real matrix 42 | mat X = randn(5, 5); 43 | mat L, U; 44 | ivec p; 45 | lu(X, L, U, p); 46 | 47 | mat P = to_mat(permutation_matrix(p)); 48 | ASSERT_NEAR(0, norm(X - transpose(P) * L * U), tol); 49 | } 50 | { 51 | // Complex matrix 52 | cmat X = randn_c(5, 5); 53 | cmat L, U; 54 | ivec p; 55 | lu(X, L, U, p); 56 | 57 | mat P = to_mat(permutation_matrix(p)); 58 | ASSERT_NEAR(0, norm(X - hermitian_transpose(P) * L * U), tol); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /itpp/base/math/log_exp.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Logarithmic and exponenential functions - source file 4 | * \author Tony Ottosson, Adam Piatyszek and Conrad Sanderson 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2008 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | #include 31 | 32 | namespace itpp 33 | { 34 | 35 | // log-2 of the elements 36 | vec log2(const vec &x) { return apply_function(::log2, x); } 37 | mat log2(const mat &x) { return apply_function(::log2, x); } 38 | 39 | // Safe substitute for log(exp(log_a) + exp(log_b)) 40 | double log_add(double log_a, double log_b) 41 | { 42 | if (log_a < log_b) { 43 | double tmp = log_a; 44 | log_a = log_b; 45 | log_b = tmp; 46 | } 47 | double negdelta = log_b - log_a; 48 | if ((negdelta < log_double_min) || std::isnan(negdelta)) 49 | return log_a; 50 | else 51 | return (log_a + log1p(std::exp(negdelta))); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /tests/linspace_test.ref: -------------------------------------------------------------------------------- 1 | ================================ 2 | Test of linspace() function 3 | ================================ 4 | Generating a vector of 1 points, from 0 to 2 5 | Vector length is 1 6 | Vector element is 2 7 | Generating a vector of 30 points, from 0 to 10 8 | Vector length is 30 9 | Vector elements are: [0 0.344828 0.689655 1.03448 1.37931 1.72414 2.06897 2.41379 2.75862 3.10345 3.44828 3.7931 4.13793 4.48276 4.82759 5.17241 5.51724 5.86207 6.2069 6.55172 6.89655 7.24138 7.58621 7.93103 8.27586 8.62069 8.96552 9.31034 9.65517 10] 10 | ========================================== 11 | Test of linspace_fixed_step() function 12 | ========================================== 13 | Generating a vector with a step of 1, from 0 to 10 14 | Vector length is: 11 15 | Vector elements are: [0 1 2 3 4 5 6 7 8 9 10] 16 | Generating a vector with a step of 1.1, from 0 to 10 17 | Vector length is: 10 18 | Vector elements are: [0 1.1 2.2 3.3 4.4 5.5 6.6 7.7 8.8 9.9] 19 | Generating a vector with a step of 2, from 0 to 1 20 | Vector length is: 1 21 | Vector element is: [0] 22 | Generating a vector with a step of -2, from 0 to -1 23 | Vector length is: 1 24 | Vector element is: [0] 25 | Generating a vector with a step of 2, from 0 to -1 26 | Vector length is: 0 27 | Vector element is: [] 28 | Generating a vector with a step of 2, from -1 to 0 29 | Vector length is: 1 30 | Vector element is: [-1] 31 | Generating a vector with a step of -2, from -1 to 0 32 | Vector length is: 0 33 | Vector element is: [] 34 | Generating a vector with a step of 2, from -5 to 5 35 | Vector length is: 6 36 | Vector element is: [-5 -3 -1 1 3 5] 37 | Generating a vector with a step of -2, from 5 to -5 38 | Vector length is: 6 39 | Vector element is: [5 3 1 -1 -3 -5] 40 | Generating an integer vector with a step of 1, from 0 to 10 41 | Vector length is: 11 42 | Vector element is: [0 1 2 3 4 5 6 7 8 9 10] 43 | Generating a short integer vector with a step of 1, from 0 to 10 44 | Vector length is: 11 45 | Vector element is: [0 1 2 3 4 5 6 7 8 9 10] 46 | -------------------------------------------------------------------------------- /tests/specmat_test.ref: -------------------------------------------------------------------------------- 1 | ================================= 2 | Test of specmat routines 3 | ================================= 4 | b1 = [0 0 1 1 0 1 0] 5 | b2 = [1 0 0 1 1 0 0 1 1 0 0 0 0] 6 | toeplitz(b1, b2) = 7 | [[0 0 0 1 1 0 0 1 1 0 0 0 0] 8 | [0 0 0 0 1 1 0 0 1 1 0 0 0] 9 | [1 0 0 0 0 1 1 0 0 1 1 0 0] 10 | [1 1 0 0 0 0 1 1 0 0 1 1 0] 11 | [0 1 1 0 0 0 0 1 1 0 0 1 1] 12 | [1 0 1 1 0 0 0 0 1 1 0 0 1] 13 | [0 1 0 1 1 0 0 0 0 1 1 0 0]] 14 | toeplitz(b1) = 15 | [[0 0 1 1 0 1 0] 16 | [0 0 0 1 1 0 1] 17 | [1 0 0 0 1 1 0] 18 | [1 1 0 0 0 1 1] 19 | [0 1 1 0 0 0 1] 20 | [1 0 1 1 0 0 0] 21 | [0 1 0 1 1 0 0]] 22 | 23 | v1 = [-0.869 -0.050 0.800 1.028 -0.900] 24 | v2 = [-0.228 -1.837 0.051 1.441 -1.481 1.075 -0.397] 25 | toeplitz(v1, v2) = 26 | [[-0.869 -1.837 0.051 1.441 -1.481 1.075 -0.397] 27 | [-0.050 -0.869 -1.837 0.051 1.441 -1.481 1.075] 28 | [0.800 -0.050 -0.869 -1.837 0.051 1.441 -1.481] 29 | [1.028 0.800 -0.050 -0.869 -1.837 0.051 1.441] 30 | [-0.900 1.028 0.800 -0.050 -0.869 -1.837 0.051]] 31 | toeplitz(v1) = 32 | [[-0.869 -0.050 0.800 1.028 -0.900] 33 | [-0.050 -0.869 -0.050 0.800 1.028] 34 | [0.800 -0.050 -0.869 -0.050 0.800] 35 | [1.028 0.800 -0.050 -0.869 -0.050] 36 | [-0.900 1.028 0.800 -0.050 -0.869]] 37 | 38 | c1 = [0.361+0.780i 0.644+0.794i 1.033-0.191i -0.711+1.324i] 39 | c2 = [0.350+0.510i 0.174+0.475i -0.708-0.127i] 40 | toeplitz(c1, c2) = 41 | [[0.361+0.780i 0.174+0.475i -0.708-0.127i] 42 | [0.644+0.794i 0.361+0.780i 0.174+0.475i] 43 | [1.033-0.191i 0.644+0.794i 0.361+0.780i] 44 | [-0.711+1.324i 1.033-0.191i 0.644+0.794i]] 45 | toeplitz(c1, c1) = 46 | [[0.361+0.780i 0.644+0.794i 1.033-0.191i -0.711+1.324i] 47 | [0.644+0.794i 0.361+0.780i 0.644+0.794i 1.033-0.191i] 48 | [1.033-0.191i 0.644+0.794i 0.361+0.780i 0.644+0.794i] 49 | [-0.711+1.324i 1.033-0.191i 0.644+0.794i 0.361+0.780i]] 50 | toeplitz(c1) = 51 | [[0.361+0.780i 0.644+0.794i 1.033-0.191i -0.711+1.324i] 52 | [0.644-0.794i 0.361+0.780i 0.644+0.794i 1.033-0.191i] 53 | [1.033+0.191i 0.644-0.794i 0.361+0.780i 0.644+0.794i] 54 | [-0.711-1.324i 1.033+0.191i 0.644-0.794i 0.361+0.780i]] 55 | 56 | -------------------------------------------------------------------------------- /itpp/base/math/trig_hyp.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Trigonometric and hyperbolic functions - source file 4 | * \author Tony Ottosson and Adam Piatyszek 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2008 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | #include 31 | 32 | namespace itpp 33 | { 34 | 35 | //! Inverse sine hyperbolic function 36 | vec asinh(const vec &x) { return apply_function(::asinh, x); } 37 | //! Inverse sine hyperbolic function 38 | mat asinh(const mat &x) { return apply_function(::asinh, x); } 39 | //! Inverse cosine hyperbolic function 40 | vec acosh(const vec &x) { return apply_function(::acosh, x); } 41 | //! Inverse cosine hyperbolic function 42 | mat acosh(const mat &x) { return apply_function(::acosh, x); } 43 | //! Inverse tan hyperbolic function 44 | vec atanh(const vec &x) { return apply_function(::atanh, x); } 45 | //! Inverse tan hyperbolic function 46 | mat atanh(const mat &x) { return apply_function(::atanh, x); } 47 | 48 | } // namespace itpp 49 | -------------------------------------------------------------------------------- /itpp/itexports.h.cmake: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Include file for exporting/importing IT++ library symbols 4 | * \author Bogdan Cristea 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2013 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #ifndef ITEXPORTS_H 30 | #define ITEXPORTS_H 31 | 32 | /*defined from cmake when using the shared version of IT++ library*/ 33 | #cmakedefine ITPP_SHARED_LIB 34 | 35 | /*needed to export shared library symbols on Windows*/ 36 | #if defined(ITPP_SHARED_LIB) && defined(_MSC_VER) 37 | #ifndef ITPP_EXPORT 38 | #if defined(itpp_EXPORTS) || defined(itpp_debug_EXPORTS) /*automatically defined by cmake*/ 39 | #define ITPP_EXPORT __declspec(dllexport) 40 | #else 41 | #define ITPP_EXPORT __declspec(dllimport) 42 | #endif 43 | #endif 44 | #endif 45 | 46 | #if (__GNUC__ >= 4) /*UNIX*/ 47 | #ifndef ITPP_EXPORT_TEMPLATE 48 | #define ITPP_EXPORT_TEMPLATE extern 49 | #endif 50 | #endif 51 | 52 | #ifndef ITPP_EXPORT 53 | #define ITPP_EXPORT 54 | #endif 55 | #ifndef ITPP_EXPORT_TEMPLATE 56 | #define ITPP_EXPORT_TEMPLATE 57 | #endif 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /tests/freq_filt_test.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Frequency filter test program 4 | * \author Simon Wood and Adam Piatyszek 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | 31 | using namespace itpp; 32 | using namespace std; 33 | 34 | 35 | int main() 36 | { 37 | vec b = "1 2 3 4"; 38 | vec x(20); 39 | x.zeros(); 40 | x(0) = 1; 41 | 42 | // Define a filter object for doubles 43 | Freq_Filt FF(b, x.length()); 44 | 45 | // Filter the data 46 | vec y = FF.filter(x); 47 | 48 | // Check the FFT and block sizes that were used 49 | int fftsize = FF.get_fft_size(); 50 | int blksize = FF.get_blk_size(); 51 | 52 | cout << fftsize << endl; 53 | cout << blksize << endl; 54 | 55 | cout << round_to_zero(y) << endl; 56 | 57 | // Test streaming mode 58 | x = linspace(0, 10, 100); 59 | Freq_Filt FFS(b, x.length()); 60 | vec y1 = FFS.filter(x(0, 49), 1); 61 | vec y2 = FFS.filter(x(50, 99), 1); 62 | 63 | cout << round_to_zero(concat(y1, y2)) << endl; 64 | 65 | return 0; 66 | } 67 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Introduction 2 | ************ 3 | 4 | IT++ is a C++ library of mathematical, signal processing and communication 5 | classes and functions. Its main use is in simulation of communication systems 6 | and for performing research in the area of communications. The kernel of the 7 | library consists of generic vector and matrix classes, and a set of 8 | accompanying routines. Such a kernel makes IT++ similar to MATLAB or GNU 9 | Octave. 10 | 11 | The IT++ library originates from the former department of Information Theory 12 | at the Chalmers University of Technology, Gothenburg, Sweden. Because the 13 | library is coded in C++, the name IT++ seemed like a good idea at the time. 14 | While departments come and go, IT++ have developed a life of it's own and is 15 | now released under the terms of the GNU General Public License (GPL) for you 16 | to enjoy. 17 | 18 | IT++ is being developed and widely used by researchers who work in the area 19 | of communications, both in the industry and at universities. In 2005, 2006 20 | and 2007, IT++ was developed as a part of the European Network of Excellence 21 | in Wireless Communications (NEWCOM). 22 | 23 | IT++ makes extensive use of existing open-source or commercial libraries 24 | for increased functionality, speed and accuracy. In particular BLAS, LAPACK 25 | and FFTW libraries can be used. Instead of the reference BLAS and LAPACK 26 | implementations, some optimized platform-specific libraries can be used as 27 | well, i.e.: 28 | 29 | o ATLAS (Automatically Tuned Linear Algebra Software) - includes optimised 30 | BLAS and a limited set of LAPACK routines 31 | o MKL (Intel Math Kernel Library) - includes all required BLAS, LAPACK and 32 | FFT routines (FFTW not required) 33 | o ACML (AMD Core Math Library) - includes BLAS, LAPACK and FFT routines 34 | (FFTW not required) 35 | 36 | It is possible to compile and use IT++ without any of the above listed 37 | libraries, but the functionality will be reduced. 38 | 39 | IT++ should work on GNU/Linux, Sun Solaris, Microsoft Windows (with Cygwin, 40 | MinGW/MSYS or Microsoft Visual C++) and Mac OS X operating systems. 41 | 42 | -------------------------------------------------------------------------------- /itpp/comm/pulse_shape.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Pulse shaping classes - source file 4 | * \author Tony Ottosson, Hakan Eriksson and Adam Piatyszek 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | 31 | 32 | namespace itpp 33 | { 34 | 35 | // ---------------------------------------------------------------------- 36 | // Instantiations 37 | // ---------------------------------------------------------------------- 38 | 39 | template class ITPP_EXPORT Pulse_Shape; 40 | template class ITPP_EXPORT Pulse_Shape < std::complex, double, 41 | std::complex >; 42 | template class ITPP_EXPORT Pulse_Shape < std::complex, std::complex, 43 | std::complex >; 44 | 45 | template class ITPP_EXPORT Root_Raised_Cosine; 46 | template class ITPP_EXPORT Root_Raised_Cosine >; 47 | 48 | template class ITPP_EXPORT Raised_Cosine; 49 | template class ITPP_EXPORT Raised_Cosine >; 50 | 51 | //! \endcond 52 | 53 | } // namespace itpp 54 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # \file CMakeLists.txt 3 | # \brief cmake configuration file for old unit tests 4 | # \author Bogdan Cristea 5 | # 6 | # ------------------------------------------------------------------------- 7 | # 8 | # Copyright (C) 1995-2012 (see AUTHORS file for a list of contributors) 9 | # 10 | # This file is part of IT++ - a C++ library of mathematical, signal 11 | # processing, speech processing, and communications classes and functions. 12 | # 13 | # IT++ is free software: you can redistribute it and/or modify it under the 14 | # terms of the GNU General Public License as published by the Free Software 15 | # Foundation, either version 3 of the License, or (at your option) any 16 | # later version. 17 | # 18 | # IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | # details. 22 | # 23 | # You should have received a copy of the GNU General Public License along 24 | # with IT++. If not, see . 25 | # 26 | # ------------------------------------------------------------------------- 27 | 28 | file ( GLOB ITPP_TEST_SRCS *.cpp ) 29 | 30 | include_directories ( ${PROJECT_SOURCE_DIR} ${CMAKE_BINARY_DIR} ) 31 | 32 | foreach (FILE ${ITPP_TEST_SRCS}) 33 | get_filename_component ( target ${FILE} NAME_WE ) 34 | add_executable ( ${target} ${FILE} ) 35 | if (target MATCHES "^fastica") 36 | set_target_properties(${target} PROPERTIES COMPILE_FLAGS -DFASTICA_TEST_FILE=\\""${CMAKE_CURRENT_SOURCE_DIR}"/fastica_test_data.txt\\") 37 | endif() 38 | if (target MATCHES "^parser") 39 | set_target_properties(${target} PROPERTIES COMPILE_FLAGS -DPARSER_TEST_FILE=\\""${CMAKE_CURRENT_SOURCE_DIR}"/parser_test_data.txt\\") 40 | endif() 41 | if (target MATCHES "^itfile") 42 | set_target_properties(${target} PROPERTIES COMPILE_FLAGS -DITFILE_TEST_FILE=\\""${CMAKE_CURRENT_SOURCE_DIR}"/itfile_test_data.it\\") 43 | endif() 44 | target_link_libraries ( ${target} ${ITPP_LIBS} ${libitpp_target} ) 45 | endforeach (FILE) 46 | -------------------------------------------------------------------------------- /gtests/parser_test_data.txt: -------------------------------------------------------------------------------- 1 | %--------------------------------------------------------------------- 2 | % Test data file for the parser_test.cpp program 3 | %--------------------------------------------------------------------- 4 | 5 | % Lines that begins with % are ignored. Expressions that ends with ';' 6 | % are not printed while parsing. 7 | 8 | a = 4; %Comments may be put at the end of each line 9 | 10 | % You can give several values for the same parameter name. Each 11 | % alternative value must be on a new row. Select the value you 12 | % want with the num parameter in the get_double member function. 13 | % Use: 14 | % Parser p("filename.txt"); 15 | % double b = p.get_double("b",1); 16 | % to select the value 2.36 below. 17 | b = 2.35 18 | 2.36 19 | 2.37 20 | % Several expressions may be put on the same row (separated by , or ;) 21 | % c is a string, d is an integer vector. Spaces and/or commas separate 22 | % the vector elements. 23 | c = "Hello World"; d =[1,2,3 4,3 2, -1]; 24 | 25 | % This a vector. 26 | e=[1.2,2,3.33 4.01,3.2 2, -1.2]; 27 | 28 | % This is a short vector. 29 | f=[1,2,3 4,3 2, -1]; 30 | 31 | % This is a binary vector. 32 | g=[0 1 0 0 1]; 33 | 34 | % This an integer matrix. Spaces and/or commas separate the colums. Semicolons separate rows. 35 | h=[1 2 3;4 5 6]; 36 | 37 | % Expressions can continue over several rows by inserting '...' at the end of the rows 38 | % (as in Matlab). This is a matrix. 39 | i=[... 40 | 1.0, 2 ; ... 41 | -3 4.2 ... 42 | ] ; 43 | 44 | % This is a short matrix. 45 | j=[1 -2 -3;4 -5 6]; 46 | 47 | % This is a binary matrix. 48 | k=[0 1 0 1;1 0 1 0;0 0 0 0;1 1 1 1]; 49 | 50 | % These are boolean variables: 51 | l= 0; 52 | m= true; 53 | 54 | % This is a string with single instead of double quotes (For Matlab compatibility) 55 | n='Hello World'; 56 | 57 | % This is an Array > 58 | % In Matlab, the elements defined below are accessible as 59 | % o{1}{1}, o{1}{2} and o{2}{1}; note the curly brackets. 60 | % For complex numbers, both 1+2i and (1,2) are allowed formats, 61 | % but only the first one is Matlab compatible. 62 | o = {{[1+2i 3+4i] [5+6i]} {[7 8 9]}} 63 | -------------------------------------------------------------------------------- /tests/parser_test_data.txt: -------------------------------------------------------------------------------- 1 | %--------------------------------------------------------------------- 2 | % Test data file for the parser_test.cpp program 3 | %--------------------------------------------------------------------- 4 | 5 | % Lines that begins with % are ignored. Expressions that ends with ';' 6 | % are not printed while parsing. 7 | 8 | a = 4; %Comments may be put at the end of each line 9 | 10 | % You can give several values for the same parameter name. Each 11 | % alternative value must be on a new row. Select the value you 12 | % want with the num parameter in the get_double member function. 13 | % Use: 14 | % Parser p("filename.txt"); 15 | % double b = p.get_double("b",1); 16 | % to select the value 2.36 below. 17 | b = 2.35 18 | 2.36 19 | 2.37 20 | % Several expressions may be put on the same row (separated by , or ;) 21 | % c is a string, d is an integer vector. Spaces and/or commas separate 22 | % the vector elements. 23 | c = "Hello World"; d =[1,2,3 4,3 2, -1]; 24 | 25 | % This a vector. 26 | e=[1.2,2,3.33 4.01,3.2 2, -1.2]; 27 | 28 | % This is a short vector. 29 | f=[1,2,3 4,3 2, -1]; 30 | 31 | % This is a binary vector. 32 | g=[0 1 0 0 1]; 33 | 34 | % This an integer matrix. Spaces and/or commas separate the colums. Semicolons separate rows. 35 | h=[1 2 3;4 5 6]; 36 | 37 | % Expressions can continue over several rows by inserting '...' at the end of the rows 38 | % (as in Matlab). This is a matrix. 39 | i=[... 40 | 1.0, 2 ; ... 41 | -3 4.2 ... 42 | ] ; 43 | 44 | % This is a short matrix. 45 | j=[1 -2 -3;4 -5 6]; 46 | 47 | % This is a binary matrix. 48 | k=[0 1 0 1;1 0 1 0;0 0 0 0;1 1 1 1]; 49 | 50 | % These are boolean variables: 51 | l= 0; 52 | m= true; 53 | 54 | % This is a string with single instead of double quotes (For Matlab compatibility) 55 | n='Hello World'; 56 | 57 | % This is an Array > 58 | % In Matlab, the elements defined below are accessible as 59 | % o{1}{1}, o{1}{2} and o{2}{1}; note the curly brackets. 60 | % For complex numbers, both 1+2i and (1,2) are allowed formats, 61 | % but only the first one is Matlab compatible. 62 | o = {{[1+2i 3+4i] [5+6i]} {[7 8 9]}} 63 | -------------------------------------------------------------------------------- /itpp/base/bessel/bessel_internal.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Bessel help functions header. For internal use only. 4 | * \author Tony Ottosson 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #ifndef BESSEL_INTERNAL_H 30 | #define BESSEL_INTERNAL_H 31 | 32 | //! \cond 33 | 34 | #include 35 | 36 | double chbevl(double x, double array[], int n); 37 | double hyperg(double a, double b, double x); 38 | int airy(double x, double *ai, double *aip, double *bi, double *bip); 39 | double polevl(double x, double coef[], int N); 40 | double p1evl(double x, double coef[], int N); 41 | 42 | double i0(double x); 43 | double i0e(double x); 44 | double i1(double x); 45 | double i1e(double x); 46 | 47 | double k0(double x); 48 | double k0e(double x); 49 | double k1(double x); 50 | double k1e(double x); 51 | 52 | double iv(double nu, double x); 53 | double jv(double nu, double x); 54 | double yv(double nu, double x); 55 | double kn(int n, double x); 56 | 57 | double gam(double x); 58 | double lgam(double x); 59 | extern int sgngam; 60 | 61 | //! \endcond 62 | 63 | #endif // #ifndef BESSEL_INTERNAL_H 64 | -------------------------------------------------------------------------------- /itpp/base/sources.mk: -------------------------------------------------------------------------------- 1 | noinst_h_base_sources = \ 2 | $(top_srcdir)/itpp/base/blas.h \ 3 | $(top_srcdir)/itpp/base/itcompat.h 4 | 5 | h_base_sources = \ 6 | $(top_srcdir)/itpp/base/array.h \ 7 | $(top_srcdir)/itpp/base/bessel.h \ 8 | $(top_srcdir)/itpp/base/binary.h \ 9 | $(top_srcdir)/itpp/base/binfile.h \ 10 | $(top_srcdir)/itpp/base/circular_buffer.h \ 11 | $(top_srcdir)/itpp/base/converters.h \ 12 | $(top_srcdir)/itpp/base/copy_vector.h \ 13 | $(top_srcdir)/itpp/base/factory.h \ 14 | $(top_srcdir)/itpp/base/fastmath.h \ 15 | $(top_srcdir)/itpp/base/gf2mat.h \ 16 | $(top_srcdir)/itpp/base/help_functions.h \ 17 | $(top_srcdir)/itpp/base/itassert.h \ 18 | $(top_srcdir)/itpp/base/itfile.h \ 19 | $(top_srcdir)/itpp/base/ittypes.h \ 20 | $(top_srcdir)/itpp/base/matfunc.h \ 21 | $(top_srcdir)/itpp/base/mat.h \ 22 | $(top_srcdir)/itpp/base/operators.h \ 23 | $(top_srcdir)/itpp/base/parser.h \ 24 | $(top_srcdir)/itpp/base/random.h \ 25 | $(top_srcdir)/itpp/base/random_dsfmt.h \ 26 | $(top_srcdir)/itpp/base/smat.h \ 27 | $(top_srcdir)/itpp/base/sort.h \ 28 | $(top_srcdir)/itpp/base/specmat.h \ 29 | $(top_srcdir)/itpp/base/stack.h \ 30 | $(top_srcdir)/itpp/base/svec.h \ 31 | $(top_srcdir)/itpp/base/timing.h \ 32 | $(top_srcdir)/itpp/base/vec.h 33 | 34 | cpp_base_sources = \ 35 | $(top_srcdir)/itpp/base/bessel.cpp \ 36 | $(top_srcdir)/itpp/base/binary.cpp \ 37 | $(top_srcdir)/itpp/base/binfile.cpp \ 38 | $(top_srcdir)/itpp/base/converters.cpp \ 39 | $(top_srcdir)/itpp/base/copy_vector.cpp \ 40 | $(top_srcdir)/itpp/base/fastmath.cpp \ 41 | $(top_srcdir)/itpp/base/gf2mat.cpp \ 42 | $(top_srcdir)/itpp/base/help_functions.cpp \ 43 | $(top_srcdir)/itpp/base/itassert.cpp \ 44 | $(top_srcdir)/itpp/base/itcompat.cpp \ 45 | $(top_srcdir)/itpp/base/itfile.cpp \ 46 | $(top_srcdir)/itpp/base/mat.cpp \ 47 | $(top_srcdir)/itpp/base/matfunc.cpp \ 48 | $(top_srcdir)/itpp/base/operators.cpp \ 49 | $(top_srcdir)/itpp/base/parser.cpp \ 50 | $(top_srcdir)/itpp/base/random.cpp \ 51 | $(top_srcdir)/itpp/base/smat.cpp \ 52 | $(top_srcdir)/itpp/base/specmat.cpp \ 53 | $(top_srcdir)/itpp/base/svec.cpp \ 54 | $(top_srcdir)/itpp/base/timing.cpp \ 55 | $(top_srcdir)/itpp/base/vec.cpp 56 | 57 | -------------------------------------------------------------------------------- /tests/circular_buffer_test.ref: -------------------------------------------------------------------------------- 1 | peek(out_vec,2) = [0.347621 2.24348]: display 2 first elements of the buffer, without affecting the content 2 | peek_reverse(out_vec,-1) = [-0.813962 2.24348 0.347621]: display buffer, without affecting the content 3 | peek_reverse(out_array,-1) = {-0.813962 2.24348 0.347621}: display buffer, without affecting the content 4 | get(out_vec,1) = [2.24348] 5 | get(out_vec) = [-0.813962 0.402693 -0.0180747 0.456185 -2.65107 0.48475 0.9001 0.489366 0.305648] 6 | get(out_vec) = []; get(out_array,0) = {}: empty buffer, no content 7 | buffer size = 10 8 | nrof_elements = 10 9 | i = 0: peek() = 2.24348; peek_reverse() = 0.305648; get() = 2.24348 10 | i = 1: peek() = -0.813962; peek_reverse() = 0.305648; get() = -0.813962 11 | i = 2: peek() = 0.402693; peek_reverse() = 0.305648; get() = 0.402693 12 | i = 3: peek() = -0.0180747; peek_reverse() = 0.305648; get() = -0.0180747 13 | i = 4: peek() = 0.456185; peek_reverse() = 0.305648; get() = 0.456185 14 | i = 5: peek() = -2.65107; peek_reverse() = 0.305648; get() = -2.65107 15 | i = 6: peek() = 0.48475; peek_reverse() = 0.305648; get() = 0.48475 16 | i = 7: peek() = 0.9001; peek_reverse() = 0.305648; get() = 0.9001 17 | i = 8: peek() = 0.489366; peek_reverse() = 0.305648; get() = 0.489366 18 | i = 9: peek() = 0.305648; peek_reverse() = 0.305648; get() = 0.305648 19 | buffer size = 10 20 | nrof_elements = 8 21 | peek(out_vec) = [0.402693 -0.0180747 0.456185 -2.65107 0.48475 0.9001 0.489366 0.305648] 22 | peek at index 5: peek(5) = 0.9001 23 | peek at index 3: peek(3) = -2.65107 24 | peek at index 7: peek(7) = 0.305648 25 | peek at index 1: peek(1) = -0.0180747 26 | peek at indices [5 3 7 1]: 27 | peek(index_vec,out_vec) = [0.9001 -2.65107 0.305648 -0.0180747] 28 | buffer size = 15 29 | nrof_elements = 8 30 | peek(out_vec) = [0.402693 -0.0180747 0.456185 -2.65107 0.48475 0.9001 0.489366 0.305648] 31 | buffer size = 5 32 | nrof_elements = 5 33 | peek(out_vec) = [-2.65107 0.48475 0.9001 0.489366 0.305648] 34 | Copy constructor: 35 | Circular_Buffer cb2(cb1): cb2.peek(out_vec) = [-2.65107 0.48475 0.9001 0.489366 0.305648] 36 | Copy operator: 37 | Circular_Buffer cb3=cb1: cb3.peek(out_array) = {-2.65107 0.48475 0.9001 0.489366 0.305648} 38 | -------------------------------------------------------------------------------- /itpp/base/base_exports.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Import/Export definitions for some templates defined in base folder. 4 | * 5 | * \author Andy Panov 6 | * 7 | * ------------------------------------------------------------------------- 8 | * 9 | * Copyright (C) 1995-2013 (see AUTHORS file for a list of contributors) 10 | * 11 | * This file is part of IT++ - a C++ library of mathematical, signal 12 | * processing, speech processing, and communications classes and functions. 13 | * 14 | * IT++ is free software: you can redistribute it and/or modify it under the 15 | * terms of the GNU General Public License as published by the Free Software 16 | * Foundation, either version 3 of the License, or (at your option) any 17 | * later version. 18 | * 19 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 20 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 21 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 22 | * details. 23 | * 24 | * You should have received a copy of the GNU General Public License along 25 | * with IT++. If not, see . 26 | * 27 | * ------------------------------------------------------------------------- 28 | */ 29 | 30 | #ifndef BASEEXPORTS_H 31 | #define BASEEXPORTS_H 32 | 33 | #include 34 | 35 | namespace itpp 36 | { 37 | 38 | //! \cond 39 | 40 | #if (defined(_MSC_VER) && defined(ITPP_SHARED_LIB)) 41 | //MSVC needs to explicitely instantiate required templates while building the 42 | //shared library. Also, these definitions are marked as imported when library is 43 | //linked with user's code. 44 | template class ITPP_EXPORT Array; 45 | template class ITPP_EXPORT Array; 46 | template class ITPP_EXPORT Array; 47 | template class ITPP_EXPORT Array; 48 | template class ITPP_EXPORT Array; 49 | template class ITPP_EXPORT Array; 50 | template class ITPP_EXPORT Array; 51 | template class ITPP_EXPORT Array >; 52 | template class ITPP_EXPORT Array >; 53 | template class ITPP_EXPORT Array >; 54 | template class ITPP_EXPORT Array >; 55 | #endif 56 | 57 | //! \endcond 58 | 59 | } 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /tests/svd_test.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief SVD decomposition test program 4 | * \author Tony Ottosson and Adam Piatyszek 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | 31 | using namespace itpp; 32 | using namespace std; 33 | 34 | 35 | int main() 36 | { 37 | cout << "================================" << endl; 38 | cout << " Test of svd routines " << endl; 39 | cout << "================================" << endl; 40 | 41 | { 42 | cout << "Real matrix" << endl; 43 | mat A = randn(5, 5); 44 | mat U, V; 45 | vec S; 46 | svd(A, U, S, V); 47 | 48 | cout << "A = " << round_to_zero(A) << endl; 49 | cout << "norm(A - U*diag(S)*V^T) = " 50 | << round_to_zero(norm(A - U * diag(S) * transpose(V))) << endl; 51 | 52 | } 53 | { 54 | cout << endl << "Complex matrix" << endl; 55 | cmat A = randn_c(5, 5); 56 | cmat U, V; 57 | vec S; 58 | svd(A, U, S, V); 59 | 60 | cout << "A = " << round_to_zero(A) << endl; 61 | cout << "norm(A - U*diag(S)*V^H) = " 62 | << round_to_zero(norm(A - U * diag(S) * hermitian_transpose(V))) 63 | << endl; 64 | } 65 | 66 | return 0; 67 | } 68 | -------------------------------------------------------------------------------- /doc/tutorial/src/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/Makefile.common 2 | LDADD = $(top_builddir)/itpp/libitpp.la 3 | AM_CXXFLAGS = $(CXXFLAGS_OPT) 4 | 5 | ref_example_sources = bpsk.ref convcode.ref interleaver.ref \ 6 | qpsk_simulation.ref reedsolomon.ref spread.ref timer.ref \ 7 | vector_and_matrix.ref 8 | 9 | EXTRA_DIST = $(ref_example_sources) 10 | 11 | bpsk_example_SOURCES = bpsk.cpp 12 | convcode_example_SOURCES = convcode.cpp 13 | interleaver_example_SOURCES = interleaver.cpp 14 | ldpc_bersim_awgn_example_SOURCES = ldpc_bersim_awgn.cpp 15 | pccc_bersim_awgn_example_SOURCES = pccc_bersim_awgn.cpp 16 | exit_pccc_example_SOURCES = exit_pccc.cpp 17 | sccc_bersim_awgn_example_SOURCES = sccc_bersim_awgn.cpp 18 | turbo_equalizer_bersim_multipath_example_SOURCES = turbo_equalizer_bersim_multipath.cpp 19 | ldpc_gen_codes_example_SOURCES = ldpc_gen_codes.cpp 20 | mimoconv_example_SOURCES = mimoconv.cpp 21 | mog_example_SOURCES = mog.cpp 22 | qpsk_simulation_example_SOURCES = qpsk_simulation.cpp 23 | rayleigh_example_SOURCES = rayleigh.cpp 24 | read_it_file_example_SOURCES = read_it_file.cpp 25 | reedsolomon_example_SOURCES = reedsolomon.cpp 26 | spread_example_SOURCES = spread.cpp 27 | timer_example_SOURCES = timer.cpp 28 | vector_and_matrix_example_SOURCES = vector_and_matrix.cpp 29 | write_it_file_example_SOURCES = write_it_file.cpp 30 | stbicm_example_SOURCES = stbicm.cpp 31 | dump_it_file_example_SOURCES = dump_it_file.cpp 32 | 33 | BASE_EXAMPLES = mog_example read_it_file_example timer_example \ 34 | write_it_file_example dump_it_file_example 35 | if RUN_LAPACK_TESTS 36 | BASE_EXAMPLES += vector_and_matrix_example 37 | endif # RUN_LAPACK_TESTS 38 | 39 | COMM_EXAMPLES = bpsk_example convcode_example interleaver_example \ 40 | ldpc_gen_codes_example ldpc_bersim_awgn_example qpsk_simulation_example \ 41 | rayleigh_example reedsolomon_example spread_example pccc_bersim_awgn_example \ 42 | exit_pccc_example sccc_bersim_awgn_example turbo_equalizer_bersim_multipath_example 43 | if RUN_LAPACK_TESTS 44 | COMM_EXAMPLES += mimoconv_example stbicm_example 45 | endif # RUN_LAPACK_TESTS 46 | 47 | USED_EXAMPLES = $(BASE_EXAMPLES) 48 | if ENABLE_COMM 49 | USED_EXAMPLES += $(COMM_EXAMPLES) 50 | endif # ENABLE_COMM 51 | 52 | check_PROGRAMS = $(USED_EXAMPLES) 53 | -------------------------------------------------------------------------------- /itpp/base/math/integration.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Implementation of numerical integration 4 | * \author Tony Ottosson 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | 31 | //! \cond 32 | namespace itpp 33 | { 34 | 35 | //wrapper to convert double(*f)(double) to function object 36 | class Integrand_Wrapper 37 | { 38 | typedef double(*Ftn)(double); 39 | Ftn _f; 40 | public: 41 | explicit Integrand_Wrapper(Ftn f): _f(f) {} 42 | double operator()(double x) const {return _f(x);} 43 | }; 44 | 45 | 46 | template double quad(Integrand_Wrapper, double, double, double); 47 | template double quadl(Integrand_Wrapper, double, double, double); 48 | 49 | //--------------------- quad() ---------------------------------------- 50 | double quad(double(*f)(double), double a, double b, 51 | double tol) 52 | { 53 | return quad(Integrand_Wrapper(f), a, b, tol); 54 | } 55 | 56 | //--------------------- quadl() ---------------------------------------- 57 | double quadl(double(*f)(double), double a, double b, double tol) 58 | { 59 | return quadl(Integrand_Wrapper(f), a, b, tol); 60 | } 61 | 62 | 63 | } // namespace itpp 64 | 65 | //! \endcond 66 | 67 | 68 | -------------------------------------------------------------------------------- /tests/lu_test.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief LU factorization routines test program 4 | * \author Tony Ottosson and Adam Piatyszek 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | 31 | using namespace itpp; 32 | using namespace std; 33 | 34 | 35 | int main(void) 36 | { 37 | cout << "=================================" << endl; 38 | cout << "Test of LU factorization routines" << endl; 39 | cout << "=================================" << endl; 40 | 41 | { 42 | cout << "Real matrix" << endl; 43 | mat X = randn(5, 5); 44 | mat L, U; 45 | ivec p; 46 | lu(X, L, U, p); 47 | 48 | mat P = to_mat(permutation_matrix(p)); 49 | cout << "X = " << round_to_zero(X) << endl; 50 | cout << "norm(X - P^T*L*U) = " 51 | << round_to_zero(norm(X - transpose(P) * L * U)) << endl; 52 | } 53 | { 54 | cout << "Complex matrix" << endl; 55 | cmat X = randn_c(5, 5); 56 | cmat L, U; 57 | ivec p; 58 | lu(X, L, U, p); 59 | 60 | mat P = to_mat(permutation_matrix(p)); 61 | cout << "X = " << round_to_zero(X) << endl; 62 | cout << "norm(X - P^H*L*U = " 63 | << round_to_zero(norm(X - hermitian_transpose(P) * L * U)) << endl; 64 | } 65 | 66 | return 0; 67 | } 68 | -------------------------------------------------------------------------------- /tests/rand_test.ref: -------------------------------------------------------------------------------- 1 | Bernoulli_RNG: 2 | 0 3 | [0 1 1 0 1 0 1 0 0 0] 4 | [[1 1 1 0 0] 5 | [1 0 1 0 1] 6 | [1 0 0 1 1]] 7 | 8 | Uniform_RNG: 9 | 0.68 10 | [0.69 0.47 0.49 0.62 0.31 0.98 0.22 0.87 0.56 0.95] 11 | [[0.36 0.18 0.08 0.76 0.59] 12 | [0.20 0.81 0.29 0.86 0.50] 13 | [0.17 0.67 0.85 0.45 0.14]] 14 | 15 | I_Uniform_RNG [0..9]: 16 | 6 17 | [6 4 4 6 3 9 2 8 5 9] 18 | [[3 2 1 1 8] 19 | [6 0 2 8 7] 20 | [8 4 5 4 1]] 21 | 22 | Normal_RNG: 23 | 1.89 24 | [0.64 -0.67 0.73 -0.98 0.09 -0.41 1.50 1.71 -0.36 0.55] 25 | [[-0.37 0.24 0.09 0.73 -0.19] 26 | [-0.50 0.44 0.43 -1.57 0.75] 27 | [-1.75 -0.47 0.18 -0.43 -0.32]] 28 | 29 | Complex_Normal_RNG: 30 | 1.34+0.45i 31 | [-0.47+0.51i -0.69+0.06i -0.29+1.06i 1.21-0.26i 0.39-0.26i -0.35-1.23i 0.17+0.31i -0.33+0.06i 0.30+0.13i 0.52-1.11i] 32 | [[-0.30-0.14i 0.37-0.43i -0.14-0.13i -1.36+0.87i 0.75+0.49i] 33 | [0.53-0.23i 0.63-0.21i -0.47+0.21i 0.79-0.30i 0.13-0.00i] 34 | [0.44-0.34i 0.60+1.29i 0.79+0.36i 1.31+0.25i 0.23-0.29i]] 35 | 36 | Exponential_RNG: 37 | 1.13 38 | [1.18 0.63 0.67 0.96 0.37 3.81 0.25 2.02 0.81 3.02] 39 | [[0.44 0.23 0.18 0.20 1.64] 40 | [1.10 0.08 0.34 1.93 1.44] 41 | [1.93 0.59 0.88 0.69 0.16]] 42 | 43 | Gamma_RNG: 44 | 2.73 45 | [1.06 0.14 0.05 0.25 2.44 0.28 0.27 6.41 0.37 0.30] 46 | [[0.22 2.63 1.60 1.51 1.48] 47 | [0.16 0.37 0.93 0.07 0.55] 48 | [0.31 0.14 2.16 3.91 1.57]] 49 | 50 | Laplace_RNG: 51 | 0.31 52 | [0.35 -0.05 -0.02 0.19 -0.33 2.20 -0.58 0.94 0.09 1.65] 53 | [[-0.24 -0.63 -0.77 -0.72 0.67] 54 | [0.29 -1.30 -0.39 0.87 0.53] 55 | [0.88 -0.08 0.13 -0.00 -0.88]] 56 | 57 | AR1_Normal_RNG: 58 | -0.68 59 | [1.38 -1.13 -0.24 -0.64 0.59 0.70 0.10 0.85 0.95 0.90] 60 | [[0.28 0.17 -0.58 0.78 -1.63] 61 | [-0.20 0.35 -0.46 -1.91 0.17] 62 | [1.96 -1.25 -0.45 -0.56 -0.01]] 63 | 64 | Weibull_RNG: 65 | 1.13 66 | [1.18 0.63 0.67 0.96 0.37 3.81 0.25 2.02 0.81 3.02] 67 | [[0.44 0.23 0.18 0.20 1.64] 68 | [1.10 0.08 0.34 1.93 1.44] 69 | [1.93 0.59 0.88 0.69 0.16]] 70 | 71 | Rayleigh_RNG: 72 | 2.00 73 | [0.99 0.99 1.56 1.75 0.66 1.82 0.50 0.48 0.47 1.74] 74 | [[0.47 0.82 0.79 0.80 0.94] 75 | [2.02 0.27 0.72 1.23 2.29] 76 | [1.20 1.88 1.27 0.19 0.52]] 77 | 78 | Rice_RNG: 79 | 2.96 80 | [0.80 0.09 1.62 2.73 1.59 1.82 1.31 0.54 1.44 2.34] 81 | [[0.60 1.78 1.69 1.64 1.92] 82 | [2.61 0.82 0.45 2.17 1.54] 83 | [2.17 2.87 2.18 1.19 1.38]] 84 | 85 | -------------------------------------------------------------------------------- /tests/timer_test.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Timer classes test program 4 | * \author Thomas Eriksson, Tony Ottosson, Tobias Ringstrom and Adam Piatyszek 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | 31 | using namespace std; 32 | using namespace itpp; 33 | 34 | int main() 35 | { 36 | const double period = 2.0; 37 | const double relative_error = 0.05; 38 | CPU_Timer t1; 39 | Real_Timer t2; 40 | 41 | t1.start(); 42 | while (t1.get_time() < period) ; 43 | t1.stop(); 44 | 45 | tic(); 46 | t2.start(); 47 | while (t2.get_time() < period) ; 48 | t2.stop(); 49 | double t3 = toc(); 50 | 51 | if (fabs(t1.get_time() - period) <= relative_error * period) 52 | cout << "CPU_Timer is OK" << endl; 53 | else 54 | cout << "CPU_Timer difference: " << fabs(t1.get_time() - period) 55 | << " > " << relative_error * period << endl; 56 | 57 | if (fabs(t2.get_time() - period) <= relative_error * period) 58 | cout << "Real_Timer is OK" << endl; 59 | else 60 | cout << "Real_Timer difference: " << fabs(t1.get_time() - period) 61 | << " > " << relative_error * period << endl; 62 | 63 | if (t3 >= t2.get_time()) 64 | cout << "tic() and toc() are OK" << endl; 65 | 66 | return 0; 67 | } 68 | -------------------------------------------------------------------------------- /tests/poly_test.ref: -------------------------------------------------------------------------------- 1 | =================================== 2 | Test of polynomial routines 3 | =================================== 4 | Real polynomials 5 | Roots, r = [-0.283885 1.364462 0.906001] 6 | Polynomial, p = [1.000000 -1.986579 0.591655 0.350939] 7 | r = roots(p) = [1.364462+0.000000i 0.906001+0.000000i -0.283885+0.000000i] 8 | Roots, r = [1.249419 1.557830 0.564970 -0.596145 -1.197318 -1.267564 -0.300385] 9 | Polynomial, p = [1.000000 -0.010807 -3.896433 -0.597658 4.298162 1.153145 -1.021590 -0.298857] 10 | r = roots(p) = [1.557830+0.000000i 1.249419+0.000000i -1.267564+0.000000i -1.197318+0.000000i 0.564970+0.000000i -0.596145+0.000000i -0.300385+0.000000i] 11 | x = [-1.074602 2.364758 2.365075 1.228044 0.234136 -0.732016 -2.105534 -0.923457 -1.892274] 12 | polyval(p, x) = [-0.087985 165.384526 165.592625 0.078881 -0.424166 -0.085999 -68.059907 -0.154228 -23.858406] 13 | Complex polynomials 14 | Roots, r = [-0.469741-0.614789i -0.035692+0.565461i 0.727250-0.636742i] 15 | Polynomial, p = [1.000000+0.000000i -0.221817+0.686070i -0.034581+0.042280i -0.109854+0.409246i] 16 | r = roots(p) = [0.727250-0.636742i -0.469741-0.614789i -0.035692+0.565461i] 17 | Roots, r = [-0.160972-1.299157i 0.036193+1.019169i -1.046929+0.760191i -0.280465+0.361084i 0.780099+0.643584i 0.794379+1.032883i -0.190616-0.710921i] 18 | Polynomial, p = [1.000000+0.000000i 0.068312-1.806834i -0.158305-0.930377i -1.202161-3.461733i -3.908780+0.529733i -1.009816+0.365843i -1.368117+1.443013i 0.265664+0.718430i] 19 | r = roots(p) = [-0.160972-1.299157i -1.046929+0.760191i -0.190616-0.710921i 0.794379+1.032883i 0.780099+0.643584i 0.036193+1.019169i -0.280465+0.361084i] 20 | x = [1.323672+0.349763i 0.510483+0.174148i 0.475202-0.708159i -0.127081+0.388325i -0.572027-1.624474i -0.320883+0.183600i -1.023713+0.214321i -0.983530+0.261137i 1.133963-0.225782i] 21 | polyval(p, x) = [10.010566-7.090964i -1.057338+0.508034i 6.313101+3.020747i -0.067120+0.186664i 33.098080-42.921040i 0.345802-0.000105i -1.501636-4.154270i -1.503561-3.174843i -17.655443-0.481204i] 22 | Chebyshev polynomial 23 | x = [1.523584 -1.251292 0.658525 -0.859404 0.075397 -0.172018 -1.200352 -1.822961] 24 | cheb(10, x) = [9312.529843 520.885927 -0.617377 0.608798 -0.728487 0.157326 253.608153 88254.183938] 25 | cheb(15, x) = [1270915.019652 -16812.346582 0.977463 0.195158 -0.905276 0.521343 -5711.593426 -37078141.121001] 26 | -------------------------------------------------------------------------------- /extras/mkl_tests_vcproj.template: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 23 | 24 | 25 | 26 | 27 | 28 | 38 | 39 | 40 | 41 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /extras/acml_tests_vcproj.template: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 23 | 24 | 25 | 26 | 27 | 28 | 38 | 39 | 40 | 41 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /tests/inv_test.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Matrix inversion routines test program 4 | * \author Tony Ottosson and Adam Piatyszek 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | 31 | using namespace itpp; 32 | using namespace std; 33 | 34 | 35 | int main(void) 36 | { 37 | cout << "======================================" << endl; 38 | cout << " Test of Matrix inversion routines" << endl; 39 | cout << "======================================" << endl; 40 | 41 | { 42 | cout << "Real matrix" << endl; 43 | 44 | mat X = randn(5, 5), Y; 45 | Y = inv(X); 46 | cout << "X = " << round_to_zero(X) << endl; 47 | cout << "inv(X) = " << round_to_zero(Y) << endl; 48 | 49 | X = randn(5, 5); 50 | Y = inv(X); 51 | cout << "X = " << round_to_zero(X) << endl; 52 | cout << "inv(X) = " << round_to_zero(Y) << endl; 53 | } 54 | { 55 | cout << endl << "Complex matrix" << endl; 56 | 57 | cmat X = randn_c(5, 5), Y; 58 | Y = inv(X); 59 | cout << "X = " << round_to_zero(X) << endl; 60 | cout << "inv(X) = " << round_to_zero(Y) << endl; 61 | 62 | X = randn_c(5, 5); 63 | Y = inv(X); 64 | cout << "X = " << round_to_zero(X) << endl; 65 | cout << "inv(X) = " << round_to_zero(Y) << endl; 66 | } 67 | 68 | return 0; 69 | } 70 | -------------------------------------------------------------------------------- /extras/itpp-config.t2t: -------------------------------------------------------------------------------- 1 | itpp-config 2 | IT++ @PACKAGE_VERSION@ 3 | @PACKAGE_DATE@ 4 | 5 | %!target: man 6 | 7 | 8 | = NAME = 9 | 10 | itpp-config - script to get information about intalled IT++ library 11 | prefix, compiler flags and its version 12 | 13 | 14 | = SYNOPSIS = 15 | 16 | **itpp-config** [--prefix] [--exec-prefix] [--debug] [--static] 17 | [--cflags] [--libs] [--help] [--version] 18 | 19 | 20 | = DESCRIPTION = 21 | 22 | //itpp-config// is a tool that can be used to determine the compiler and 23 | linker flags required for compiling and linking programs that use IT++. 24 | It can be also used for checking the intalled libitpp library version. 25 | 26 | 27 | = OPTIONS = 28 | 29 | //itpp-config// accepts the following options: 30 | : **--prefix** 31 | output libitpp installation prefix 32 | : **--exec-prefix** 33 | output libitpp installation exec prefix 34 | : **--debug** 35 | use debugging pre-processor, compiler and linker flags (needs to be used 36 | in front of **--cflags** and **--libs**) 37 | : **--static** 38 | use static linker flags (needs to be used in front of **--libs**) 39 | : **--cflags** 40 | output pre-processor and compiler flags 41 | : **--libs** 42 | output linker flags 43 | : **--help** 44 | display brief help and exit 45 | : **--version** 46 | output version number 47 | 48 | 49 | = AUTHOR = 50 | 51 | This manual page was written by Adam Piatyszek 52 | as a text file, then converted to man format by txt2tags. 53 | 54 | 55 | = COPYRIGHT = 56 | 57 | Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 58 | 59 | This file is part of IT++ - a C++ library of mathematical, signal 60 | processing, speech processing, and communications classes and functions. 61 | 62 | IT++ is free software: you can redistribute it and/or modify it under the 63 | terms of the GNU General Public License as published by the Free Software 64 | Foundation, either version 3 of the License, or (at your option) any 65 | later version. 66 | 67 | IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 68 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 69 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 70 | details. 71 | 72 | You should have received a copy of the GNU General Public License along 73 | with IT++. If not, see . 74 | -------------------------------------------------------------------------------- /tests/det_test.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Determinant routines test program 4 | * \author Tony Ottosson and Adam Piatyszek 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | 31 | using namespace itpp; 32 | using namespace std; 33 | 34 | 35 | int main() 36 | { 37 | cout << "===================================" << endl; 38 | cout << " Test of Determinant routines " << endl; 39 | cout << "===================================" << endl; 40 | 41 | { 42 | cout << "Real matrix" << endl; 43 | mat X = randn(5, 5); 44 | double d; 45 | d = det(X); 46 | cout << "X = " << round_to_zero(X) << endl; 47 | cout << "det(X) = " << round_to_zero(d) << endl; 48 | 49 | X = randn(5, 5); 50 | d = det(X); 51 | cout << "X = " << round_to_zero(X) << endl; 52 | cout << "det(X) = " << round_to_zero(d) << endl; 53 | } 54 | 55 | { 56 | cout << endl << "Complex matrix" << endl; 57 | cmat X = randn_c(5, 5); 58 | complex d; 59 | d = det(X); 60 | cout << "X = " << round_to_zero(X) << endl; 61 | cout << "det(X) = " << round_to_zero(d) << endl; 62 | 63 | X = randn_c(5, 5); 64 | d = det(X); 65 | cout << "X = " << round_to_zero(X) << endl; 66 | cout << "det(X) = " << round_to_zero(d) << endl; 67 | } 68 | 69 | return 0; 70 | } 71 | -------------------------------------------------------------------------------- /itpp/comm/sources.mk: -------------------------------------------------------------------------------- 1 | h_comm_sources = \ 2 | $(top_srcdir)/itpp/comm/bch.h \ 3 | $(top_srcdir)/itpp/comm/channel_code.h \ 4 | $(top_srcdir)/itpp/comm/channel.h \ 5 | $(top_srcdir)/itpp/comm/commfunc.h \ 6 | $(top_srcdir)/itpp/comm/convcode.h \ 7 | $(top_srcdir)/itpp/comm/crc.h \ 8 | $(top_srcdir)/itpp/comm/egolay.h \ 9 | $(top_srcdir)/itpp/comm/error_counters.h \ 10 | $(top_srcdir)/itpp/comm/exit.h \ 11 | $(top_srcdir)/itpp/comm/galois.h \ 12 | $(top_srcdir)/itpp/comm/hammcode.h \ 13 | $(top_srcdir)/itpp/comm/interleave.h \ 14 | $(top_srcdir)/itpp/comm/ldpc.h \ 15 | $(top_srcdir)/itpp/comm/llr.h \ 16 | $(top_srcdir)/itpp/comm/modulator.h \ 17 | $(top_srcdir)/itpp/comm/modulator_nd.h \ 18 | $(top_srcdir)/itpp/comm/ofdm.h \ 19 | $(top_srcdir)/itpp/comm/pulse_shape.h \ 20 | $(top_srcdir)/itpp/comm/punct_convcode.h \ 21 | $(top_srcdir)/itpp/comm/rec_syst_conv_code.h \ 22 | $(top_srcdir)/itpp/comm/reedsolomon.h \ 23 | $(top_srcdir)/itpp/comm/sequence.h \ 24 | $(top_srcdir)/itpp/comm/siso.h \ 25 | $(top_srcdir)/itpp/comm/spread.h \ 26 | $(top_srcdir)/itpp/comm/stc.h \ 27 | $(top_srcdir)/itpp/comm/turbo.h 28 | 29 | cpp_comm_sources = \ 30 | $(top_srcdir)/itpp/comm/bch.cpp \ 31 | $(top_srcdir)/itpp/comm/channel.cpp \ 32 | $(top_srcdir)/itpp/comm/commfunc.cpp \ 33 | $(top_srcdir)/itpp/comm/convcode.cpp \ 34 | $(top_srcdir)/itpp/comm/crc.cpp \ 35 | $(top_srcdir)/itpp/comm/egolay.cpp \ 36 | $(top_srcdir)/itpp/comm/error_counters.cpp \ 37 | $(top_srcdir)/itpp/comm/exit.cpp \ 38 | $(top_srcdir)/itpp/comm/galois.cpp \ 39 | $(top_srcdir)/itpp/comm/hammcode.cpp \ 40 | $(top_srcdir)/itpp/comm/interleave.cpp \ 41 | $(top_srcdir)/itpp/comm/ldpc.cpp \ 42 | $(top_srcdir)/itpp/comm/llr.cpp \ 43 | $(top_srcdir)/itpp/comm/modulator.cpp \ 44 | $(top_srcdir)/itpp/comm/modulator_nd.cpp \ 45 | $(top_srcdir)/itpp/comm/ofdm.cpp \ 46 | $(top_srcdir)/itpp/comm/pulse_shape.cpp \ 47 | $(top_srcdir)/itpp/comm/punct_convcode.cpp \ 48 | $(top_srcdir)/itpp/comm/rec_syst_conv_code.cpp \ 49 | $(top_srcdir)/itpp/comm/reedsolomon.cpp \ 50 | $(top_srcdir)/itpp/comm/sequence.cpp \ 51 | $(top_srcdir)/itpp/comm/siso_dem.cpp \ 52 | $(top_srcdir)/itpp/comm/siso_eq.cpp \ 53 | $(top_srcdir)/itpp/comm/siso_mud.cpp \ 54 | $(top_srcdir)/itpp/comm/siso_nsc.cpp \ 55 | $(top_srcdir)/itpp/comm/siso_rsc.cpp \ 56 | $(top_srcdir)/itpp/comm/spread.cpp \ 57 | $(top_srcdir)/itpp/comm/stc.cpp \ 58 | $(top_srcdir)/itpp/comm/turbo.cpp 59 | -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import {} 2 | , enableDoxygen ? false 3 | }: 4 | 5 | let gtestSrc = pkgs.fetchFromGitHub { 6 | owner = "google"; 7 | repo = "googletest"; 8 | rev = "release-1.11.0"; 9 | hash = "sha256-SjlJxushfry13RGA7BCjYC9oZqV4z6x8dOiHfl/wpF0="; 10 | }; 11 | 12 | in pkgs.stdenv.mkDerivation rec { 13 | name = "itpp"; 14 | # version = "4.3.1"; 15 | 16 | src = builtins.path { name = "itpp"; path = ./.; }; 17 | 18 | enableParallelBuilding = true; 19 | 20 | nativeBuildInputs = with pkgs; [ 21 | cmake 22 | python 23 | rsync 24 | ] ++ lib.optional enableDoxygen [ doxygen graphviz ]; 25 | 26 | buildInputs = with pkgs; [ 27 | openblas 28 | lapack-reference 29 | fftw 30 | gtestSrc 31 | ]; 32 | 33 | configurePhase = '' 34 | mkdir -p build && cd build 35 | cmake -DOLD_TESTS=on -DGTEST_DIR=${gtestSrc}/googletest .. 36 | ''; 37 | 38 | buildPhase = '' 39 | make 40 | ''; 41 | 42 | doCheck = true; 43 | checkPhase = '' 44 | echo Running old unit tests 45 | python ../extras/check_tests.py -r ../tests -w tests 46 | echo Running GTest-based unit tests 47 | ./gtests/itpp_gtests 48 | ''; 49 | 50 | installPhase = '' 51 | mkdir -p $out/bin 52 | cp itpp-config $out/bin 53 | chmod a+rx $out/bin/itpp-config 54 | 55 | mkdir -p $out/lib 56 | cp itpp/libitpp*.dylib $out/lib 57 | 58 | # Headers 59 | mkdir -p $out/include/itpp 60 | rsync --recursive --prune-empty-dirs --exclude='config_msvc.h' --include='*.h' --include='*/' --exclude='*' $src/itpp/ $out/include/itpp/ 61 | cp itpp/config.h $out/include/itpp 62 | cp itpp/itexports.h $out/include/itpp 63 | 64 | # Extra (Matlab, Python) 65 | mkdir -p $out/share/itpp 66 | cp $src/extras/itsave.m $out/share/itpp/ 67 | cp $src/extras/itload.m $out/share/itpp/ 68 | cp $src/extras/pyitpp.py $out/share/itpp/ 69 | cp $src/extras/gdb_macros_for_itpp $out/share/itpp/ 70 | 71 | # Pkg-config support 72 | mkdir -p $out/lib/pkgconfig 73 | cp itpp.pc $out/lib/pkgconfig 74 | 75 | # Man page 76 | mkdir -p $out/share/man/man1 77 | cp itpp-config.1 $out/share/man/man1 78 | 79 | # Doxygen documentation 80 | if [ -d "html" ]; then 81 | mkdir -p $out/share/doc/itpp 82 | cp -r html $out/share/doc/itpp 83 | cp $src/doc/images/itpp_logo.png $out/share/doc/itpp/html 84 | fi 85 | ''; 86 | } 87 | -------------------------------------------------------------------------------- /doc/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/doc/local/sources.mk 2 | include $(top_srcdir)/doc/tutorial/sources.mk 3 | include $(top_srcdir)/itpp/sources.mk 4 | include $(top_srcdir)/itpp/base/sources.mk 5 | include $(top_srcdir)/itpp/base/algebra/sources.mk 6 | include $(top_srcdir)/itpp/base/math/sources.mk 7 | include $(top_srcdir)/itpp/comm/sources.mk 8 | include $(top_srcdir)/itpp/fixed/sources.mk 9 | include $(top_srcdir)/itpp/optim/sources.mk 10 | include $(top_srcdir)/itpp/protocol/sources.mk 11 | include $(top_srcdir)/itpp/signal/sources.mk 12 | include $(top_srcdir)/itpp/srccode/sources.mk 13 | include $(top_srcdir)/itpp/stat/sources.mk 14 | 15 | SUBDIRS = images tutorial local 16 | 17 | distdir_html = @PACKAGE@-html-doc-@VERSION@ 18 | 19 | all-local: html-local 20 | 21 | html-local: html/index.html 22 | 23 | html/index.html: doxygen_html.cfg \ 24 | $(doc_local_sources) $(html_local_sources) \ 25 | $(doc_tutorial_sources) \ 26 | $(h_sources) $(cpp_sources) \ 27 | $(h_base_sources) $(cpp_base_sources) \ 28 | $(h_base_algebra_sources) $(cpp_base_algebra_sources) \ 29 | $(h_base_math_sources) $(cpp_base_math_sources) \ 30 | $(h_comm_sources) $(cpp_comm_sources) \ 31 | $(h_fixed_sources) $(cpp_fixed_sources) \ 32 | $(h_optim_sources) $(cpp_optim_sources) \ 33 | $(h_protocol_sources) $(cpp_protocol_sources) \ 34 | $(h_signal_sources) $(cpp_signal_sources) \ 35 | $(h_srccode_sources) $(cpp_srccode_sources) \ 36 | $(h_stat_sources) $(cpp_stat_sources) 37 | doxygen $<; \ 38 | if test -d html; then \ 39 | cp $(srcdir)/images/itpp_logo.png html; \ 40 | cp $(srcdir)/images/favicon.ico html; \ 41 | fi 42 | 43 | dist-html: html-local 44 | cp -a $(top_builddir)/doc/html $(top_builddir)/$(distdir_html) 45 | tar chof - $(top_builddir)/$(distdir_html) | \ 46 | gzip --best -c > $(top_builddir)/$(distdir_html).tar.gz 47 | tar chof - $(top_builddir)/$(distdir_html) | \ 48 | bzip2 -9 -c > $(top_builddir)/$(distdir_html).tar.bz2 49 | rm -rf $(top_builddir)/$(distdir_html) 50 | 51 | install-data-local: html-local 52 | if test -d html; then \ 53 | $(mkinstalldirs) $(DESTDIR)$(docdir); \ 54 | for d in `find html -type d`; do \ 55 | $(mkinstalldirs) $(DESTDIR)$(docdir)/$$d; \ 56 | done; \ 57 | for f in `find html -type f`; do \ 58 | $(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/$$f; \ 59 | done \ 60 | fi 61 | 62 | uninstall-local: 63 | rm -rf $(DESTDIR)$(docdir) 64 | 65 | clean-local: 66 | rm -rf html *.log *.tag 67 | -------------------------------------------------------------------------------- /doc/images/itpp_logga.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 2 | Landscape 3 | Center 4 | Inches 5 | Letter 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 6 975 894 3073 1754 11 | 6 975 900 3023 1725 12 | 1 2 0 1 10 10 50 0 20 0.000 1 6.1785 1959 1323 39 402 1920 1323 1998 1323 13 | 1 2 0 1 19 19 50 0 20 0.000 1 6.1785 2563 1323 39 402 2524 1323 2602 1323 14 | 1 2 0 1 13 13 50 0 20 0.000 1 6.1785 1474 1323 39 402 1435 1323 1513 1323 15 | 1 2 0 1 22 22 50 0 20 0.000 1 6.1785 1067 1323 39 402 1028 1323 1106 1323 16 | 1 2 0 1 10 10 50 0 20 0.000 1 0.1047 1973 1283 394 30 1579 1283 2367 1283 17 | 1 2 0 1 19 19 50 0 20 0.000 1 0.1047 2603 1283 394 30 2209 1283 2996 1283 18 | 1 2 0 1 13 13 50 0 20 0.000 1 0.1047 1553 940 394 30 1159 940 1947 940 19 | -6 20 | 6 990 894 3038 1719 21 | 1 2 0 1 10 10 50 0 20 0.000 1 6.1785 1974 1317 39 402 1935 1317 2013 1317 22 | 1 2 0 1 19 19 50 0 20 0.000 1 6.1785 2578 1317 39 402 2539 1317 2617 1317 23 | 1 2 0 1 13 13 50 0 20 0.000 1 6.1785 1489 1317 39 402 1450 1317 1528 1317 24 | 1 2 0 1 22 22 50 0 20 0.000 1 6.1785 1082 1317 39 402 1043 1317 1121 1317 25 | 1 2 0 1 10 10 50 0 20 0.000 1 0.1047 1988 1277 394 30 1594 1277 2382 1277 26 | 1 2 0 1 19 19 50 0 20 0.000 1 0.1047 2618 1277 394 30 2224 1277 3011 1277 27 | 1 2 0 1 13 13 50 0 20 0.000 1 0.1047 1568 934 394 30 1174 934 1962 934 28 | -6 29 | 6 1025 919 3073 1744 30 | 1 2 0 1 10 10 50 0 20 0.000 1 6.1785 2009 1342 39 402 1970 1342 2048 1342 31 | 1 2 0 1 19 19 50 0 20 0.000 1 6.1785 2613 1342 39 402 2574 1342 2652 1342 32 | 1 2 0 1 13 13 50 0 20 0.000 1 6.1785 1524 1342 39 402 1485 1342 1563 1342 33 | 1 2 0 1 22 22 50 0 20 0.000 1 6.1785 1117 1342 39 402 1078 1342 1156 1342 34 | 1 2 0 1 10 10 50 0 20 0.000 1 0.1047 2023 1302 394 30 1629 1302 2417 1302 35 | 1 2 0 1 19 19 50 0 20 0.000 1 0.1047 2653 1302 394 30 2259 1302 3046 1302 36 | 1 2 0 1 13 13 50 0 20 0.000 1 0.1047 1603 959 394 30 1209 959 1997 959 37 | -6 38 | 6 995 929 3043 1754 39 | 1 2 0 1 10 10 50 0 20 0.000 1 6.1785 1979 1352 39 402 1940 1352 2018 1352 40 | 1 2 0 1 19 19 50 0 20 0.000 1 6.1785 2583 1352 39 402 2544 1352 2622 1352 41 | 1 2 0 1 13 13 50 0 20 0.000 1 6.1785 1494 1352 39 402 1455 1352 1533 1352 42 | 1 2 0 1 22 22 50 0 20 0.000 1 6.1785 1087 1352 39 402 1048 1352 1126 1352 43 | 1 2 0 1 10 10 50 0 20 0.000 1 0.1047 1993 1312 394 30 1599 1312 2387 1312 44 | 1 2 0 1 19 19 50 0 20 0.000 1 0.1047 2623 1312 394 30 2229 1312 3016 1312 45 | 1 2 0 1 13 13 50 0 20 0.000 1 0.1047 1573 969 394 30 1179 969 1967 969 46 | -6 47 | -6 48 | -------------------------------------------------------------------------------- /extras/setenv.bat: -------------------------------------------------------------------------------- 1 | @rem File: setenv.bat.py 2 | @rem Brief: Setting the environment for using Microsoft Visual Studio command line tools. 3 | @rem Author: Bogdan Cristea 4 | @rem Initial version provided by B.Komazec 5 | @rem 6 | @rem Usage: setenv.bat x64 7 | @rem 8 | @rem This batch file calls MS Visual Studio provided batch files (vcvars32.bat or vcvars64.bat) 9 | @rem in order to setup the environment variables needed for Microsoft Visual Studio 10 | @rem command line tools. Note that the paths to vcvars32.bat or vcvars64.bat are hard 11 | @rem coded and needed to be provided if needed. By default these paths correspond to 12 | @rem Microsoft Visual Studio 2010 installation. 13 | @rem 14 | @rem ------------------------------------------------------------------------- 15 | @rem 16 | @rem Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 17 | @rem 18 | @rem This file is part of IT++ - a C++ library of mathematical, signal 19 | @rem processing, speech processing, and communications classes and functions. 20 | @rem 21 | @rem IT++ is free software: you can redistribute it and/or modify it under the 22 | @rem terms of the GNU General Public License as published by the Free Software 23 | @rem Foundation, either version 3 of the License, or (at your option) any 24 | @rem later version. 25 | @rem 26 | @rem IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 27 | @rem WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 28 | @rem FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 29 | @rem details. 30 | @rem 31 | @rem You should have received a copy of the GNU General Public License along 32 | @rem with IT++. If not, see . 33 | @rem 34 | @rem ------------------------------------------------------------------------- 35 | 36 | @echo off 37 | 38 | @if "%1"=="x86" goto set_x86 39 | @if "%1"=="x64" goto set_x64 40 | @if "%1"=="" goto error 41 | 42 | :set_x86 43 | 44 | call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat" 45 | 46 | goto test_bin_locations 47 | 48 | :set_x64 49 | 50 | call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\vcvars64.bat" 51 | 52 | goto test_bin_locations 53 | 54 | :test_bin_locations 55 | @echo on 56 | where nmake 57 | where cl.exe 58 | where link.exe 59 | @echo off 60 | goto:eof 61 | 62 | :error 63 | @echo Usage: setenv.bat [x86^|x64] 64 | 65 | goto:eof 66 | -------------------------------------------------------------------------------- /gtests/schur_test.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Schur decomposition test program 4 | * \author Adam Piatyszek 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2013 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | #include "gtest/gtest.h" 31 | 32 | using namespace itpp; 33 | 34 | TEST(Schur, All) 35 | { 36 | RNG_reset(0); 37 | static const double tol = 1e-9; 38 | 39 | int size = 5; 40 | 41 | // Test of Schur decomposition routines 42 | { 43 | // Real matrix 44 | mat A = randn(size, size); 45 | mat T, U; 46 | schur(A, U, T); 47 | 48 | ASSERT_NEAR(3.52148e-15, norm(A - (U * T * transpose(U))), tol); 49 | ASSERT_NEAR(9.92862e-16, norm(eye(size) - (U * transpose(U))), tol); 50 | double temp_sum = 0; 51 | for (int i = 2; i < size; i++) 52 | for (int j = 0; j < i - 1; j++) 53 | temp_sum += sqr(T(i, j)); 54 | ASSERT_NEAR(0, sqrt(temp_sum), tol); 55 | } 56 | { 57 | // Complex matrix 58 | cmat A = randn_c(size, size); 59 | cmat T, U; 60 | schur(A, U, T); 61 | 62 | ASSERT_NEAR(7.24721e-15, norm(A - (U * T * hermitian_transpose(U))), tol); 63 | ASSERT_NEAR(1.73911e-15, norm(eye(size) - (U * hermitian_transpose(U))), tol); 64 | double temp_sum = 0; 65 | for (int i = 1; i < size; i++) 66 | for (int j = 0; j < i; j++) 67 | temp_sum += sqr(T(i, j)); 68 | ASSERT_NEAR(0, sqrt(temp_sum), tol); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /itpp/comm/interleave.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Implementation of interleaver classes 4 | * \author Pal Frenger 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | 31 | 32 | namespace itpp 33 | { 34 | 35 | // ---------------------------------------------------------------------- 36 | // Instantiations 37 | // ---------------------------------------------------------------------- 38 | 39 | template class ITPP_EXPORT Block_Interleaver; 40 | template class ITPP_EXPORT Block_Interleaver; 41 | template class ITPP_EXPORT Block_Interleaver; 42 | template class ITPP_EXPORT Block_Interleaver >; 43 | template class ITPP_EXPORT Block_Interleaver; 44 | 45 | template class ITPP_EXPORT Cross_Interleaver; 46 | template class ITPP_EXPORT Cross_Interleaver; 47 | template class ITPP_EXPORT Cross_Interleaver; 48 | template class ITPP_EXPORT Cross_Interleaver >; 49 | template class ITPP_EXPORT Cross_Interleaver; 50 | 51 | template class ITPP_EXPORT Sequence_Interleaver; 52 | template class ITPP_EXPORT Sequence_Interleaver; 53 | template class ITPP_EXPORT Sequence_Interleaver; 54 | template class ITPP_EXPORT Sequence_Interleaver >; 55 | template class ITPP_EXPORT Sequence_Interleaver; 56 | 57 | //! \endcond 58 | 59 | } // namespace itpp 60 | -------------------------------------------------------------------------------- /itpp/base/algebra/det.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Definitions of determinant calculations 4 | * \author Tony Ottosson 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #ifndef DET_H 30 | #define DET_H 31 | 32 | #include 33 | #include 34 | 35 | namespace itpp 36 | { 37 | 38 | /*! 39 | \brief Determinant of real square matrix. 40 | \ingroup determinant 41 | 42 | Calculate determinant of the real matrix \f$\mathbf{X}\f$ 43 | 44 | Uses LU-factorisation. 45 | \f[ 46 | \det(\mathbf{X}) = \det(\mathbf{P}^T \mathbf{L}) \det(\mathbf{U}) = \det(\mathbf{P}^T) \prod(\mathrm{diag}(\mathbf{U})) 47 | \f] 48 | and the determinant of the permuation matrix is \f$ \pm 1\f$ depending on the number of row permutations 49 | */ 50 | ITPP_EXPORT double det(const mat &X); 51 | 52 | 53 | /*! 54 | \brief Determinant of complex square matrix. 55 | \ingroup determinant 56 | 57 | Calculate determinant of the complex matrix \f$\mathbf{X}\f$ 58 | 59 | Uses LU-factorisation. 60 | \f[ 61 | \det(\mathbf{X}) = \det(\mathbf{P}^T \mathbf{L}) \det(\mathbf{U}) = \det(\mathbf{P}^T) \prod(\mathrm{diag}(\mathbf{U})) 62 | \f] 63 | and the determinant of the permuation matrix is \f$ \pm 1\f$ depending on the number of row permutations 64 | */ 65 | ITPP_EXPORT std::complex det(const cmat &X); 66 | 67 | 68 | } // namespace itpp 69 | 70 | #endif // #ifndef DET_H 71 | -------------------------------------------------------------------------------- /itpp/itsignal.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief Include file for the IT++ signal-processing module 4 | * \author Adam Piatyszek 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #ifndef ITSIGNAL_H 30 | #define ITSIGNAL_H 31 | 32 | /*! 33 | * \defgroup signal Signal Processing (SP) Module 34 | * @{ 35 | */ 36 | 37 | //! \defgroup detsource Deterministic Sources 38 | //! \defgroup fastica Fast Independent Component Analysis 39 | //! \defgroup filters Filtering 40 | //! \defgroup poly Polynomial Functions 41 | //! \defgroup resampling Resampling Functions 42 | //! \defgroup sigproc Miscellaneous SP Functions 43 | 44 | /*! 45 | * \defgroup transforms Transforms 46 | * @{ 47 | */ 48 | 49 | //! \defgroup dct Discrete Cosine Transform (DCT) 50 | //! \defgroup fft Fast Fourier Transform (FFT) 51 | //! \defgroup fht Fast Hadamard Transform (FHT) 52 | 53 | /*! 54 | * @} 55 | */ 56 | 57 | //! \defgroup windfunc Windowing 58 | 59 | /*! 60 | * @} 61 | */ 62 | 63 | #include 64 | #include 65 | #include 66 | #include 67 | #include 68 | #include 69 | #include 70 | #include 71 | #include 72 | #include 73 | #include 74 | 75 | #endif // #ifndef ITSIGNAL_H 76 | -------------------------------------------------------------------------------- /gtests/error_count_test.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file 3 | * \brief BERC and BLER error counters test program 4 | * \author Adam Piatyszek 5 | * 6 | * ------------------------------------------------------------------------- 7 | * 8 | * Copyright (C) 1995-2012 (see AUTHORS file for a list of contributors) 9 | * 10 | * This file is part of IT++ - a C++ library of mathematical, signal 11 | * processing, speech processing, and communications classes and functions. 12 | * 13 | * IT++ is free software: you can redistribute it and/or modify it under the 14 | * terms of the GNU General Public License as published by the Free Software 15 | * Foundation, either version 3 of the License, or (at your option) any 16 | * later version. 17 | * 18 | * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY 19 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | * details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with IT++. If not, see . 25 | * 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | #include 30 | #include "gtest/gtest.h" 31 | 32 | using namespace itpp; 33 | using namespace std; 34 | 35 | 36 | TEST(ErrorCount, All) 37 | { 38 | //BERC and BLER test 39 | 40 | const double eps = 1e-12; 41 | RNG_reset(0); 42 | 43 | const int block_size = 20; 44 | const ivec error_pos = "3 5 9 17"; 45 | BERC berc; 46 | BLERC blerc(block_size); 47 | 48 | for (int i = 0; i < 100; ++i) { 49 | bvec input = randb(block_size); 50 | bvec output = input; 51 | // introduce some errors 52 | if (i < 80) 53 | for (int j = 0; j < error_pos.size(); ++j) 54 | output(error_pos(j)) = !output(error_pos(j)); 55 | // extend the output vector by one bit 56 | output = concat(output, bin(1)); 57 | // count errors 58 | berc.count(input, output); 59 | blerc.count(input, output); 60 | } 61 | 62 | ASSERT_NEAR(0.8, blerc.get_errorrate(), eps); 63 | ASSERT_NEAR(80, blerc.get_errors(), eps); 64 | ASSERT_NEAR(20, blerc.get_corrects(), eps); 65 | ASSERT_EQ(100, blerc.get_total_blocks()); 66 | 67 | ASSERT_NEAR(0.16, berc.get_errorrate(), eps); 68 | ASSERT_NEAR(320, berc.get_errors(), eps); 69 | ASSERT_NEAR(1680, berc.get_corrects(), eps); 70 | ASSERT_EQ(2000, berc.get_total_bits()); 71 | } 72 | --------------------------------------------------------------------------------