IQ file and stream converters for SDR

Notes on streaming IQ data

Looking for an alternative to CubicSDR that would provide soapySDR library support, and backend frequency control without at GUI


links:

audacity: http://play.fallows.ca/wp/radio/software-defined-radio/recording-smartsdr-iq-data-audacity/

convert rtlsdr to sdr-sharp: https://github.com/Marcin648/iqToSharp

demod (demodulate IQ streams)  https://github.com/cubehub/demod

rust-airspy  (get stream from airspy)  https://github.com/cubehub/rust-airspy

andres vahter blog: https://andres.svbtle.com/pipe-sdr-iq-data-through-fm-demodulator-for-fsk9600-ax25-reception

rtl_tcp -a 192.168.2.106

rtl_fm can also output raw signed 16 bit IQ data. – as in this example from vahter’s blog: rtl_fm -f 437.505M -M raw –s 1024000r 22050 | doppler -tle “ESTCUBE 1” cubesat.txt | demod -M fm -deviation 3.5k | multimon-ng -t raw -a FSK9600 /dev/stdin

liquid-dsp c sdr dsp lib : https://github.com/jgaeddert/liquid-dsp

sv3exp – interesting experiment with piping iq data in linux command line:  https://sv3exp.blogspot.com/2019/09/decoding-ft8-in-with-any-sdr-like-usrp.html

ha7ilm csdr (command line sdr processor)  https://github.com/ha7ilm/csdr

**sdrplay rtl_tcp fork  https://github.com/SDRplay/RSPTCPServer

cloud-sdr internet streaming:  http://www.cloud-sdr.com/streaming-iq-over-internet-listen-remotely-to-airport-radio/ cloud-sdr also looks to be out of business.

 

interesting post about requests for command line cubicsdr and related : https://github.com/cjcliffe/CubicSDR/issues/654

