This repository contains the simulation codes for our paper:
Source Coding Based Millimeter-Wave Channel Estimation with Deep Learning Based Decoding
If you find this code helpful or used it in your work, please cite this work:
@ARTICLE{sourceCodingBasedChEstShabara,
author={Shabara, Yahia and Ekici, Eylem and Emre Koksal, C.},
journal={IEEE Transactions on Communications},
title={Source Coding Based Millimeter-Wave Channel Estimation with Deep Learning Based Decoding},
year={2021},
doi={10.1109/TCOMM.2021.3072999}}
This software simulates the process of channel estimation in sparse large-MIMO radio environments using a Binary Coding measurement Framework.
Classical channel estimation solutions would necessitate a large number of measurements for Large-MIMO systems. This drives the estimation overhead to unacceptable and impractical high levels. Hence, our goal is to estimate/discover the channel using just a few measurements. Sparse MIMO channels only contain few channel paths. This piece of information gives us the ability to accurately estimate the channel, by discovering all of its paths, using fewer measurements compared to the channel dimensions.
Channel estimation is divided into two sub-problems.
- The first sub-problem is Measuerment Design, which we also call Channel Encoding. We solve this problem with the help of binary linear source codes.
- The second sub-problem is Measuerment Interpretation, which we also call Measurement Decoding. Due to the complexity of joint measurement processing, we devise a technique which allows us to break down the decoding problem into several smaller sub-problems that can be run in parallel. Each of the sub-problems can be solved using a wide range of techniques that can be selected from the realm of sparse recovery solutions. We, however, propose two different solutions:
1- The Search decoding method. 2- A machine learning based DNN (Deep Neural Network) decoding method.
The search deocder attempts to optimally solve the sub-problems. However, compared to DNN decoding, the search decoder is significantly more computationally complex. Precisely, its complexity is$O({n \choose k})$ , where$n$ is the number of anetnnas (at TX or RX) and$k$ is the number of paths. Hence, it only makes sense to use the search decoding when the channel dimensions is relatively small, or when the number of paths is very small. The DNN decoding, however, is computationally tractable, yet not optimal. Most importantly, the DNN decoder's performance is very close to the optimal search decoder, and its complexity, which depends on the size of the used model, justifies this small sacrifice in perfromance.
Our codes are mainly written in MATLAB, but we also use python for DNN decoding. If you choose to use the search decoder, there is no need to worry about the python codes or the python environment. If you choose to use the DNN decoder, you will need to make sure the python environment is correctly set up, with all the required packages/libraries installed. You also need to make sure that MATLAB knows how to use (or activate) that python environment.
To be able to use the DNN based decoder, you will need to set up a python environment with all the necessary packages installed. We use tensorflow and keras to train and use the DNN models. The python functions will be automatically called from MATLAB using system calls, i.e., system().
My favorite way of setting up the python environment is by using Miniconda, or Anaconda. You can either use my method, or you can use your any other method your prefer. To use Anaconda, follow these steps:
1- Install 'Anaconda' and open the 'Anaconda command prompt'
2- Create a new enivornemnt using:
conda create --name <env-name> python=3.8
3- Install the following packages to the python environment created in step 2 above:
conda install --name <env-name> tensorflowor if you have a GPU-enabled machine, then useconda install --name <env-name> tensorflow-gpuconda install --name <env-name> kerasconda install --name <env-name> matplotlibconda install --name <env-name> mat4pyor usepip install mat4py
For MATLAB to be able to run python code, you need to correctly set the python you need to set the python executable variable, i.e., pythonX, in src/main.m.
The easiest way for this to work is to setup a python environment and make it your system's default by correctly setting up the environment variables. Then, set pythonX = 'python'.
If your prefer to use a virtual environment, this gets a little bit tricky. In earlier Miniconda versions, I was able to set pythonX to the python.exe executable file, which can be found under <anaconda-files>/envs/<env-name>/python.exe, and that was enough.
Recently, I found issues with this method, which requires an explicit environment activation call. To solve this, I now also provide this activation call inside the MATLAB system call which runs any python script. However, I was lazy and hard-coded my virtual environment name, which is "dnn". Until I have a proper fix for this problem, you can either name your virtual environemnt "dnn", or change the code to accept your new environment name.
I will try to fix this ASAP. If you still have problems running python codes related to this issue, or run into other problems, please let me know.
The DNN models we trained and used in our paper are made available online so researchers can easily reproduce our results.
- For single-path channels (
$k\leq1$ path) with$n_r = 15$ receive antennas and$n_t = 31$ transmit antennas, the models can be found here. - For multi-path channels (
$k\leq3$ paths) with$n_r = 23$ receive antennas and$n_t = 23$ transmit antennas, the models can be found here. - For multi-path channels (
$k\leq3$ paths) with$n_r = 15$ receive antennas and$n_t = 32$ transmit antennas, the models can be found here.
To train your own DNN models, you need to run the MATLAB function trainDNN() which is defined in trainDNN.m and can be found under /src/trainingDNNs/. This function takes as arguments the number of transmit and receive antennas, the number of channel paths, the SNR (in dB), the quantization resolution (in bits), the measurement Error Correction flag (set this to 0 if you do not know what it does) and finally, a path to the python executable pythonX.
This function will create training and testing data sets, if they don't exist and then will start the model training. The trained model will be saved under /dnnModels/ in appropriate sub-folders for the channel parameters and the ADC quantization resolution.
The main file you need to run is main.m, which is a MATLAB script that sets up the simulation parameters and calls the relevant simulation functions.
In main.m, you need to set:
- Channel Parameters:
- Number of TX antennas
n_t - Number of RX antennas
n_r - Number of paths
n_paths
- Number of TX antennas
- Simulation Flags:
-
add_noise- set to
1to add AWGN noise - set to
0otherwise
- set to
-
perfect_ADC- set to
1to assume no quantization errors (perfect ADC). - set to
0to allow quantization noise. ADC quantization resolution will be set separately below.
- set to
-
Error_corris a flag that indicates whether you want to add measurements to further increase reliability of the measurement process. This process is described in this paper. A brief explanation is provided below- set to
1to allow the error correction capability. - set to
0to diable the error correction capability.
- set to
-
pathOnGrid- Always set this to
1. This is a flag that determines whether channel paths lies on the angular grid defined by the DFT matrices$\boldsymbol{U_t}$ and$\boldsymbol{U_r}$ , or could lie anywhere. - To be able to safely set this to
0, i.e., allow paths to exist anywhere in the angular space, you would need to carefully design the beamforming vectors$\boldsymbol{w_i}$ and$\boldsymbol{f_j}$ so that beam-overlap is eliminated, and side-lobes are suppressed. This is one possible extension of this work.
- Always set this to
-
- Simulation Parameters:
-
nRunsThe number of simulation runs (channel instances to be estimated) -
quantizationBitsThe ADC resolution in bits. We use mid-tread ADCs with a number of quantization levels$=2^b+1$ , where$b \triangleq$ quantizationBits. -
SNR_dBAn array of SNR values in dB at which the simulation will be repeated. A separate file containing the performance metrics values is created and stored for each SNR value. -
decodingMethod- Set
decodingMethod = "search"to use the search decoder - Set
decodingMethod = "dnn"to use the DNN decoder
- Set
-
noiseDefenseOnly relevent for DNN decoder.- Set to
1to use specially trained DNN models for each SNR and ADC resolution value. - Set
0to use one DNN model, trained without AWGN noise, for all SNR values.
- Set to
-
minPathGainThis is the minimum value for a path gain for a path to be considered as a "strong" channel path. -
pythonXThis is the path to the python executable file (python.exe) of your python (virtual) environment.
-
As explained in our paper on Source Coding Coding Based Measurement Design, the measurements in a SIMO channel are designed to mimic the equation
To further increase the measurement reliability, a technique based on Linear Block Codes is described in our earlier paper is propsed. Essentially, we can envisage
Suppose that an appropriate LBC for this problem has a generator matrix
Finally, instead of designing the measurements