Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5b86798
gnuradio 3.8 port
antoniprzybylik Apr 9, 2020
10495aa
fixed error in multi_rtl_source.block.yml
antoniprzybylik Apr 10, 2020
08c0792
removed some old files
antoniprzybylik Apr 10, 2020
81e2363
fixed some errors
antoniprzybylik Apr 10, 2020
743213b
updated README.md
antoniprzybylik Apr 10, 2020
4c161ce
updated README.md
antoniprzybylik Apr 10, 2020
da98dbf
updated README.md
antoniprzybylik Apr 10, 2020
10ad0b4
updated README.md
antoniprzybylik Apr 10, 2020
86505df
Update README.md
antoniprzybylik Apr 10, 2020
75f4437
Update README.md
antoniprzybylik Apr 10, 2020
dc3aa8e
Update README.md
antoniprzybylik Apr 10, 2020
ab57c66
Update README.md
antoniprzybylik Apr 10, 2020
42f4846
Update README.md
antoniprzybylik Apr 10, 2020
aac289d
Update README.md
antoniprzybylik Apr 10, 2020
ace45db
fixed some bugs in grc/gen_multi_rtl_block.py
antoniprzybylik Apr 24, 2020
84de0ec
Merge branch 'master' of github.com:antoniprzybylik/multi-rtl
antoniprzybylik Apr 24, 2020
734f5bb
fixed some errors in grc/gen_multi_rtl_block.py
antoniprzybylik Apr 24, 2020
759395f
useful commit message
antoniprzybylik Apr 24, 2020
af4b1cf
update README.md
antoniprzybylik Apr 24, 2020
df8866f
python 3.8 porting
antoniprzybylik Apr 25, 2020
f1354d0
some bug fixes
antoniprzybylik Apr 25, 2020
0b046b3
some bug fixes
antoniprzybylik Apr 25, 2020
1c9cbee
updated examples
antoniprzybylik Apr 25, 2020
fdf452c
updated README.md
antoniprzybylik Apr 25, 2020
45d3c8f
Update CMakeLists.txt
antoniprzybylik Jan 12, 2022
949f22a
Fixed this bug:
antoniprzybylik Jan 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
########################################################################
# Project setup
########################################################################
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.8)
project(multi_rtl CXX C)
enable_testing()

Expand Down Expand Up @@ -56,8 +56,9 @@ set(Boost_ADDITIONAL_VERSIONS
"1.55.0" "1.55" "1.56.0" "1.56" "1.57.0" "1.57" "1.58.0" "1.58" "1.59.0" "1.59"
"1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64"
"1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69"
"1.70.0" "1.70" "1.71.0" "1.71" "1.72.0" "1.72"
)
find_package(Boost "1.35" COMPONENTS filesystem system)
find_package(Boost "1.35" COMPONENTS filesystem system thread program_options regex)

if(NOT Boost_FOUND)
message(FATAL_ERROR "Boost required to compile multi_rtl")
Expand Down Expand Up @@ -107,14 +108,16 @@ endif(APPLE)
# components required to the list of GR_REQUIRED_COMPONENTS (in all
# caps such as FILTER or FFT) and change the version to the minimum
# API compatible version required.
set(GR_REQUIRED_COMPONENTS RUNTIME)
find_package(Gnuradio)

find_package(Gnuradio "3.8" REQUIRED)

find_package(CppUnit)
find_package(Doxygen)

if(NOT GNURADIO_RUNTIME_FOUND)
message(FATAL_ERROR "GnuRadio Runtime required to compile gr-gsm")
if(NOT Gnuradio_FOUND)
message(FATAL_ERROR "Gnuradio required to compile gr-gsm")
endif()

if(NOT CPPUNIT_FOUND)
message(FATAL_ERROR "CppUnit required to compile multi_rtl")
endif()
Expand Down
61 changes: 49 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Multi-RTL
==================
`Multi-RTL` is a GNU Radio block that transforms cheap multiple `RTL-SDR` receivers into multi-channel receiver.
`Multi-RTL` is a GNU Radio block that transforms cheap multiple `RTL-SDR` receivers into multi-channel receiver.

