Perseus on Linux: checking libperseus-sdr functionalities and implementing simple one-liner radios with csdrFirst of all, an explanation is due: the term one-liner in the title does refer to the unix sense, not the common one in english.
As we will see below, using the csdr package, it becomes feasible to write a fully functional SDR radio with just a single one line command in Linux.
Furthermore, csdr package can be used in order to check more properly that everything is working fine with the new built and installed libperseus-sdr.csdr is a very nice DSP for SDR package written by András Retzler HA7ILM. known, one among many, for his OpenWebRX software. csdr is really the core of OpenWebRX, but it can even be used as a separated application.
It is based on the typical Unix concept of filter : in short a filter is a program that reads its input from the standard input stream, makes some useful processing and emits results on the standard output.
Usually a filter is chained to other programs (that can be even filters of course) using the pipe shell operator, in order to implement complex functions. In origin filters were probably designed keeping in mind text processing appplications but, of course, the data type exchanged can be anything can be modeled inside the stream concept.
A stream of samples (both in real and complex format) is very well suited
to be processed by filters. The first SDR package to exploit this kind of
concept has been GNU Radio: however GNU Radio, rather than unix shell pipes,
uses an internally developed scheduler that takes care to move data
along the piping interconnecting the DSP modules.
In my examples, diagrams are created using octave, a math open source program, freely available on any Linux distribution.
In order to generate the stream of IQ samples, we use the perseustest program, as found in libperseus-sdr package, specifying on the command line the option
-o -that sends IQ samples, read from USB, as normalized 32 bit floating points numbers, to the standard output.
I/Q graphThe first example just produce a diagram of such raw samples when a signal at 7.250 MHz is sent at Perseus's input:
perseustest -u -30 -f 7250000 -s 192000 -a -p -o - -t 1000 | \ csdr octave_complex_c 1024 120000 --2d | \ octave -i > /dev/nullhere perseustest is sending IQ with a 192 kS/s rate for 1000 secs, using a -30 dB attenuation to the csdr octave_complex_c (c stands for complex numbers) that just reads the input streams and convert to the ASCII format (see below) required by octave in order to do a graphical render.
N = 1024; isig = [0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.000000 0.000000 -0.000000 0.000000 -0.000000 0.000000 ... 0.000002 -0.000002 ];the graph is showing just two nice sine signals because I connected a signal generator tuned to about 7 MHz directly to the Perseus input.
I/Q spectrumA more interesting example is a spectrum visualizer. In this case the csdr fft_cc command is used: the cc suffix indicates that csdr is getting a complex number block (1024) producing a complex FFT.
perseustest -f 7250000 -s 192000 -a -u -30 -p -o - -t 1000 | \ csdr fft_cc 1024 100000 HAMMING --octave | \ octave -i > /dev/nullThe second parameter(100000) indicates that 100000 samples are discarded before another block is processed.
Below a carrier at 7.250 MHz is shown:
40M SSB receiverA SSB LSB receiver is implemented as follows:
perseustest -f 7156000 -s 192000 -a -u 0 -p -o - -t 1000 | \ csdr fir_decimate_cc 4 0.05 HAMMING | \ csdr bandpass_fir_fft_cc 0 0.01 0.20 | \ csdr realpart_cf | \ csdr agc_ff | \ csdr limit_ff | \ csdr convert_f_s16 | \ mplayer -cache 1024 -quiet -rawaudio samplesize=2:channels=1:rate=48000 -demuxer rawaudio -
csdr bandpass_fir_fft_cc <low_cut> <high_cut> <transition_bw> [window]
Perseus on Linux: Gqrx and gr-osmosdrGqrx is a Software defined radio receiver powered by GNU Radio and Qt developed by Alexandru Csete OZ9AEC.
I developed a small patch for Gqrx that allows to use Perseus with Gqrx.
Of course I added Perseus support to gr-osmosdr that is the GnuRadio module used by Gqrx for hardware management.
Alas such contribution has not yet been integrated upstream, so, for the time being, one has to compile it by itself.
First off, you have to follow the
standard procedure for Gqrx installation
After the installation has completed, open a terminal and run gqrx program from command line.
The main windows will show up, but Perseus support is not yet there. Close the program and go ahead with the steps below.
The second step concerns libperseus-sdr library, that has to be built in the following way:
sudo apt-get update sudo apt-get upgrade sudo apt-get install gcc g++ make manpages-dev autoconf automake libtool git sudo apt-get install libusb-1.0-0-dev cd git clone -b doc https://github.com/Microtelecom/libperseus-sdr.git cd libperseus-sdr/ sh bootstrap.sh ./configure && make && sudo make install && sudo ldconfig cdConnect the receiver and check that it is working running the
perseustestprogram (the relays will click several times).
Now, the third and last step is to build the gr-osmosdr specific for Perseus:
sudo make install cmake wget http://github.com/IW0HDV/gr-osmosdr/archive/perseus.zip unzip perseus.zip cd gr-osmosdr-perseus mkdir build cd build/ cmake ../ && make && sudo make install && sudo ldconfigNow, starting again gqrx, and pressing "Configure I/O device", the option for Perseus will appear in the device's list.
The above procedure was tested on a fresh installation of 64 bit Ubuntu 16.04.3 LTS.
It should work as is on all amd64 Debian derived distribution.
The procedure could seem cumbersome: really, using the Linux clipboard mouse management, the several commands can be inputed very quickly. Just select and copy the text from the web page using the left mouse button in one shot (without recurring to the context menu).
Next, you can paste it into the terminal with the central button. Copying the end of line you do not even need to press enter for each line.
SUSE packagingMartin Hauke wrote me that he has packaged libperseus-sdr for openSUSE on OBS.
The package is found here.
He also added libperseus-sdr to release-monitoring.org.
So one can keep informed about new releases via fedmsg (mail, irc,...)
How to run a Microtelecom Perseus receiver on Linux
As usual, it depends !
Please take a look to the choices list below.
In case you want discuss on this topic, enroll in the Perseus mailing list and ask there.
If one want be on the air as soon as possible, please use
by SM5BSZ Leif Åsbrink, one of the best
SDR programs written, natively on Linux and ever.
Here there is an installation manual for Linrad written by Roger, VE7VV.
Here there is a Linrad Installation & Configuration User Guide by Gaëtan Horlin, ON4KHG.
- Use Alexandru Csete OZ9AEC GQRX SDR receiver, see also this post.
If you like play with DSP, use GNU Radio, the unrivalled
open source DSP toolbox.
Perseus is enlisted in CGRAN and so directly supported in PyBOMBS, the new GNU Radio install management system, by the new gr-microtelecom module I wrote.
(not for fainthearted !)
a modification of the excellent Software Defined Radio (SDR) software by John Melton G0ORX that fully supports Perseus even over Internet, in client server mode.
(for coders only)
Do you want simply to access hardware, as you just cooked your own
SDR code ?
Take a look to the open source libperseus-sdr control library, written by the Microtelecom' founder and Perseus' chief designer, Nico Palermo IV3NWV and undeservingly maintained by me.
If you discover a bug or you would like to have a new feature, open an issue on GitHub.
(for coders only) try Gordon JC Pearce' Lysdr
My fork, with patches for Perseus, is here.
Old page, containing not anymore supported projects can be found here.