Skip to content

Commit

Permalink
Merge pull request #1042 from anarkiwi/desamp
Browse files Browse the repository at this point in the history
Remove samples2raw (not as useful now that we have SigMF and augment)…
  • Loading branch information
anarkiwi authored Dec 15, 2023
2 parents 608792a + 2a7abd0 commit d340b8e
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 315 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,6 @@ jobs:
poetry install --no-interaction && \
poetry install --no-interaction -C utils/mavlink-api && \
sudo dpkg -r --force-depends python3-numpy
- name: test gamutrf-samples2raw
env:
PYTHONPATH: /usr/local/lib/python3.10/dist-packages:/usr/lib/python3/dist-packages
run: |
gamutrf-samples2raw --help && \
dd if=/dev/zero of=/tmp/gamutrf_recording_ettus__gain40_1_1Hz_1000000sps.s16 bs=4 count=1000000 && \
gamutrf-samples2raw /tmp/gamutrf_recording_ettus__gain40_1_1Hz_1000000sps.s16 --outfmt=float && \
dd if=/dev/zero of=/tmp/floats bs=8 count=1000000 && \
diff /tmp/gamutrf_recording_ettus__gain40_1_1Hz_1000000sps.raw /tmp/floats
- name: Code Quality - Black
run: |
poetry run black gamutrf --check
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ jobs:
docker build -f Dockerfile . -t iqtlabs/gamutrf:latest
docker build -f docker/Dockerfile.torchsig . -t iqtlabs/gamutrf-torchsig:latest
docker run -t iqtlabs/gamutrf:latest gamutrf-compress_dirs --help
docker run -t iqtlabs/gamutrf:latest gamutrf-freqxlator --help
docker run -t iqtlabs/gamutrf:latest gamutrf-offline --help
docker run -t iqtlabs/gamutrf:latest gamutrf-samples2raw --help
docker run -t iqtlabs/gamutrf:latest gamutrf-scan --help
docker run -t iqtlabs/gamutrf:latest gamutrf-sigfinder --help
docker run -t iqtlabs/gamutrf:latest gamutrf-waterfall --help
Expand Down
4 changes: 2 additions & 2 deletions bin/gamutrf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Options:
-h, help print this help
-i, install install GamutRF repo, optionally supply a version, tag, branch, or tarball
-l, logs tail GamutRF logs
-r, run specify GamutRF tool to run (and any additional args for the tools), options include: 'worker', 'freqxlator', 'samples2raw', 'scan', 'sigfinder', 'specgram'
-r, run specify GamutRF tool to run (and any additional args for the tools), options include: 'worker', 'scan', 'sigfinder', 'specgram'
-R, restart specify 'orchestrator' or 'worker' to restart
-s, start specify 'orchestrator' or 'worker' to start
-S, stop specify 'orchestrator' or 'worker' to stop
Expand Down Expand Up @@ -136,7 +136,7 @@ function check_args()
;;
-r|run)
if [ -z "$2" ]; then
echo "Specify 'worker', 'freqxlator', 'samples2raw', 'scan', 'sigfinder', or 'specgram' to run"
echo "Specify 'worker', 'scan', 'sigfinder', or 'specgram' to run"
exit
fi
docker run -it -v "$VOLUME_DIR":/data iqtlabs/gamutrf:"$VERS" gamutrf-"$2" "${@:3}"
Expand Down
4 changes: 2 additions & 2 deletions docs/2-SYSTEM_OVERVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ The generic route for data during operation starts with the gamutrf-scan contain

Sigfinder can task the api container which is running on a worker node to investigate a signal. The worker tunes to listen to the tasked frequency and either calculates the associated RSSI or makes a recording of the signal. In RSSI mode, the worker interrogates the gpsd service and compass container running on the orchestrator to get position and heading, then publishes location, heading, and RSSI to the MQTT broker to be consumed by Birdseye. Birdseye then uses this information to geolocate the target signal.