`Multi-RTL` is the first software solution that enables synchronous reception with each channel based on a `RTL-SDR` receiver tuned to a different central frequency. The synchronization is done automatically and in software - without the need for any additional electronical hardware.

Expand All @@ -16,13 +16,46 @@ https://groups.google.com/forum/#!forum/multi-rtl/join

Installation
==================
To install `Multi-RTL` installation of gnuradio-dev, gr-osmosdr and python-scipy is required. Tools typically used for building `GNU Radio` - cmake, swig and g++ - are also needed.
To install `Multi-RTL` installation of gnuradio-dev, gr-osmosdr, python-matplotlib and python-scipy is required. Tools typically used for building `GNU Radio` - cmake, swig and g++ - are also needed.

* ### **Note that `gr-osmosdr` also requires `libosmo-dsp` and `gr-iqbal`**

**Debian based systems**

On Debian based systems to install programs and libraries required by `gr-osmosdr` first install `libosmo-dsp` manually from source and then `gr-iqbal` using following command:
```sh
sudo apt-get install gr-iqbal
```

**Arch based systems**

On Arch based systems to install programs and libraries required by `gr-osmosdr` first install `libosmo-dsp` from AUR, manually or using yaourt:
```sh
yaourt -S libosmo-dsp
```
... then install `gr-iqbal` using following command:
```sh
pacman -S gnuradio-iqbal
```

* ### **Install dependencies**

**Debian based systems**

On Debian based systems to install programs required by `Multi-RTL` use following command:
```sh
sudo apt-get install gr-osmosdr gnuradio-dev cmake swig build-essential doxygen python-scipy
sudo apt-get install gr-osmosdr gnuradio-dev cmake swig build-essential doxygen python-matplotlib python-scipy
```

**Arch based systems**

On Arch based systems to install programs required by `Multi-RTL` use following command:
```sh
pacman -S gnuradio-osmosdr cmake swig doxygen python-matplotlib python-scipy
```

* ### **Multi-RTL installation**

To install `Multi-RTL` first download its source code:
```sh
git clone https://github.com/ptrkrysik/multi-rtl.git
Expand All @@ -37,6 +70,8 @@ sudo make install
sudo ldconfig
```

* ### **Alternative way**

