Spectrum Painting on 2.4 GHz

Give a software-defined radio (SDR) platform to a few thousand geeks, and it’s pretty predictable what will happen: hackers gotta hack. We’re only surprised that it’s happening so soon. Spectrum Painter is one of the first cool hacks to come out of the rad1o badge given out at the CCCamp 2015. It makes it dead-simple to send images in Hellschreiber mode on a few different SDR hardware platforms.

What we especially like about the project is its simplicity. Don’t get us wrong, we’re tremendous fans of GNURadio and the GNURadio Companion software radio hacking environment. But if you just want to do something simple, like send a picture of a smiley-face, the all-capable GNURadio suite is overkill.

HackRF, the rad10 badge, and bladeRF all have software that enables you to directly load up and play out a file over the radio interface; it’s like a WAV file, only at radio frequency. This makes a hack like Spectrum Painter pretty straightforward. Simply convert the image file into the corresponding radio waveform data, and send it along. No GUI, no dragging, no dropping.

img2iqstream -s 1000000 -l 0.004 -o smiley.iqhackrf --format hackrf examples/smiley.png
hackrf_transfer -t smiley.iqhackrf -f 2450000000 -b 1750000 -s 1000000 -x 20 -a 1

Bam! Kudos [polygon]!

If all of this SDR action has your interest piqued, there’s a lot you can do even just receiving with an el cheapo RTL-SDR USB stick. It’s the gateway drug into SDR, so if you’re not addicted yet and you’ve got a free weekend, give it a shot.

15 thoughts on “Spectrum Painting on 2.4 GHz

  1. And before the hackaday crew even knew, [drmpeg] has successfully ported that over to a GNU Radio module yesterday, announced it on twitter (https://twitter.com/drmpeg/status/634261798254829568),allowing all enthusiast, whether they have a HackRF/Rad1o or the BladeRF or something else, to use that thing. https://github.com/drmpeg/gr-paint go wild! Modify! Distort! Harness the power of GNU Radio, which is actually, as opposed to what the article above says, being simple to understand yet *allowing* complex things to be done.

    1. Problem is that it’s a scrolling display, ie. there’s no frame. And as soon as you start modifying the receiver to change that, you could as well just implement a digital communication line to stream video…

  2. So this “paints” a picture on a received spectrum waterfall display by transmitting at different levels as the transmitter sweeps in frequency. Right? Kind of like an old fax machine…

    1. Close, but not quite. There’s no sweeping. The whole bandwidth is observed at once. This is not the inverse of a sweeping spectrum analyzer, but it’s a somewhat broadband transmission device, where you can define what the spectrum looks like e.g. in the 4MHz your device is capable of transmitting. So the “pixels” on each row aren’t send sequentially, but have to be transmitted all at once; that’s why the fax comparison doesn’t quite fit.

      Let’s approach this from the other end: What does the spectrum analyzer show?

      As mentioned, this is not a sweeping spectrum analyzer, where you tune your receiver to frequency A, observe the power passing through a narrow filter there, update the color for the frequency-representing pixel, move on to frequency B, and so on. Instead, the receiver samples a whole bandwidth, let’s say 4MHz, continously, which means that it needs to acquire at least 4 Million complex baseband samples. These samples then contain all frequencies in [f_center – f_sample/2 ; f_center + f_sample / 2].

      What the receiver (here GQRX) does then is partition this sample stream into vectors of samples, let’s say 1024 per vector. Then, it applies the discrete fourier transform (DFT) on them, after optionally applying what we call a window, which in most cases improves clarity by attenuation the signal at the vector edges. What you get out of this is again a vector of the same size, but now containing frequency samples instead of time samples. These are complex (because a sinusoidal signal does not only have a frequency, mapping to the position in the vector, and a amplitude, mapping to the magnitude of the sample within that vector, but also a phase, which maps to the argument of that complex sample), so the visualizer then takes the absolute of each element, converts them to dB and visualizes them using a color scheme.

      Hence, the trick is to reverse the DFT done by the receiver — luckily, the DFT is reversible unambigously, and so this becomes relatively easy. You take your greyscale image, get a row of it, apply the inverse DFT, and concatenate the time sample vectors you get from consecutive rows, and then send it out.

      Hope this explanation was good enough!

  3. This is cool but not Hellschreiber, which has a specific fast-slow off-on transmit that is interpreted as X-Y dots scrolling. This looks like multi-frequency transmission where the image is transmitted as the fourier transform, so that it shows up directly on the waterfall.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s