Orchestrator.yml and worker.yml are the main control points for docker-compose to start the GamutRF system. These scripts spin up the iqtlabs/gamutrf Docker container and run the appropriate gamutrf-<cmd> python command. These files should be modified for the specific orchestrator and worker combination. Some common parameters for the gamut-scan and gamutrf-sigfinder are in the GamutRF [operation guide](./4-OPERATION.md).md. The repository also provides a few tools such as samples2raw, freqxlator, freespacer, compress_dirs, etc that can be used for post processing of data. These tools are included in the GamutRF python module so it is suggested to use them via iqtlabs/gamutrf docker container.
Orchestrator.yml and worker.yml are the main control points for docker-compose to start the GamutRF system. These scripts spin up the iqtlabs/gamutrf Docker container and run the appropriate gamutrf-<cmd> python command. These files should be modified for the specific orchestrator and worker combination. Some common parameters for the gamut-scan and gamutrf-sigfinder are in the GamutRF [operation guide](./4-OPERATION.md).md. The repository also provides a few tools such as freespacer, compress_dirs, etc that can be used for post processing of data. These tools are included in the GamutRF python module so it is suggested to use them via iqtlabs/gamutrf docker container.

## Graphical User Interface

Expand Down Expand Up @@ -122,4 +122,4 @@ Initially we used the received signal strength along with simple propagation mod

We take a moving average of this value to smooth it out as it can jump around quite a bit and we are most interested in the slower moving trend of the value. This helps to estimate distance from the target. Figure 7 below shows the portion of the GNU Radio flow graph that estimates the RSSI value.

Birdseye (RF geolocalization tool) is also located on the IQT Labs Github at https://github.com/iqtlabs/birdseye. The repository contains instructions for using the Birdseye tool as well as different methodologies for ML-enabled localization. Birdseye can be used in conjunction with GamutRF or as a standalone tool. When using with the GamutRF system, the instructions for integration are in the Build.md file which detail how to run Birdseye as a systemd service.
Birdseye (RF geolocalization tool) is also located on the IQT Labs Github at https://github.com/iqtlabs/birdseye. The repository contains instructions for using the Birdseye tool as well as different methodologies for ML-enabled localization. Birdseye can be used in conjunction with GamutRF or as a standalone tool. When using with the GamutRF system, the instructions for integration are in the Build.md file which detail how to run Birdseye as a systemd service.
20 changes: 0 additions & 20 deletions docs/4-OPERATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,6 @@ gamutRF provides a tool to convert a recording or directory of recordings into a

Use the ```--help``` option to change how the spectogram is generated (for example, to change the sample rate).

### Translating recordings to "gnuradio" format