You can also use [PyBombs](https://github.com/gnuradio/pybombs) to install `Multi-RTL`. Installation of PyBombs itself is described in [here](https://github.com/gnuradio/pybombs#installation). After installing it execute:
```sh
pybombs install multi-rtl
Expand Down Expand Up @@ -64,8 +99,8 @@ If you connect dongles one by one (so only one is connected at a time) `device_i

Usage
==================
Multi-RTL is a GNU Radio block. The most natural way to use it is to build a flowgraph in `gnuradio-companion` (the GNU Radio's GUI tool).
`Multi-RTL` viewed in `gnuradio-companion` has options grouped into two cathegories:
Multi-RTL is a GNU Radio block. The most natural way to use it is to build a flowgraph in `gnuradio-companion` (the GNU Radio's GUI tool).
`Multi-RTL` viewed in `gnuradio-companion` has options grouped into two categories:
* `General` options - that are used during normal operation of the receiver:
* `Freq. Corr. (ppm)` - reference clock offset frequency correction in points per milion (ppm),
* `Num Channels` - number of channels of the reciver,
Expand All @@ -77,7 +112,7 @@ Multi-RTL is a GNU Radio block. The most natural way to use it is to build a flo
* `Sync Frequency (Hz)` - carrier frequency of the signal that is used for synchronization,
* `Chn: Sync RF Gain (dB)` - gain of the `n`-th channel during synchronization in dB.

The `General` options are similar to [`osmocom source`](http://sdr.osmocom.org/trac/wiki/GrOsmoSDR) block. The reason is that `Multi-RTL` is hierarhical block that under the hood uses as many `osmocom source` blocks as there are channels in the receiver and passes some of the options directly to them. In comparison with `osmocom source` `Multi-RTL` doesn't include some options that don't apply to RTL-SDR receivers, like: turning on/off automatic dc offset removal, regulation of baseband gain, automatic IQ imbalance correction.
The `General` options are similar to [`osmocom source`](http://sdr.osmocom.org/trac/wiki/GrOsmoSDR) block. The reason is that `Multi-RTL` is hierarhical block that under the hood uses as many `osmocom source` blocks as there are channels in the receiver and passes some of the options directly to them. In comparison with `osmocom source` `Multi-RTL` doesn't include some options that don't apply to RTL-SDR receivers, like: turning on/off automatic dc offset removal, regulation of baseband gain, automatic IQ imbalance correction.

Synchronization is performend when `Multi-RTL` is started and when user manually resynchronize the receiver's channels by calling `synchronize` function. During this process receiver's channels are configured according to `Synchronization` options. The `Sync Frequency (Hz)` should point to a carrier frequency of a signal that has good auto-correlation properties (good enough for particular application), with high and narrow peak in the central part. These properties have direct impact on accuracy of the synchronization. Examples of signals that can be used for synchronization are:
* GSM signal (i.e. GSM900 - 925-960 MHz)
Expand All @@ -87,16 +122,16 @@ Synchronization is performend when `Multi-RTL` is started and when user manually
* FM radio (87.5 to 108.0MHz) `caution:` auto-correlation function of FM radio varry a lot in time as it is dependend on the signal that is transmitted - noisy music results with signal that has much better auto-correlation than speech or silence.

In `Multi-RTL`'s repository there is an example of `gnuradio-companion` application ([multi-rtl/examples/mutlirtl_rx_to_cfile_2chan.grc](examples/mutlirtl_rx_to_cfile_2chan.grc)) that uses two channel `Multi-RTL` receiver and stores the captured samples to files. The flowgraph of the application is presented below:
![Sample two channel application using Multi-RTL](https://raw.githubusercontent.com/ptrkrysik/ptrkrysik.github.io/master/images/multi_rx_to_cfile_2chan.png)
![Sample two channel application using Multi-RTL](https://user-images.githubusercontent.com/52050799/80285280-43369380-8713-11ea-9f41-71ea1cac5aad.png)

The result of transformation to Python file with use of `gnuradio-companion` is stored here [multi-rtl/examples/mutlirtl_rx_to_cfile_2chan.py](examples/mutlirtl_rx_to_cfile_2chan.py). It can be used from commandline and in shell scripts. To see it's commandline parameters go into `multi-rtl/examples` directory and call:
```sh
multi-rtl/examples/mutlirtl_rx_to_cfile_2chan.py --help
```
```

One of the examples of use of the `mutlirtl_rx_to_cfile_2chan.py` is to record downlink and uplink of a given GSM `C0` (BCCH) carrier. It is assumed that id strings of the dongles are 00000001 (`ch0-id-string`) and 00000002 (`ch1-id-string`). Let's also assume that the downlink of the C0 carrier frequency is at 939MHz (`freq-ch0`). Uplink of this radio channel is at 894MHz (`freq-ch1`) as uplink-downlink separation for GSM900 is 45MHz. For synchronization we will use downlink of the `C0` channel (`sync-freq`), because it provides good enough accuracy for this application. As sampling frequency (`samp-rate`) `4*GSM_symbol_rate=4*1625000/6=1083333.3333(...)` will be used. Gains will be set to `30 dB` (`gain-ch0`, `sync-gain-ch0`, `sync-gain-ch1`) but the channel's 1 gain will switch to `10dB` after synchronization (`gain-ch1`). Samples of the signals will be stored to `downlink.cfile` (`fname-ch0`) and `uplink.cfile` (`fname-ch1`). The complete command with all options have the following form:
```sh
./mutlirtl_rx_to_cfile_2chan.py --ch0-id-string="00000001" --ch1-id-string="00000002" \
./mutlirtl_rx_to_cfile_2chan.py --ch0-id-string="00000001" --ch1-id-string="00000002" \
--samp-rate 1083333.3333333333 \
--sync-freq 939e6 \
--sync-gain-ch0 30 --sync-gain-ch1 30 \
Expand All @@ -113,8 +148,10 @@ TODO
====
Adding automatic resynchronization on overflows. To implement this feature information on overflows - as tags attached to stream - is required from the `osmocom source`.

Author
Authors
==================
Piotr Krysik <ptrkrysik@gmail.com>
Piotr Krysik <ptrkrysik@gmail.com> (main author)

Antoni Przybylik <antoni.przybylik@wp.pl> (GNU Radio 3.8 porting)

If you use the ideas from `Multi-RTL` to implement a similar multi-channel receiver yourself, please add a reference to `Multi-RTL` and the `Multi-RTL`'s author.
If you use the ideas from `Multi-RTL` to implement a similar multi-channel receiver yourself, please add a reference to `Multi-RTL` and the `Multi-RTL`'s authors.
138 changes: 0 additions & 138 deletions cmake/Modules/CMakeParseArgumentsCopy.cmake

This file was deleted.

36 changes: 0 additions & 36 deletions cmake/Modules/FindGnuradioRuntime.cmake

This file was deleted.

18 changes: 3 additions & 15 deletions cmake/Modules/GrPython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ if(PYTHON_EXECUTABLE)
else(PYTHON_EXECUTABLE)

#use the built-in find script
find_package(PythonInterp 2)
find_package(PythonInterp 3)

#and if that fails use the find program routine
if(NOT PYTHONINTERP_FOUND)
find_program(PYTHON_EXECUTABLE NAMES python python2 python2.7 python2.6 python2.5)
find_program(PYTHON_EXECUTABLE NAMES python python3 python3.8 python3.7)
if(PYTHON_EXECUTABLE)
set(PYTHONINTERP_FOUND TRUE)
endif(PYTHON_EXECUTABLE)
Expand All @@ -58,18 +58,6 @@ endif(CMAKE_CROSSCOMPILING)
set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter")
set(QA_PYTHON_EXECUTABLE ${QA_PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter for QA tests")

#make sure we can use -B with python (introduced in 2.6)
if(PYTHON_EXECUTABLE)
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -B -c ""
OUTPUT_QUIET ERROR_QUIET
RESULT_VARIABLE PYTHON_HAS_DASH_B_RESULT
)
if(PYTHON_HAS_DASH_B_RESULT EQUAL 0)
set(PYTHON_DASH_B "-B")
endif()
endif(PYTHON_EXECUTABLE)

########################################################################
# Check for the existence of a python module:
# - desc a string description of the check
Expand Down Expand Up @@ -106,7 +94,7 @@ endmacro(GR_PYTHON_CHECK_MODULE)
if(NOT DEFINED GR_PYTHON_DIR)
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "
from distutils import sysconfig
print sysconfig.get_python_lib(plat_specific=True, prefix='')
print( sysconfig.get_python_lib(plat_specific=True, prefix='') )
" OUTPUT_VARIABLE GR_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
Expand Down
4 changes: 2 additions & 2 deletions cmake/Modules/GrSwig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ macro(GR_SWIG_MAKE name)
endif()

#append additional include directories
find_package(PythonLibs 2)
find_package(PythonLibs 3)
list(APPEND GR_SWIG_INCLUDE_DIRS ${PYTHON_INCLUDE_PATH}) #deprecated name (now dirs)
list(APPEND GR_SWIG_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})

Expand Down Expand Up @@ -160,7 +160,7 @@ macro(GR_SWIG_MAKE name)
list(APPEND SWIG_MODULE_${name}_EXTRA_DEPS ${tag_file})

#setup the swig flags with flags and include directories
set(CMAKE_SWIG_FLAGS -fvirtual -modern -keyword -w511 -module ${name} ${GR_SWIG_FLAGS})
set(CMAKE_SWIG_FLAGS -fvirtual -keyword -w511 -module ${name} ${GR_SWIG_FLAGS})
foreach(dir ${GR_SWIG_INCLUDE_DIRS})
list(APPEND CMAKE_SWIG_FLAGS "-I${dir}")
endforeach(dir)
Expand Down
Loading