rx tools (an update of some of the rtl stuff using soapysdr  https://github.com/rxseger/rx_tools

rx_tools, in theory, is a good prospect, but the code is several years out of date, gives errors on devices, is unsupported – just doesn’t work yet.

There are many good examples of IQ streaming with rtl_fm and rtl_tcp, but of course they only suppport rtlsdr.

Prospects

pothos sdr : flowgraph https://github.com/pothosware/PothosCore/wiki

**luaradio – similar to gnu-radio and looks like will run with macports:  https://github.com/vsergeev/luaradio This is a flowgraph language like Gnu-radio. But its lightweight. If the device support is ok, then it looks like there are flowgraph modules that would allow tcp data in/out as well as audio. This is primarily a linux app – but if you ran it on r-pi it could make a good front end for a lot of devices. Also it may run in Mac OS with some audio tweaks. ie., portaudio and pulseaudio.

**sdrGlut this app runs on mac os and streams iq https://github.com/righthalfplane/SdrGlut – I was not able to find a method of external frequency control. It may be added in future releases as this app is in active current development.  Also it runs sdrplay rspdx.

**gnu-radio: Well supported and active development. Not sure about device support for common hobbyist radios like sdrplay, airspyhf, etc.,  gnu-radio: http://play.fallows.ca/wp/radio/software-defined-radio/gnuradio-ssb-receiver/

**worst-case scenario. Actually build something with soapy-sdr, hamlib, and csdr.

docs

**PLSDR – some nice theory here: https://arachnoid.com/PLSDR/

**IQ data for dummies: http://whiteboard.ping.se/SDR/IQ

 

Max8radio project

New version of software define radio for Max/MSP  (in progress)

github repository: https://github.com/tkzic/max8radio

Notes

goals and strategy

The new approach will be to remove most of the device handling code from Max. Instead providing device interfaces from existing device libraries, like soapy-sdr, hamlib, gnu-radio, etc., The Max portion of the project will read IQ files, perform DSP, and other magic.

The first platform will be Max8 in Mac OS Catalina

projects

Max + CubicSDR + hamlib

See working prototype below. This setup uses CubicSDR as a device driver to send IQ data into Max’s input audio stream. CubicSDR supports many devices via soapySDR. It supports networked rig control via Hamlib.

Advantages of this system: It works now. It runs in Windows. It runs over the a local network. The software is managed and distributed by somebody else.

Disadvantages: Its not an elegant solution – ie., not self contained within Max. It requires installation and setup of CubicSDr. The software is managed and distributed by somebody else – so it could stop working at any time.

rx_tools + hamlib

rx_tools is an update of some of the rtl tools, like rtl_fm. It includes soapySDR device support. If hamlib is added to rx_tools, then you could do the same networked frequency control, and IQ streaming as CubicSDR – using rigctld. Without the overhead of running CubicSDR. The downside it that it’s yet another program to maintain and distribute.

Next step: look at source code for rx_tools and estimate scope of hamlib intergration.

openwebrx and websdr API

openwebrx  https://www.openwebrx.de/

Websdr  http://websdr.org/

These sites provide access to SDR devices connected to web servers. Although they don’t stream IQ data, it would be interesting to build a Max front end to the APIS.

background information

See previous posts:

External programs required

  • hamlib (macports)
  • cubicSDR (see link above)
  • netcat (nc) (built into Mac OS terminal)

notes on rigctld commands

Best results using one letter commands with single quotes:

echo 'F 7023000' | nc -w 1 localhost 4532

Prepend ‘+’ for more feedback, like this:

% echo '+F 7023000' | nc -w 1 localhost 4532
set_freq: 7023000
RPRT 0

Latest prototypes

Links to latest working projects (from newest to oldest)

 

First Max test project

This is an update of the test done with CubicSDR and RTLSDR as described here: https://reactivemusic.net/?p=19802

CubicSDR is great but eventually the goal is to pare down the interface between the SDR device and Max. Something like a command line IQ filter would be ideal:  https://github.com/xmikos/simplesoapy

Hardware and system setup

This test uses an Airspy Discovery HF+, but any device supported in CubicSDR should work – that’s the point of this exercise.

Using BlackHole from Existential Audio https://existential.audio/blackhole/

as an alternative to Soundflower to route the IQ (audio stream) data from CubicSDR to Max. You could also use a cable to connect output of one audio device to input of another, etc.,

Signal path:

Antenna -> Airspy -> CubicSDR -> rigctld -> Max

CubicSDR settings

  • Plug in Airspy device before launching CubicSDR, so it will be discovered on the setup screen
  • On the main display, click just to the right of the mode buttons to bring up a drop down menu of audio devices
  • select I/Q mode
  • select the audio device, or “BlackHole 2ch”, that you will use to route audio to Max
  • click on any of the frequency digits, press space, and enter in the same frequency as the Center Frequency (e.g., 7000000)
  • click the ‘V’ to the left of the frequency digits, to select ‘delta lock mode’. This causes the frequency and center frequency to sync.
  • Be careful not to click anywhere in the waterfall window – or this will mess up the sync
  • Under Rig Control menu:
    • Select “Hamlib NET rigctl” as the model
    • Enter localhost:4532 as the control port
    • Select 57600 as the serial rate
    • Make sure that “follow rig” and “floating center” are checked
    • After you get the rigctld daemon started, come back here and ‘Check’ ‘enable rig’. If it doesn’t stay checked, then there is a problem with the connection.
  • Under the Audio sample rate menu, select the correct sample rate for your audio device (e.g. 96k)

Notes: It seems there is some kind of AGC hardwired into CubicSDR.  https://github.com/cjcliffe/CubicSDR/issues/826

TCP and rigctld settings

  • Open a terminal window
  • type: rigctld -m 1 4532 &
  • This starts the server running in the background using the HAMLIB test dummy rig
  • to set frequency to 7.010 MHz, type:

    echo ‘F 7010000’ | nc -w 1 localhost 4532

  • This should change the center frequency and frequency in CubicSDR

Max settings

For this test, you can use any of the MaxSDR tutorials available  at https://github.com/tkzic/max8radio

We’ll be using maxsdr7a.maxpat

ignore the max-console messages about missing externals.

The key is to choose the default audio input device and set it to be the same as what is coming out of CubicSDR.  ie., “BlackHole 2ch”

  • Set the audio input device to match CubicSDR, as described above. Also match the sample rate (e.g., 96k)
  • Set the audio output device to your internal soundcard/speakers
  • Start audio and recall preset 1 or some normal settings for SSB
  • It should be receiving I/Q data now from Cubic SDR
  • Note: may need to flip the I/Q input due to anomaly in CubicSDR.
  • Now load another Max patch to do the frequency control: rigctld1.maxpat

This patch sends frequency data to the rigctld daemon via the [shell] object. You can change the frequency using the number box.

That’s about it for now.

IOTA

Igloos on the Air

Operating the 2016 ARRL DX CW contest from inside an igloo at the summit of Witt Hill in Norway, Maine.

You can see the dipole feedline entering the air hole near the top right of the igloo – in the above photo.

Inside the igloo, the rig is balanced on a board, supported by plastic storage containers. I ran full power, 100 watts, from an IC-7300, using Bioenno LiFePo batteries. The temperature inside stays a few degrees above zero Celsius. I thought the rig would help heat up the igloo, but instead had to rely on wool blankets.

All of the gear was pulled up on sleds using human power.

About 3 feet of snow fell in the week before the contest.

Results: KA1IS – 40 meters SOSB LP claimed score: 86,286 (394 QSO’s + 73 countries)

 

Generic SDR realtime IQ converter

With CubicSDR, HAMLIB, and Max

update: 1/25/2021 – Using this general setup with Airspy, CubicSDR, rigctld, and netcat (nc) to send IQ data into the basicSDR3.maxpat patch


CubicSDR uses the SoapySDR library as generic tool for extracting realtime IQ data streams from common SDR devices. It also provides TCP external frequency control using HAMLIB.

http://cubicsdr.com/

Although its not the main purpose of CubicSDR, the IQ streaming capability will connect SDR devices to Max, Pd, and other DSP platforms, to build experimental radios. All without building external objects or hardware device drivers.  The convenience of using CubicSDR for this purpose far outweighs the overhead.

A prototype with Max and rtl_sdr

How to use CubicSDR as a front-end for SDR experiments in Max.

The signal path for this test is:

  1. antenna
  2. NooElec HAM IT UP upconverter
  3. rtl-sdr dongle
  4. CubicSDR
  5. Soundflower (or a “loop-backed” external audio device)
  6. Max

Running in the other direction, the frequency control path is:

  1. netcat running in Mac OS X terminal (or a Max patch that sends TCP)
  2. rigctld (hamlib TCP server)
  3. CubicSDR
  4. rtl-sdr dongle

There’s a lot of stuff going on here, so the choice to use hardware audio routing instead of Soundflower and netcat instead of TCP in Max, is an effort toward simplicity.

CubicSDR settings:

  • Plug in the rtl-sdr before launching CubicSDR, so it will be discovered on the setup screen
  • On the main display, click just to the right of the mode buttons to bring up a drop down menu of audio devices
  • select I/Q mode
  • select the audio device, or Soundflower, that you will use to route audio to Max
  • If using an upconverter, set the ‘frequency offset’ in the settings menu (e.g. -125000000)
  • click on any of the frequency digits, press space, and enter in the same frequency as the Center Frequency (e.g., 7000000)
  • click the ‘V’ to the left of the frequency digits, to select ‘delta lock mode’. This causes the frequency and center frequency to sync.
  • Be careful not to click anywhere in the waterfall window – or this will mess up the sync
  • Under Rig Control menu:
    • Select “Hamlib NET rigctl” as the model
    • Enter localhost:4532 as the control port
    • Select 57600 as the serial rate
    • Make sure that “follow rig” and “floating center” are checked
    • ‘Check’ ‘enable rig’. If it doesn’t stay checked, then there is a problem with the connection.
  • Under the Audio sample rate menu, select the correct sample rate for your audio device (e.g. 96k)

TCP and rigctld settings

  • Open a terminal window
  • type: rigctld -m 1 4532 &
  • This starts the server running in the background using the HAMLIB test dummy rig
  • to set frequency to 7.010 MHz, type:

    echo ‘F 7010000’ | nc -w 1 localhost 4532

  • This should change the center frequency and frequency in CubicSDR

Max settings

For this test, you can use any of the MaxSDR tutorials available at https://github.com/tkzic/maxradio but I chose to use the main program, currently maxsdr7a.maxpat. The key is to choose the default audio input device and set it to be the same as what is coming out of CubicSDR.  I used a stereo patch cord to connect the line output of my Apollo Twin interface to the input jacks – but you can also use Soundflower.

  • Set the audio input device to match CubicSDR, as described above. Also match the sample rate (e.g., 96k)
  • Set the audio output device to your internal soundcard/speakers
  • You may need to toggle the flip IQ button
  • Start audio and recall preset 1 or some normal settings for SSB
  • It should be receiving I/Q data now from Cubic SDR

Links:

Installing Hamlib: https://reactivemusic.net/?p=19402

Installing CubicSDR: https://github.com/cjcliffe/CubicSDR/releases

Supported SDR devices: https://reactivemusic.net/?p=19746

Notes:

I had some success using the Max TCP external described at the Installing Hamlib link above, but temporarily abandoned it due to some latency and dropouts.

Local version of this patch is: tcpClient-small2.maxpat

Next steps:

  • hardware (i.e., MIDI controller) control of frequency – and refinement of Max TCP patch. Can likely re-use the patch from the remote radio project.
  • Convert to PD : TCP/IP code is builtin
  • Consider forking CubicSDR and adding direct MIDI/OSC control of UI.

40 meter wire antennas

notes:

Co-linear/Phased

http://www.w6kan.com/k3mrg2.html

http://iacantennas.com/docs/Double-Bazooka-Phased-Array.pdf

http://www.sage-american.com/SK/cebik/a10/scv/bc40ab.html

http://ac0c.com/attachments/40m_parasitic_to_phased.pdf

https://www.google.com/search?q=40+meter+phased+dipoles&biw=1257&bih=658&tbm=isch&imgil=rGEgDAl-KBysDM%253A%253BVUcAu-I7Qdz3GM%253Bhttps%25253A%25252F%25252Fwww.qrz.com%25252Fdb%25252FN4JTE&source=iu&pf=m&fir=rGEgDAl-KBysDM%253A%252CVUcAu-I7Qdz3GM%252C_&dpr=2&usg=__WbOZHa3k5CGZMaXOPLJqyh9Hbl8%3D&ved=0CE4QyjdqFQoTCJ_Bw5uX2cYCFfAg2wodRDwMww&ei=Ez-kVd_rBPDB7AbE-LCYDA#imgrc=o5hQonjWNGW-iM%3A&usg=__WbOZHa3k5CGZMaXOPLJqyh9Hbl8%3D

Moxon

http://www.iw5edi.com/wp-content/uploads/2013/06/40-Meter-Mini-MOXON-Beam-Antenna.pdf

http://www.moxonantennaproject.com/IK0GDH/IK0GDH.htm

http://www.moxonantennaproject.com/w1zymoxon.htm

http://www.optibeam.info/index.php?article_id=85&clang=1

Quad/loop

http://n4jte.blogspot.com/2006/10/2-element-40-meter-reversable-quad.html

http://www.hamuniverse.com/na4lquagibeam.html

https://www.google.com/search?q=40+meter+quad&tbm=isch&tbo=u&source=univ&sa=X&ved=0ahUKEwj3hvGkro3NAhUF6x4KHVOyBLkQsAQIKQ&biw=1217&bih=628#imgrc=5Tm4dnnwCVss5M%3A

http://www.seed-solutions.com/gregordy/Amateur%20Radio/Experimentation/40%20Meter%20Delta%20Loop%20Array.htm

Yagi/dipole

https://www.dxengineering.com/parts/csh-d4

http://www.jkantennas.com/jk403.html

http://www.rssl.lk/40-meters-3-element-wire-yagi-by-ve3vn/

http://amfone.net/Amforum/index.php?topic=19385.0

http://lists.contesting.com/_towertalk/1997-12/msg00178.html

http://ve3vn.blogspot.it/2014/05/40-meters-3-element-wire-yagi.html

http://ve3vn.blogspot.it/2014/12/40-meters-4-element-wire-yagi.html

http://lists.contesting.com/_towertalk/1998-05/msg00610.html

http://egpreston.com/40mbeam.txt

http://www.dxzone.com/catalog/Antennas/40M/40_meter_Yagi_Antennas/

(3-6-9) http://radio.n0gw.net/radio05.pdf

Other

http://n4jte.blogspot.com/

http://www.greenbookee.org/horizontal-40-meter-array/