Wireless

libwireless and wireless-python

The wireless package contains components for physical- and link-layer simulation of wireless systems, with an emphasis on error correction codes. It was developed as part of spinal code research. Components include:

  • Error correcting codes: spinal codes, raptor, LT, LDPC, strider, turbo.
  • Mappers/Demappers: linear mapping, gray mapping.
  • Channels: AWGN, BSC, MIMO, model of Rayleigh channel.
  • Packet generators: random, random+CRC.
  • Statistics collection: BER (Bit Error Rate), PER (Packet Error Rate).
  • Simulation loop ready for parallel execution, supports rateless codes.
  • Efficient database (based on Berkeley DB) to collect experiment results.

Package dependencies

The package has the following dependencies: SWIG, git, python header files, GNU autotools, libtool, a C++ compiler (e.g., g++), Boost (for strider linear algebra), numpy, and IT++. On Ubuntu 12.04 these can be installed via:

sudo apt-get install swig git python-dev autoconf libtool g++ libboost-dev python-numpy-dev libitpp-dev

Note that on Ubuntu, IT++ is in the universe software repository, so they might require enabling universe repositories. Note that SWIG version 2.0.7 and up are required. Earlier versions have bugs that prevent swig from successfully compiling the binding code. If downloading latest swig source code, note that libpcre is required, e.g.:

sudo apt-get install libpcre3-dev

Obtaining the code

The code is hosted on github: https://github.com/yonch/wireless. To get a copy:

git clone git://github.com/yonch/wireless.git

Compiling

Enter the directory

cd wireless

Deploy the autotools build system

autoreconf --install

Configure the package. The build requires CPPFLAGS with the location of IT++ include files (in Ubuntu 12.04 for example, /usr/include). To separate build objects from the source tree, the package is configured from within a different directory (called release, below). The package could be installed to the default system paths (by omitting --prefix), but the example below installs to the user's home directory.

mkdir release
cd release
CPPFLAGS="-I/usr/include -DNDEBUG" CXXFLAGS="-O3" ../configure --prefix=$HOME -C

Or, make a debug release

mkdir debug
cd debug
CPPFLAGS="-I/usr/include -DDEBUG" CXXFLAGS="-O1 -g" ../configure --prefix=$HOME -C

Make the package and install:

make -j8
make -j8 install

Setting up the environment

In case the library was installed into a custom directory (like the user's home directory), the following paths enable the package to be found.

    export WIRELESS_SIM_PREFIX=$HOME
    export C_INCLUDE_PATH=$WIRELESS_SIM_PREFIX/include:$C_INCLUDE_PATH
    export CPLUS_INCLUDE_PATH=$WIRELESS_SIM_PREFIX/include:$CPLUS_INCLUDE_PATH
    export LIBRARY_PATH=$WIRELESS_SIM_PREFIX/lib:$LIBRARY_PATH
    export LD_LIBRARY_PATH=$WIRELESS_SIM_PREFIX/lib:$LD_LIBRARY_PATH
    export PYTHONPATH=$PYTHONPATH:$WIRELESS_SIM_PREFIX/lib/python2.7/site-packages:$WIRELESS_SIM_PREFIX/lib/python

By adding these to ~/.bashrc or the like, these paths can be configured automatically.

Checking installation

The sanity test runs simulation with many of the package's components:

    python
    >>> import wireless.simulator.SanityTest

Exploring the code

  • One approach is to read the source code in the include/ and src/ directories; include files document class methods.
  • The file python/simulator/SanityTest.py contains multiple experiment specifications. The factories in python/simulator/factories make different components, and the python/simulator/Simulator.py drives the components.
  • For spinal codes, a python implementation (without puncturing) is in python/codes/spinal/reference. The file test/codes/spinal/EncoderDecoderTests.py doesn't work out of the box, but contains the basic recipe to make spinal encoders/decoders (to complement information in SpinalFactory.py

More Information

For more information, please leave a comment or contact the author (yonch at mit dot edu). This guide will be expanded according to user requests as time allows. -- Jonathan

Comments   

 
# Bruce carneal 2013-03-05 20:56
Hi. One anomaly, one question, and one comment.

Anomaly:
For a vanilla Ubuntu 12.04 install I needed to extend the PYTHONPATH with .../dist-packag es/wireless to keep the SanityTest from kvetching: "ImportError: No module named general"

Question: Is anyone working to make a good chunk of your work available within the gnuradio/GRC framework?

Comment: From what I've read so far, very nice work. Thanks and good luck going forward.

Bruce
Reply | Reply with quote | Quote
 

Add comment


Security code
Refresh