This repository is part of my bachelor thesis: Spectrum Sensing for the SALSAT Nanosatellite. It provides algorithms and simulations for blind wideband spectrum sensing with special emphasis on space applications. More background information on the SALSAT project can be found here. The code is a constant work in progress and ever-evolving. So stay with me if something is not working or behaving "weird". You can always contact me (details at the bottom).
This repository is split up into three main directories:
specsens/the python package that contains all relevant code and algorithms.notebooks/contains usage examples for all parts of thespecsenspackage.graphs/contains the code used to create the graphs in my thesis.
The code is written in python 3.6 using the packages listed in requirements.txt. Consider using a virtual environment. Ensure that you have matplotlib 3.1.x installed. Other versions might give weird artifacts. I am still looking into the problem at this point in time.
Starting with a clean Ubuntu 18.04 system (should also work with other Linux distributions) you will need to follow these steps:
- Clone the repository using
git, rungit clone git@git.tu-berlin.de:salsat/spectrum-sensing.git(you will need to havesshwith GitLab setup for this to work) - Navigate into the repository, run
cd spectrum-sensing - Ensure you have Python 3, run
python3 --version - Install Python Virtual Environments, run
sudo apt install python3-venv - Install
pip3, runsudo apt install python3-pip - Create a new virtual environment, run
python3 -m venv specsens-env - To activate the virtual environment, run
source specsens-env/bin/activate - (To deactivate the virtual environment, run
deactivate) - Use the
requirements.txtto install required python packages, runpip3 install -r requirements.txt - Finally, start Jupyter Notebook, run
jupyter notebook
If you already have some of the parts installed, just skip the corresponding steps. Feel free to open an issue or contact me if you run into any problems.
In order to organize and structure my work, I created the specsens package. It contains most of the algorithms and simulations that I developed. It behaves like a regular python package (one can just import specsens). It consists of the following directories:
eigenvalue_detect/Eigenvalue detection algorithms based on signal covariance matrices.energy_detect/Energy detector and functions to calculate performance statistics (prob. of false alarm, prob. of detection, etc.).noise_estimation/Noise estimation methods and related utilities. (Currently still part of eigenvalue_detect, work in progress.)plot/Plotting functions to visualize signals and detection results.signal/Signal and noise generators used mainly for simulations, as well as some utilities that simplify working with signals.simulation/Simulations to evaluate performance statistics.wideband_detect/Wideband detection algorithms (wideband energy detector, wavelet edge detector, etc.).
When using the specsens package locally you need to add the following lines before you import the package. This tells the python interpreter where to find the package:
import sys
sys.path.insert(0, '..')
Replace .. with the path to the specsens package, when moving things around.
The notebooks provide a visual presentation of the specsens package and its functionalities. They allow you to get an overview of what the algorithms are doing in order to better understand them. Feel free to play around with the code and observe the behavior, especially in the simulations.
01_signal_and_noise.ipynbbasic overview over complex signal and noise generation + time-domain visualization.02_simple_energy_detector.ipynbsimple narrowband time-domain energy detector.03_energy_detector_statistics.ipynbanalytical performance statistics overview and comparison (prob. of false alarm, prob. of detection, etc.) ( comparison between Chi-square based statistics and central limit theorem based statistics).04_energy_detector_simulation.ipynbsimulation using simple energy detector and comparison between analytical and numerical statistics.05_short_time_fourier_transform.ipynbshort-time Fourier transform + frequency domain visualization.06_wideband_signal.ipynbwideband signal generation using signal matrix.06a_doppler_signal.ipynbwideband doppler signal generation that aims to realistically reproduce doppler shifts.07_wideband_detect.ipynbshort-time Fourier transform-based wideband energy detection.07a_wideband_detect_simulation.ipynbsimulation for wideband energy detection.07b_wideband_detect_doppler.ipynbwideband detection of doppler signal.08_edge_detect.ipynbspectrum edge detection using wavelet transforms.09_variable_band_detect.ipynbvariable band wideband energy detection using edge detection.09a_variable_band_detect_doppler.ipynbvariable band wideband energy detection of doppler signal.10_noise_estimation_simulation.ipynbenergy detection using noise estimation.11_eigenvalue_detector.ipynbeigenvalue detector based on covariance matrix.12_eigenvalue_detector_simulation.ipynbsimulation of eigenvalue detector.13_eigenvalue_detector_filter.ipynbeigenvalue detector with bandpass filter.14_eigenvalue_detector_whitening.ipynbeigenvalue detector with bandpass filter using noise whitening.15_eigenvalue_simulation_whitening.ipynbsimulation of eigenvalue detector with bandpass filter and noise whitening.16_eigenvalue_noise_estimation.ipynbnoise power estimation using covariance matrix eigenvalues.17_eigenvalue_noise_estimation_simulation.ipynbsimulation of wideband energy detection using eigenvalue noise power estimation.18_noise_estimation_comparison.ipynbcomparison simulation of noise estimation techniques.
- Upload first version to gitlab
- Notebook documentation in readme
- Upload papers and create basic paper index that helps to connect paper and python implementation
- Documentation for every function using sphinx
- Upload specsens to PyPi
- Time space plotting functions. (
time_plot.py) - Implement sigmoid detection output
- Cleanup variable band spectrum sensing
- Add pfa and pd eigenvalue stats
- Create eigenvalue simulation with filter and whitening matrix
- Combine eigenvalue detection and noise estimation based energy detection, use energy detection as heuristic and binary search pattern to find noise only band to use for noise estimation
- Use small eigenvalues for noise estimation
Fabian Peddinghaus peddinghaus@tu-berlin.de