pragsmike / rad

SDR experiments

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Monoidal Radios

SDR as monoidal categories

Target signal flowgraph topologies:

  • gnuradio
  • pothos
  • luaradio
  • ptolemy

GnuRadio still uses Python 2.7, so it can’t interop with Clojure.

What alternatives to GnuRadio are there?

Pothos is one.

Questions

What is QSpectrum Analyzer?

Device drivers, names, and device wrappers

A radio device, such as an RTL or a RSP, has a name. When you start a program that uses a radio, you use that device name to tell it which one to use.

The program uses that name to look up a bit of software, supplied by the device vendor, that responds to a pre-arranged set of commands and turns them into commands for that particular device. (This is a functor from driver commands to device commands.)

With so many devices, each with its own driver software, several people have created a set of adapters, one for each device, that translates that device’s language to and from a single, uniform lingua franca. However, there is more than one such “standard” interface. Two are UHD, and osmo. A third is Soapy, which can compose either UHD or osmo, and some other devices besides.

Soapy is therefore the most powerful in the sense that if you write your radio-using programs to call on a Soapy interface, it will work with lots of radios.

If you think of the driver domain as a category where the objects are drivers and the morphisms are “wraps”,

A “driver” is a type, together with a functions defined to and from that type.

The “hardware” driver is the atom.

If we define a null wrapper, then this is a monoid. The monoid unit is that null wrapper, and the monoid product is the composition of drivers.

When we want to use such an adapter, we need to specify that adapter as the “device”. The simple name of the hardware radio device is no longer sufficient.

Effectively, we are composing an interface-translation operation before the device driver.

You give it a name and a function that turns that name into an in-memory device driver.

References

FM Receiver in GnuRadio, step by step

The Ubuntu gnuradio installs this example: usrp_wfm_rcv_sca.py

LuaRadio is intended for embedded devices. A nice lightweight alternative to gnuradio. It has a JIT compiler! How fast is it? It’s portable to ARM. Does it GC?

How about a ClojureScript to LuaJIT compiler?

GRC files are XML

The first line is

<?grc format='1' created='3.7.11'?>

There is no schema referenced in the document.

  • flow_graph
  • block

SDR models using ACT

synthesizer patch bay is a monoidal category

Is a synthesizer patch a realization of a bunch of operads?

How to represent the signal plan in an SDR model?

The signal-processing paths in the SDR flow graph can be modeled as a graph where nodes are sample types and arrows are functions that transform one type to another.

“type” here means an ADT, which could be an atomic type like int, or a structured type like array of int. Often the type will be “stream of int” or “stream of cfloat”.

The flowgraphs can be seen as proofs in a monoidal category.

How to represent control plane in an SDR model?

The control plane allows a system to dynamically control its components at runtime. “Control” here means a way to change parameters, stop and start operations, and inspect the state of the component.

There is a pub-sub event mechanism that allows components to react to events sent by controllers, or by anything else. One interesting kind of event is sent by certain components that process streams of signal samples, when they encounter a specially-marked sample placed there by an earlier stage in the flow graph.

About

SDR experiments


Languages

Language:Python 62.3%Language:Lua 18.3%Language:Clojure 11.8%Language:Shell 7.7%