Teensy Convolution SDR (Software Defined Radio)

Morse code (CW) decoding is now available in the Teensy Convolution SDR.

CW decode on Teensy Convolution SDR.jpg

We have implemented the decoder version supplied by Loftur (thanks a lot for putting that into the public domain! https://sites.google.com/site/loftu...wo-Fast-Fourier-Transform-and-Colour-Graphics) based on an algorithm from a Master thesis from 1973. It is the same version as available for the UHSDR software.

This is a first version, so there is some caution necessary:

* the threshhold for detecting the Morse pulses (CW thresh) has to be manually adjusted according to the band noise, it has to be well above the band noise and well below the signal strength of the Morse signal
* the tone detection uses a narrow bandpass filter (Goertzel) at 700Hz, so your signal MUST be tuned at 700Hz above or below the tune frequency (depending on whether you use USB or LSB demodulation). This will be made flexible and adjustable for the user in the next version
* there is an automatic adjustment called ATC, but I have not yet experimented much with that
* of course, the human brain is much much better than a machine in decoding morse code signals buried in noise: so, do not expect miracles from this simple decoder

The latest version is on github: https://github.com/DD4WH/Teensy-ConvolutionSDR

Have fun with the Teensy!

Frank DD4WH
 
There is now a small red symbol flashing in the same rythm with the Morse code tones when CW thresh is properly adjusted (it should not react to noise, but to the Morse code: this is essential for proper decoding). Also wpm display gives the speed of the morse code in "words per minute". One standard "word" is 10 dots and 4 dashes as in the word "Paris"


What we hear is a signal by radio amateur Gyuri (HA5JI) from Hungary communicating with (probably) IK1WQK (we can not hear the QSO partner)
 
Last edited:
The Teensy Convolution SDR goes 4.0


Here, it demodulates FM stereo at 256ksps sample rate using the processor intense atan2 function with the double precision FPU of the Teensy 4.0. Processor load is now about 61% (in the video it is 44%, but I changed a bunch of things).

For testing, I built up a new machine on a perf board with a common ground plane using:

* Teensy 4.0
* ADC PCM1808 module
* DAC PCM5102a module
* TFT ILI9341 2.4´´
* quadrature sampling detector board containing:
* Si5351 local oscillator
* Johnson counter 7474
* switching mixer == tayloe detector
* OPamp after the mixer
* three encoders
* one cheap joystick containing the functionality of five pushbuttons
* the antenna is a 2 x 0.75m wire connected directly to the quadrature sampling detector board

The software is now usable with the Teensy 4.0 OR the Teensy 3.6. Use the compile time switch in the first script lines before compiling.

https://github.com/DD4WH/Teensy-ConvolutionSDR

There is plenty of room for optimization, eg. the IIR filters in the FM receive path have to be substituted by phase linear FIR filters to enable better stereo diversity.

All the best,

Frank DD4WH
 
For those interested, this is the audio flow in software for demodulation of stereo wideband FM. If you have any suggestions for improvement, I will be very happy to hear about that! Also those interested in helping to decode RDS ID and text messages, please do not hesitate to post here.

wideband FM receive Teensy 4 Convolution SDR.png
 
Hi

I have downloaded the most current version (2019_10_08). I'm using the Teensy 3.6. The relevant Audio shield has not been connected yet. I plan to use my own SDR that I built, the SDR has a si5351 onboard.

I have been playing around with the code of the version earlier to this around Oct 3. The plan then was to display the screen and then work out the controls and their operation. No SDR was connected at the time, but the idea was to get a more general feel of the operation and the layout of menu items. I made the changes necessary I the library files based on the instructions and the screen displayed the necessary information and with trial and error and studying the code, I worked out each of the controls.

I upgraded Arduino and that broke all the earlier work done on the libraries and so I started afresh.

I now downloaded the version available but did not realise that it has been updated and this showed a number of errors at compile time which I corrected mostly library etc. I uncommented this line #define HARDWARE_DD4WH. However, I see from the code that several errors came up that did not show on the earlier version and example is DrawFloat which states that the member does not exist.

Where do I set the code to use 3.6 instead of T4. There are some other bugs that are coming too for example on line 248 there is
#elif
#include <ILI9341_t3.h>
#include "font_Arial.h"

The above is an elseif with no condition.

I have rechecked and rechecked the code, I'm not sure what I'm missing,

Thank you.

/MICUPRE
 
Hi MICUPRE,

sorry for that: I seem to have messed up the Teensy 3.6 configuration while I was working on the T4 version (which uses another TFT library and thus some other commands for printing text).

I will repair that the next days and inform you as soon as the T3.6 configuration is working again and tested on my equipment. Will also try to clarify the setting of the compile time switches (which #define to uncomment/comment).
 
Thanks again for pointing me to the bugs! Now the software compiles for Teensy 3.6 (latest version is on github).

I have also tested the fixed version on my T3.6-based SDR and it plays fine.

For Teensy 3.6, compile with uncommented
Code:
#define HARDWARE_DD4WH
and choose Teensy 3.6 180MHz in the Arduino compile options

For Teensy 4.0, compile with uncommented
Code:
#define HARDWARE_DD4WH_T4
and choose Teensy 4.0 in the Arduino compile options.

For Teensy 4.0, you will find a menu entry where you can choose the CPU frequency you want. Beware to have a good heatsink installed when going over 600MHz.

I have been able to run the T4 Convolution SDR at 948MHz for hours. Every CPU frequency above 948MHz causes the radio to crash (although not necessarily immediately . . .). But 948MHz is really fast enough for everything you would dream for in this radio.

Have fun with the Teensy Convolution SDR,

Frank DD4WH
 
Thanks again for pointing me to the bugs! Now the software compiles for Teensy 3.6 (latest version is on github).

I have also tested the fixed version on my T3.6-based SDR and it plays fine.

For Teensy 3.6, compile with uncommented
Code:
#define HARDWARE_DD4WH
and choose Teensy 3.6 180MHz in the Arduino compile options

For Teensy 4.0, compile with uncommented
Code:
#define HARDWARE_DD4WH_T4
and choose Teensy 4.0 in the Arduino compile options.

For Teensy 4.0, you will find a menu entry where you can choose the CPU frequency you want. Beware to have a good heatsink installed when going over 600MHz.

I have been able to run the T4 Convolution SDR at 948MHz for hours. Every CPU frequency above 948MHz causes the radio to crash (although not necessarily immediately . . .). But 948MHz is really fast enough for everything you would dream for in this radio.

Have fun with the Teensy Convolution SDR,

Frank DD4WH

Hello Frank,
Thank you for your help on this and the excellent code.
I could not try your code earlier as I was travelling. Today I tried the code, and found the following errors:
Code:
#ifdef USE_LOG10FAST
      help = 10.0 * log10f_fast(FFT_spec[x] + 1.0) * spectrum_display_scale;
#else
      help = 10.0 * log10f(FFT_spec[x] + 1.0) * spectrum_display_scale;
#endif

and on this line
Code:
 max_gain = powf (10.0, (float32_t)bands[current_band].AGC_thresh / 20.0);
I got "'struct band' has no member named 'AGC_thresh'" I have commented the line out.

Thank you for your time.

Best wishes

/MICUPRE
 
and found the following errors:

The first one is intended and is no error ? It compiles for me and the fast log-approximation code is being used by the spectrum display code

For the second problem you have to define your own hardware and define the right connections and then use recent code.

If you do not define one of the switches relating to the hardware you use for your radio, the compiler will throw errors.
 
The first one is intended and is no error ? It compiles for me and the fast log-approximation code is being used by the spectrum display code

For the second problem you have to define your own hardware and define the right connections and then use recent code.

If you do not define one of the switches relating to the hardware you use for your radio, the compiler will throw errors.
Sorry Frank.. Now fixed I overlooked the switch (again!!) :(
/MICUPRE
 
Months ago, I successfully loaded and built the then-current version of the convolution receiver under the Arduino IDE on my Teensy 3.2 board. Recently, I had a computer problem and had to delete and restore the Arduino IDE program. I did that and reloaded TeensyDuino. Now, when I try to compile it, I get this error:

fatal error: arm_const_structs.h: No such file or directory

I can find copies of this file on the computer, but I'm not sure where it belongs. Does anyone have any suggestions for how to fix this?

Joe
 
Hi Joe,

I am pretty sure you did not have the Teensy Convolution SDR on a Teensy 3.2, because the Teensy Convolution SDR does work only with Teensy 3.6 or Teensy 4.0.

It must have been a version of the Teensy SDR, which is a different SDR and works entirely in 16-bit fixed point and makes extensive use of the excellent audio lib.

The Teensy Convolution SDR is the floating point version (and the only one that I have been working on for the past two years). Do not try to compile it for T3.2, it does not work!

For Teensy 3.6: install the CMSIS DSP files before compiling (, for that you have to follow the procedure on the github readme page and the instructions from the link very precisely.

For Teensy 4.0: just compile the ino file as-is and it will compile and hopefully work! (no need to install CMSIS DSP files!)

Make sure you have the very latest versions of Arduino and Teensyduino and the latest version of the Teensy Convolution SDR (extensive changes pushed today).

Have fun with the Teensy Convolution SDR!

All the best,

Frank DD4WH
 
Frank

I realized after I got home last night and re-read my posting that I was wrong....it's actually a 3.6 board. It throws the same error anyway.

Yesterday I ordered a 4.0 board and its companion audio board. Hopefully I'll get the code to build for that.

Joe


Hi Joe,

I am pretty sure you did not have the Teensy Convolution SDR on a Teensy 3.2, because the Teensy Convolution SDR does work only with Teensy 3.6 or Teensy 4.0.

It must have been a version of the Teensy SDR, which is a different SDR and works entirely in 16-bit fixed point and makes extensive use of the excellent audio lib.

The Teensy Convolution SDR is the floating point version (and the only one that I have been working on for the past two years). Do not try to compile it for T3.2, it does not work!

For Teensy 3.6: install the CMSIS DSP files before compiling (, for that you have to follow the procedure on the github readme page and the instructions from the link very precisely.

For Teensy 4.0: just compile the ino file as-is and it will compile and hopefully work! (no need to install CMSIS DSP files!)

Make sure you have the very latest versions of Arduino and Teensyduino and the latest version of the Teensy Convolution SDR (extensive changes pushed today).

Have fun with the Teensy Convolution SDR!

All the best,

Frank DD4WH
 
Hi,

I'm looking forward to building the next SDR with Teensy 4.0 and the associated breakout boards. One of the thoughts that I'm having is, a larger LCD. Is there a larger version of the LCD that the program would scale to? Libraries permitting of course. I'm not sure if there would be libraries, that would help me plan.
Second, is or can this be integrated with SoftRock? Sorry about the noobie questions

/MICUPRE
 
Frank

I got my Teensy4.0 board and new version audio board yesterday. Before I begin to do battle with the Arduino IDE and try to build the code, I'd like to try an express checkout of the Teensy/Audio/4.0 code. Is there a Teensy 4 Convolution Receiver object code file somewhere that I can load into my board to get up and running fast before I proceed to more advanced stuff? Any Teensy 4 version that runs and displays a GUI will do.


Edit: I'm assuming that a GUI will display if the Teensy doesn't have all its peripherals, like SPI, etc.
Joe
 
Last edited:
Joe,

not sure if I understand correctly: Do you mean a sketch to check functioning of the T4 and audio board?

You could use the StereoPassThrough example from the audio lib.

Or try the convolution filter object by Brian Millier.

Or try a convolution filter like this:

https://forum.pjrc.com/threads/5726...nd-audio-board?p=217492&viewfull=1#post217492

You would have to add an object for the SGTL5000 and initialisation of the codec in the setup (but that is a good training if you would like to get the Convolution SDR running :)).
 
@MICUPRE

yes, a larger TFT with the ILI9341 controller and the same number of pixels should work. If you want higher resolution, you would have to completely reprogram the display.

Softrock should work. Does it have an Si5351 as LO? Then it should be easy to modify the code for the SoftRock.
 
Frank

I'm looking for an object file of a recent version of Teensy 4 Convolution Receiver that I can upload to my board and build on it with hardware peripherals one by one until I have a stable working hardware platform. Then I'll try to build the latest version of Teensy 4 Convolution Receiver source in the IDE and go on my merry way customizing to my ideas.

Joe,

not sure if I understand correctly: Do you mean a sketch to check functioning of the T4 and audio board?

You could use the StereoPassThrough example from the audio lib.

Or try the convolution filter object by Brian Millier.

Or try a convolution filter like this:

https://forum.pjrc.com/threads/5726...nd-audio-board?p=217492&viewfull=1#post217492

You would have to add an object for the SGTL5000 and initialisation of the codec in the setup (but that is a good training if you would like to get the Convolution SDR running :)).
 
@Joe: the Convolution SDR makes only very limited use of objects, it uses the audio lib queue object to gather the audio files from I2S and to push the files to I2S after treatment.

ALL the audio processing, demodulation, decoding is done in the loop of the SDR code. So, sorry, no easy way to build a small SDR receiver from objects.

If you like to go another way, you could try the AudioSDR object by Derek Rowell (https://forum.pjrc.com/threads/5736...o)-processor-demodulator?highlight=audio+sdr). He uses a single audio lib object for SDR audio processing. However, his SDR code differs in some respect: it is mono, so no stereo processing and he uses time domain filtering with Hilbert filters, which has influence on the low frequency response of the filters and the steepness of the filter skirts. And there are some features not (yet) present (frequency domain noise reduction, ZoomFFT etc.). So, its your choice ;-).
 
Frank

Perhaps there is confusion due to my nomenclature. In the old days, we spoke of the compiled code that executes on the microcontoller as "object" code, also sometimes as "hex" files or "bin" files. Today of course, the word "object" has taken on a whole additional meaning related to complex data structures in the source code. What I want is a good old fashioned compiled, executable code image of the Teensy Convolution Receiver, aka .bin, .hex, etc. Put another way, I'm looking for the code that the Arduino IDE uploads to the board. With this, I can test out my prototype hardware before moving on to code development and compilation.

Related, It seems that you have moved away from using the PJRC audio board to other ADC/DAC boards. Now that PJRC has a version of the audio board specifically for the Teensy 4, do you foresee going back? It makes it easier for followers like me to just buy a simple set of boards that are widely known to work together, plus some will already have these as part of their PJRC infrastructure loyalty.
 
@Joe: the only reason I did not use PJRCs audio board is that it did not work with my wild wiring :). Now with version D available it is no problem to use the PJRC audio board and the T4. The Convolution SDR code already accounts for that.

Sorry, but I do not deliver compiled hex files. The reason is that I have bad experience with this because of wildly different configurations: 25/27MHz oscillator for the Si5351, CLK1/2/3 of the Si5351 used, different RF filter configurations, different hardware configurations such as pins for TFT, encoders, buttons etc. etc.

And the main reason is: it is so easy to compile using the Arduino IDE that it is really not worth it . . . :). And it helps you to understand the code, which was one of the earliest reasons for me to put together this SDR code: as an educational project (for me and others :)).

In my former post, you can find some examples of test files to test your hardware configuration, although you will also have to compile them.
 
Frank

I understand your position. I'll just have to work a bit harder rather than take the lazy way out.

I'll get there.
 
Back
Top