Most SDR tools by convention take an uncompressed raw binary file as input, of [gnuradio type complex](https://blog.sdr.hu/grblocks/types.html). The user must explicitly specify to most SDR tools what sample rate the file was made at to correctly process it. gamutRF provides a tool that converts a gamutRF I/Q recording (which may be compressed) to an uncompressed binary file. For example:

```
docker run -v /tmp:/tmp -ti iqtlabs/gamutrf gamutrf-samples2raw /tmp/gamutrf_recording_ettus_directional_gain70_1234_100000000Hz_20971520sps.s16.zst
```

### Reviewing a recording interactively in gqrx

[gqrx](https://gqrx.dk/) is a multiplatform open source tool that allows some basic SDR operations like visualizing or audio demodulating an I/Q sample recording (see the [github releases page](https://github.com/gqrx-sdr/gqrx/releases), for a MacOS .dmg file). To use gqrx with a gamutRF recording, first translate the recording to gnuradio format (see above). Then open gqrx.
Expand All @@ -128,22 +120,10 @@ docker run -v /tmp:/tmp -ti iqtlabs/gamutrf gamutrf-samples2raw /tmp/gamutrf_rec
* Set ```Decimation``` to None.
* Finally select ```OK``` and then ```play``` from the gqrx interface to watch the recording play.

### Reducing recording sample rate

You may want to reduce the sample rate of a recording or re-center it with respect to frequency (e.g. to use another demodulator tool that doesn't support a high sample rate). gamutRF provides the ```freqxlator``` tool to do this.

* Translate your gamutRF recording to gnuradio format (see above).
* Use ```freqxlator``` to create a new recording at a lower sample rate, potentially with a different center frequency.

For example, to reduce a recording made with gamutRF's default sample rate to 1/10th the rate while adjusting the center frequency down by 1MHz, use:

```docker run -ti iqtlabs/gamutrf gamutrf-freqxlator --samp-rate 20971520 --center -1e6 --dec 10 gamutrf_recording_gain70_1234_100000000Hz_20971520sps.raw gamutrf_recording_gain70_1234_100000000Hz_2097152sps.raw```

### Demodulating AM/FM audio from a recording

gamutRF provides a tool to demodulate AM/FM audio from a recording as an example use case.

* Use the ```freqxlator``` tool to make a new recording at no more than 1Msps and has the frequency to be demodulated centered.
* Use the ```airspyfm``` tool to demodulate audio to a WAV file.

For example, to decode an FM recording which must be at the center frequency of a recording:
Expand Down
12 changes: 0 additions & 12 deletions gamutrf/__main__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""Main entrypoint for GamutRF"""
from gamutrf.compress_dirs import main as compress_dirs_main
from gamutrf.freqxlator import main as freqxlator_main
from gamutrf.offline import main as offline_main
from gamutrf.samples2raw import main as samples2raw_main
from gamutrf.scan import main as scan_main
from gamutrf.sigfinder import main as sigfinder_main
from gamutrf.specgram import main as specgram_main
Expand All @@ -15,21 +13,11 @@ def compress_dirs():
compress_dirs_main()


def freqxlator():
"""Entrypoint for freqxlator"""
freqxlator_main()


def offline():
"""Entrypoint for offline"""
offline_main()


def samples2raw():
"""Entrypoint for samples2raw"""
samples2raw_main()


def scan():
"""Entrypoint for scan"""
scan_main()
Expand Down
124 changes: 0 additions & 124 deletions gamutrf/freqxlator.py

This file was deleted.

77 changes: 0 additions & 77 deletions gamutrf/samples2raw.py

This file was deleted.

2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ pytype = "2023.12.8"

[tool.poetry.scripts]
gamutrf-compress_dirs = 'gamutrf.__main__:compress_dirs'
gamutrf-freqxlator = 'gamutrf.__main__:freqxlator'
gamutrf-offline= 'gamutrf.__main__:offline'
gamutrf-samples2raw = 'gamutrf.__main__:samples2raw'
gamutrf-scan = 'gamutrf.__main__:scan'
gamutrf-sigfinder = 'gamutrf.__main__:sigfinder'
gamutrf-specgram = 'gamutrf.__main__:specgram'
Expand Down
17 changes: 0 additions & 17 deletions tests/test_freqxlator.py

This file was deleted.

16 changes: 0 additions & 16 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import sys

from gamutrf.__main__ import worker
from gamutrf.__main__ import freqxlator
from gamutrf.__main__ import samples2raw
from gamutrf.__main__ import scan
from gamutrf.__main__ import sigfinder
from gamutrf.__main__ import specgram
Expand All @@ -19,20 +17,6 @@ def test_main_worker():
assert pytest_wrapped_e.value.code == 0


def test_main_freqxlator():
with pytest.raises(SystemExit) as pytest_wrapped_e:
freqxlator()
assert pytest_wrapped_e.type == SystemExit
assert pytest_wrapped_e.value.code == 0


def test_main_samples2raw():
with pytest.raises(SystemExit) as pytest_wrapped_e:
samples2raw()
assert pytest_wrapped_e.type == SystemExit
assert pytest_wrapped_e.value.code == 0


def test_main_scan():
with pytest.raises(SystemExit) as pytest_wrapped_e:
scan()
Expand Down
Loading

0 comments on commit d340b8e

Please sign in to comment.