• Stars
    star
    316
  • Rank 128,491 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 9 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Converting images to IQ streams that make images appear in waterfall plots.

Spectrum Painter

A tool to converts images to IQ streams that look like this when viewed in a waterfall plot.

Spectrum Example

Setup

Dependencies

The following packages are required:

Installation

Installation is not required. You can run the program from the root directory of the repository using

python3 -m spectrum_painter.img2iqstream

If you want the program to be globally executable, you can install it with pip. I recommend a developer install. From the root of the repository, this is done (for the current user) by

pip install --user -e .

Afterwards, spectrum_painter is available from everywhere.

Nix

A Nix Flake is now available. If you have a Nix system with flakes enabled, you can just run

nix shell github:/polygon/spectrum_painter

to get a shell with spectrum_painter available.

For Nix systems without flakes, default.nix and shell.nix are available as shims using flake-compat.

Usage

Here is the program help, also available using spectrum_painter --help.

Usage: spectrum_painter [OPTIONS] [SRCS]...

Options:
  -s, --samplerate INTEGER        Samplerate of the radio
  -l, --linetime FLOAT            Time for each line to show
  -o, --output FILENAME           File to write to (default: stdout)
  --format [float|bladerf|hackrf]
                                  Output format of samples
  --help                          Show this message and exit.
  • Samplerate is what you will configure in your radio later. About half of that bandwidth is actually used for the image. The edges are left free since I've seen some pretty ugly bandfilter effects sometimes.
  • Linetime is the time in seconds that each line of your images will display. Experiment a bit here, usually a good starting value is around 0.005 - 0.01.
  • Output is the file to write to. Per default this is stdout.
  • Format selects the output formatter. There is support for bladerf and hackrf radio formats as well as raw I/Q interleaved 32-bit float samples.
  • You can pass multiple images to the program which will all be converted and written to the output.

The FFT adapts to the image size. However, I've not tried what happens for very wide or narrow images. Pictures with a horizontal resolution between about 512-2048 pixels seem to work fine, though. Only the first color channel of the image is used, so images should be black and white.

HackRF Example

Convert the smiley example for the HackRF.

spectrum_painter -s 1000000 -l 0.004 -o smiley.iqhackrf --format hackrf examples/smiley.png

Then transmit using hackrf_transfer.

hackrf_transfer -t smiley.iqhackrf -f 2450000000 -b 1750000 -s 1000000 -x 20 -a 1

NOTE: I've got some reports that the above does not work with some original HackRF boards. Increasing the samplerate and bandwidth to 8 MHz seems to help in that case. If you have a rad1obadge, the lines above should work.

BladeRF Example

Convert the smiley example for the BladeRF

spectrum_painter -s 1000000 -l 0.004 -o smiley.iqblade --format bladerf examples/smiley.png

The output can be used in bladeRF-cli with bin format.

Closing

This was a fun project at this years Chaos Communication Camp. It even works with a spectrum analyzer on the awesome rad1obadge ;).

rad1o example

More Repositories

1

nix-buildproxy

Providing reproducible HTTP/HTTPS responders to builds that just can not live without
Nix
81
star
2

scalpel

Minimally invasive safe secret provisioning to Nix-generated service config files
Nix
79
star
3

gpt4all-nix

Nix flake for gpt4all
Nix
38
star
4

audio.nix

Assorted audio packages for Nix(OS)/Linux.
Nix
33
star
5

sdr-power

rtl-power modified to support more radio hardware
C
28
star
6

bevy_nix_vscode_template

Starterkit for bevy projcts
Nix
9
star
7

make-wrapper

makeWrapper and wrapProgram freed from Nix build system
Nix
6
star
8

dotfiles

Nix
6
star
9

Flashtrigger

Arduino based flash trigger for High Speed photography
Arduino
5
star
10

sdr.nix

Nix flake with assorted SDR packages
Nix
5
star
11

pi_nrf

Libraries and examples to use the nrf24l01+ wireless communcations chip with a raspberry pi
Python
5
star
12

hooverpal

EvE online ninja salvaging assistant
Vue
3
star
13

deflicker

A tool to remove luminance flickering in timelapse image series
C
3
star
14

pyg3d2

Python library for the g3d2 LED wall
Python
3
star
15

wmslub

wm-dockapp that retrieves a RSS-feed with dates when to give back books at the library and warns when they're due, created for SLUB-library in Dresden
C
3
star
16

imu3000

Atmel code to read an IMU3000 sensor with attached aux module
C
2
star
17

allcolors-rs

Draws pretty pictures containing all colors of a RGB space once
Rust
2
star
18

stripectl

C
2
star
19

nrfled

1
star
20

stm32f407-fix

CPU support crate for stm32f407 with fixes and additional enumeratedValues for the SVD
Rust
1
star
21

spppdd

SPace Pilot Pro Display Driver
Python
1
star
22

lettercreator

CCC-color-creator
Python
1
star
23

allcolors

Generates an image containing each color of a 6bit RGB colorspace once
Python
1
star
24

usbip-rs

USB-IP Implementation in Rust
Rust
1
star
25

arm-embedded-toolchains-nix

Pre-built embedded ARM toolchains
Nix
1
star
26

Blocks2

The Blocks lighting project
C
1
star
27

awl

Exploring and Decoding Nikons AWL protocol with Python
Python
1
star
28

batmanctl

RP2040 based controller for <<</>> batman
Rust
1
star