Spectrum signature from a Software Defined Radio, directly in the REPL !
This small package intends to render in the terminal the output spectrum from a Software Defined Radio.
It is very similar to the GnuRadio tool rx_ascii_art_dft
and has a similar API
Simply add the package from the Julia Package Manager
] add AbstractSDRs_rx_ascii_art_dft
The package relies on both AbstractSDRs for SDR management and UnicodePlots for the REPL rendering. No functions are exported and the spectrum can be obtained with the following command
AbstractSDRs_ascii_art_dft.main(sdr,carrierFreq,samplingRate,gain;nFFT=1024,avg=1)
The following parameters are supported
sdr
: SDR type supported by AbstractSDRs (for instance :uhd). A symbol is expectedcarrierFreq
: Carrier Freq in Hz (e.g 2400e6)samplingRate
: Radio sampling rate in Hz (e.g 2e6)gain
: gain in normalized scale (e.g 20)
nFFT
: Size of the FFT/DFT as anInt
(e.g 1024)avg
: averaging factor for PSD computation as anInt
(e.g 12)canvas
: Canvas used to display. Can be AsciiCanvas, DotCanvas or BlockCanvas (see UnicodePlots.jl documentation)width
andheigth
to control the size of the plot. ❗️These parameters can help to have a proper visualisation but be sure that the terminal you are working on is larger than setup size (otherwise graphic issues will occur)kwargs...
: All arguments supported by AbstractSDRs to open configure and monitor radio devices
It is possible to change the magnitude axis during acquisition to zoom in/out and to shift the center magnitude. By default the plot is centered around 0dB and have 120dB dynamic. By pressing different keys we can:
UP arrow
to shit the center limit upDOWN arrow
to shift the center downLEFT arrow
to zoom out (increase range)RIGHT arrow
to decrease range of ylims (zoom in)
Note that it is not possible to change radio parameters during runtime such as carrier frequency of sampling Rate.
Any PR are welcome 👍
Assuming we have an SDR from Ettus research (known as :uhd
in AbstractSDRs), with the IP address "192.168.10.11" and we want to compute the PSD with some averaging ratio (256) and we want to inspect the spectrum @ 780MHz to see any communications
AbstractSDRs_ascii_art_dft.main(:uhd,780e6,4e6,30;avg=256,args="addr=192.168.10.11")
and we can observe the following result