Ecco lo spettro che ho riprodotto!
è sufficiente un HackRF/BladeRF, una immagine da riprodurre ed uno script in python!
Per la riproduzione di questo esempio, farò riferimento a Spectrum Painter. Qui di seguito un video d’esempio trovato su YouTube.
Come distribuzione Linux utilizzo Ubuntu e questi sono i passaggi da adattarsi, se non ad altre distribuzioni, ad altri SO.
Step 1:
Iniziamo aggiornando le repository ed installando alcuni pacchetti necessari: PIP e gfortran
$ sudo apt-get update
$ sudo apt-get install python-pip gfortran
Step 2:
Scarichiamo Spectrum Painter da GitHub ed installiamo le dipendenze necessarie. Ci sarà bisogno di compilare un po’ di pacchetti. Pertanto ci vorrà, a seconda del computer a disposizione, non più di mezzora di compilazione.
$ git clone https://github.com/polygon/spectrum_painter.git
$ cd spectrum_painter
$ pip install --user -e .
Step 3:
Dopo la compilazione si procede alla scelta dell’immagine. Io avevo scelto questa.
ma bisogna utilizzare il negativo, poichè le zone più chiare sono quelle rappresentate con più energia nello spettro. Quindi andiamo ad utilizzare il negativo:
Copio-incollo la guida dell’autore dello script sul funzionamento dello stesso, specie per le opzioni:
Usage: img2iqstream [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
- 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.
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.
Con il comando successivo invece, andiamo a creare il file da dare in pasto ad hackrf_transfer per la trasmissione:
python spectrum_painter/img2iqstream.py -s 10000000 -l 0.004 -o firenze.iqhackrf --format hackrf examples/firenze.png
Step 4:
Non rimane solo che trasmettere con l’HackRF e ricevere sulla stessa frequenza con un altra SDR su un altro computer:
sudo hackrf_transfer -t firenze.iqhackrf -f 433000000 -b 1000000 -s 1000000 -x 47 -a 1 -R
Ed ecco il risultato finale: