aff3ct / dvbs2

DVB-S2 SDR Transceiver powerded by AFF3CT & StreamPU.
MIT License
24 stars 9 forks source link

DVB-S2 SDR Transceiver

Machines installation

sudo apt install git cmake hwloc libhwloc-dev

UHD Installation

UHD is the software library that is needed for controlling the USRPs. Follow the instructions in "Install Linux" part at Ettus N310 Building.

When asked to checkout a specific tag for UHD, use the following: v3.14.1.1-rc1 When asked to checkout a specific tag for GNU radio, use the following: 3.7.13.4

To update the USRP's FPGA images to switch between 1Gb / 10Gb / Dual 10Gb Ethernet, follow the instructions at Ettus N310 Getting Started, "Updating the FPGA Image".

Finally, add the following in ~/.bashrc or /etc/profile:

export UHD_LOG_FILE="./usrp.log"

Ethernet configuration

Connect the USRP on a 10Gb ports. Then configure the IP address and MTU.

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto eth2
iface eth2 inet static
    address 192.168.20.1/24
    mtu 8000
network:
    ethernets:
        enp0s31f6:
            addresses: [192.168.222.59/24]
            gateway4: 192.168.222.254
            nameservers:
              addresses: [192.168.222.8]
        enp79s0f0:
            addresses: [192.168.20.1/24]
            gateway4: 0.0.0.0
            mtu: 8000
        enp79s0f1:
            addresses: [192.168.10.1/24]
            gateway4: 0.0.0.0
            mtu: 8000
    version: 2

Benchmark

To validate the installation, you may run the following benchmark:

/usr/local/lib/uhd/examples/benchmark_rate  \
  --args "type=n3xx,addr=192.168.20.2,master_clock_rate=125e6" \
  --duration 60 \
  --channels "0" \
  --rx_rate 31.25e6 \
  --rx_subdev "A:0" \
  --tx_rate 31.25e6 \
  --tx_subdev "A:0"

Compile & Install

Get the AFF3CT library:

git submodule update --init --recursive

Linux/MacOS/MinGW

Generate the Makefile and compile the DVB-S2 project:

mkdir build
cd build
cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Wall -funroll-loops -march=native" -DSPU_LINK_HWLOC=ON
make -j20

If you don't want to compile the code with USRPs you can add the -DDVBS2_LINK_UHD=OFF option:

cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Wall -funroll-loops -march=native" -DSPU_LINK_HWLOC=ON -DDVBS2_LINK_UHD=OFF

Binaries

The source code of this project is in the src/ directory:

The compiled binaries are:

Run

Simulation

Some refs with according command line instructions can be found in the refs/ directory for build/bin/dvbs2_tx_rx and build/bin/dvbs2_tx_rx_bb.

Testing TX and RX Separately

Run the transmitter (TX) to generate symbols (= IQs) without noise (here the TX stops after 10 seconds, see the --tx-time-limit 10000 option):

./bin/dvbs2_tx --sim-stats --rad-type USER_BIN --rad-tx-file-path out_tx.bin -F 8 --src-type USER --src-path ../conf/src/K_14232.src --mod-cod QPSK-S_8/9 --tx-time-limit 10000

Add AWGN noise on the previously emitted IQs (-m controls the noise level Eb/N0 in dB):

./bin/dvbs2_ch --sim-stats --rad-type USER_BIN --rad-rx-file-path out_tx.bin --rad-tx-file-path out_tx_noisy.bin --rad-rx-no-loop -F 8 --mod-cod QPSK-S_8/9 -m 4.0

Run the receiver (RX) on the noisy IQs (without waiting and learning phases, see the --no-wl-phases option):

./bin/dvbs2_rx --sim-stats --src-type USER --src-path ../conf/src/K_14232.src --rad-type USER_BIN --rad-rx-file-path out_tx_noisy.bin -F 8 --mod-cod QPSK-S_8/9 --dec-implem NMS --dec-ite 10 --dec-simd INTER --snk-path /dev/null --rad-rx-no-loop --no-wl-phases

Note: In the previous command lines, the -F 8 option controls the inter-frame level (= the number of frames processed during each task execution). The latest will maximize the throughput if -F is a multiple of the number of 32-bit floating-point elements that can be contained in a SIMD register (for instance: in SSE/NEON optimal -F is equal to 4, in AVX optimal -F is equal to 8, and in AVX-512 optimal -F is equal to 16). Be aware that increasing -F will have a negative impact on the latency and on the memory footprint of the system (this is linear with the -F value).

Radio

BER / FER

Here are example command lines for RX and TX, considering QPSK-S_8/9:

./bin/dvbs2_rx --sim-stats --rad-threaded --rad-rx-subdev-spec "A:0" --rad-rx-rate 30e6 --rad-rx-freq 2360e6 --rad-rx-gain 20 -F 16 --src-type USER --src-path ../conf/src/K_14232.src --mod-cod QPSK-S_8/9 --dec-implem NMS --dec-ite 10 --dec-simd INTER
./bin/dvbs2_tx --sim-stats --rad-threaded --rad-tx-subdev-spec "A:0" --rad-tx-rate 30e6 --rad-tx-freq 2360e6 --rad-tx-gain 30 -F  8 --src-type USER --src-path ../conf/src/K_14232.src --mod-cod QPSK-S_8/9

Video Streaming

An convenient setup is to use a first computer for TX, a second computer for RX, and a third for displaying the video.

./bin/dvbs2_tx --sim-stats --rad-threaded --rad-tx-subdev-spec "A:0" --rad-tx-rate 30e6 --rad-tx-freq 2360e6 --rad-tx-gain 30 -F  8 --src-type USER_BIN --src-path /path/to/input/ts/video.ts --mod-cod QPSK-S_8/9
./bin/dvbs2_rx --sim-stats --rad-threaded --rad-rx-subdev-spec "A:0" --rad-rx-rate 30e6 --rad-rx-freq 2360e6 --rad-rx-gain 20 -F 16 --mod-cod QPSK-S_8/9 --dec-implem NMS --dec-ite 10 --dec-simd INTER --snk-path output_stream_fifo.ts
 ssh <rx ip address>  "cat /path/to/fifo/output_stream_fifo.ts" | cvlc -