Teensy Convolution SDR (Software Defined Radio)

Hi!
that looks like you have some sophisticated plans, very interesting!

Si5351:
* maybe you could experiment with the drive strength of the Si5351 which is software controlled? https://www.silabs.com/community/timing/forum.topic.html/si5351_output_impede-hiqv
* as far as I remember, you can also software-control the output capacity!? --> EDIT: this is wrong, the load caps for the crystal can be changed!
* And you could also try a 50 Ohms series resistor on the output
* I cannot report problems, probably because on my PCBs the maximum distance from the Si5351 to the Johnson counter is a few millimetres

IF:
* you are describing a very sophisticated setup which is difficult for me to understand, maybe there is also a misunderstanding of my concept of using an IF in *the digital domain*, NOT in the analog signal

I will try to explain the production of the spectrum display like it is designed at the moment:

* the Tayloe detector delivers a baseband signal which is already very well bandpass filtered with high Q (this bandpass filtering is an inherent feature of the Tayloe detector), so I think it will not be necessary to add another analog IF filter here
* we sample I & Q separately with a sample rate of up to 234ksps
* the I & Q seperately have to fulfil Nyquist, thus each deliver half of the spectrum display --> 234kHz / 2 = 117kHz
* together, I & Q give us a spectrum display width of a full 234kHz !!!
* So, there is no involvement of the digital IF up to now for the spectrum display
* the maximum available spectrum display width is always equal to the sample rate (which can be chosen by the user)
* NOW, for the demodulation of the signal, we internally shift the signal by [sample rate / 4] by multiplying the signal with a NCO [in reality, this is done without multiplication, but the principle behind is an NCO]
* after that, internally the signal that is demodulated is at baseband and can be treated by all kind of (convolution) filtering etc.

So, to conclude, we do not need IF filters of any kind, I think. But maybe I have not grasped correctly your suggestions.

The PCM1840 looks very interesting!
From my limited understanding -however- I do not think the main limitation would be the SNR of the ADC (which is pretty good with 99dB!), but the main limitation is the digital noise produced by the Teensy and the TFT, which is transmitted by the SPI wires and all kinds of clocks and received by the analog frontend.

Yes, your suggestion to use the Si5351 in quadrature mode for frequencies of 4MHz upwards and together with a Johnson counter for receive frequs lower than that is excellent!

73 de Frank DD4WH
 
Hi Frank,

Si5351
I think you are right. Thank you for the link - I reviewed it and also re-read the data sheet. When I get back to the radio, I will check to see that I have the setting at 8 mA. It sounds like I don't.

IF:
Youngblood explained the compromise in IF bandwidth in part 4 of his famous "A Software Defined Radio for the Masses". Equation 1 shows the formula for bandwidth of the QSD. And the text immediately after the formula explains, "A tradeoff exists in the choice of QSD bandwidth. A narrow bandwidth such as 6 kHz provides increased blocking and IMD dynamic range because of the very high Q of the circuit." He then goes on to say that he is willing to trade off some of the IMD-reduction potential of the QSD filter for the spectrum display and also "for sophisticated noise and interference reduction."

My thought with having two IFs is that we could have one narrow (for good IMD-reduction) and one wide (for noise blanking and spectrum display). Upon reviewing the data sheet for the PCM1840, it may not be as simple as I thought. It looks like I2S can only handle two audio channels. So for 4 channels, we would have to use TDM instead of I2S - I don't know how hard this will be to implement. And it looks like they also limit the input bandwidth to 80 kHz but this is not clear from the data sheet. Maybe two PCM1808s is the way to go?!

For CW work and also for SSB, close-in IMD is very important in a receiver. IMD is an analog radio measurement that isn't exactly useful for an SDR. The SDR equivalent is overloading the ADC. The idea is that the receiver must be sensitive enough to hear a very weak signal when there is a very strong signal 2 kHz away.

A decent CW receiver has a noise floor of about -130 dBm with a 500 Hz bandwidth and least 90 dB of close-in (2 kHz) dynamic range. See: http://www.sherweng.com/ctu2012/NC0B-CU-2012-6a.pdf
Rob Sherwood, NC0B is the sort of guru of amateur radio receiver testing. The link above is a presentation he gave. He also has other good info: http://www.sherweng.com/index.html. And he tests all the commercial ham equipment and posts the results on his website. You probably know this already.

In order to get 90 dB IMD, a narrow IF filter is generally required. If I tune to a very weak signal at say 28.010 MHz with a strength of -120 dBm, the AGC will turn up the receiver gain - which is what it should do. But, if there is another signal at 28.012 MHz that is -30 dBm, I would like not to be bothered by that stronger signal. The problem is, the AGC will see the strong signal and turn down the receiver gain so I will no longer hear the weak signal. The old analog way of doing this was to have a 500 Hz IF filter that attenuates the strong signal so the AGC does not detect it. EDIT - This is actually blocking not IMD, but the same idea.

But the PCM1808 is capable of 99 dB of dynamic range. Still, the AGC would have to set the gain exactly to achieve this as receiver dynamic range. Maybe it is possible and I am stuck in an old way of thinking? This is why I dusted off my RF books, and bought new DSP books, and decided to learn about these interesting SDRs. It is a different world than my experience which is all analog RF.

Receiver noise:
I agree that all those clocks and Teensy noise getting into the receiver is a problem. When I built my receiver, I put a shield behind the TFT, and another shield between the analog components (receiver and PCM1808) and everything else (I posted pictures a while back). And I used coax to take the I2C signals and LO between the analog section and the digital section. And I used separate DC regulators for pretty much every circuit. Still, I have lots of birdies. Back years ago, when I was designing microwave radios, this was a problem that I got fairly good at solving. But it takes a lot of work to isolate the digital noise from the receiver circuitry. And I depended on a spectrum analyzer, calibrated antennas, and a giant RF chamber, which I do not have access to anymore. But I suspect that it is a solvable problem with proper shielding and isolation of the various components.

73,
Bill WH7U
 
On another subject, I wanted to see if I could make a transformer that covered from 100 kHz to 200 MHz for the input to a wide-band QSD. This is a very large bandwidth for one transformer.

A 2-core transmission-line transformer can provide good unbalanced to balanced 50 Ohm to 200 Ohm very wide-band performance (if you don't need to ground the center tap of the 200 Ohm side, you only need one core). But it requires the impedance of the twisted pairs to be accurate for the high-frequencies. For this transformer the impedance of the twisted pairs needs to be 100 Ohms.

So I tried a pair removed from an Ethernet Cat 5 cable (Cat 5 contains 100 Ohm twisted pairs). This worked but I couldn't get enough turns into a reasonable size. So I twisted up some #30 AWG Kynar wire-wrap wire which is about 100 Ohms. I tried two FT-37-43 ferrite cores but can't get enough turns onto them for 100 kHz (it did make a great 600 kHz to 200 MHz transformer though). I tried this same approach on larger cores and had fairly good results - I should have twisted the wires tighter though - I didn't quite hit 100 Ohms.
See attached pictures. I thought some folks might be interested in this transformer for their designs (even though it is rather large).

IMG_4916.jpg
IMG_4917.jpg

73,
WH7U
 
Hi!
* maybe you could experiment with the drive strength of the Si5351 which is software controlled? https://www.silabs.com/community/timing/forum.topic.html/si5351_output_impede-hiqv

Frank, you are a genius! I found that my Si5351 drive strength was set very low. I turned it up to 8mA and added a 50 Ohm resistor to my receiver and it came alive! It is working much better now and all the weird noise is gone.
Thanks for the tip.
In case anyone else might be having this problem, the changes to the code (assuming DD4WH hardware) to ensure full clock drive are only 2 lines.

Somewhere around line 860, after the line...
#define Si_5351_clock SI5351_CLK2
add the line:
#define Si_5351_drive SI5351_DRIVE_8MA

and somewhere around line 3900, after the line:
si5351.init(SI5351_CRYSTAL_LOAD_10PF, Si_5351_crystal, calibration_constant);
add the line:
si5351.drive_strength(SI5351_CLK2, Si_5351_drive);

That sets the Si5351 to maximum output which is what you want to properly drive the Johnson counter.
73,
Bill WH7U
 
Hi Bill,

good to hear your setup works with higher drive strength. I use the default 2mA and it works, but could have to do with shorter wires.

You made a very good point in discussing the trade-off between dynamic range and spectrum display width.

Maybe this could be achieved by building a receiver with two different Tayloe detectors with different bandwidths and two stereo ADCs? The T4 has two or more different I2S inputs, so theoretically it should be ready for this kind of setup.

The AGC is not the problem, because it is a software AGC which acts on the I & Q audio channel directly after the convolution filtering. So, a very strong signal will not mask a weak signal by overloading the AGC, if it is not inside the digital filter bandwidth (but could overload the ADC). Also, the built-in frequency domain noise blanker is as effective (or even more effective) as an analog wideband noise blanker, but does not need a wide bandwidth, but also acts directly on the digitally filtered audio signal.

Two things come to my mind while thinking about these high dynamic range figures:

1.) the SDR was designed as a pocket receiver with low power supply requirements, thus it has some trade-offs already built-in because of design

2.) with a Tayloe frontend, the main restriction in dynamic range would be -from my understanding- the analog frontend filter between antenna and Tayloe QSD. The filtering has to be really really tough to suppress 3rd harmonics of the receive frequency (because at this 3rd harmonic, the Tayloe only has an attenuation of 9dB !). If this analog filter does not fulfil your high requirements, the whole receiver will not have excellent dynamic range. In my hardware, for example, I could not get reasonably easy-to-build analog filters to suppress 3rd harmonics by more than 50dB. As far as I can judge, "only" 50dB + 9dB of stopband attenuation of the 3rd harmonics will largely compromise your total receiver dynamic range, but I am not sure whether that is really true in a real-world receiver . . . what do you think?

73 de Frank DD4WH
 
for wideband transformers, I have good experience with FT77 ferrite material ring cores and also with binocular cores 73-202. Using this ferrite material leads to better results in the VLF range (however, I have no measurement data on that, only my ears).
 
Maybe this could be achieved by building a receiver with two different Tayloe detectors with different bandwidths and two stereo ADCs? The T4 has two or more different I2S inputs, so theoretically it should be ready for this kind of setup.
I think this is probably the best way to go. The narrow IF could have smaller integrating capacitors so a naturally narrower bandwidth.

I know that this project was not meant to compete with the top end receivers out there. But you have built all the difficult pieces in DSP - the performance of those filters and the sideband rejection has impressive specs. I am simply looking at ideas that might lead to some performance improvements. This is fun and helping me dig in and learn. I do think it could provide an affordable receiver with performance approaching the expensive commercial radios being sold. I am having fun thinking about how to optimize the design, but still in the steep part of the learning curve here. Receiver design is challenging!

I do keep forgetting that the AGC is all in software. A while ago, Frank B mentioned adding a selectable gain before the ADC. Going back to my example, if I have enough gain before the ADC to receive a signal of -130 dBm, and the ADC has a dynamic range of 99 dB, then any signal over -31 dBm will overload the ADC (-130dBm + 99dB = -31dBm). If I decrease the gain of the op-amps to prevent overload of the ADC, then my -130 dBm signal will not be received. A high-end receiver has a blocking spec of 130 to 150 dB. I don't think they use ADCs that have much more than 16 bits. I is difficult to get more than 100 dB from an ADC. I suspect that they have some of the AGC in front of the ADC. Perhaps variable gain settings on the op-amps of 0, 20dB, and 40dB will allow the Convolution SDR to handle both large and small signals. An analog AGC is another option.

You are right about the front-end filtering. Filtering the out-of-band signals with front end filters is tough. This was the reason the most recent amateur radios went from high-side IF to low-side IF over the past couple of decades. Building roofing filters for high-side IF is very difficult. But this is the advantage of a superhet receiver over a direct conversion receiver; it can mix the entire band down in frequency where it is easy to build steep analog filters. I don't know what it is like in Europe, but in the US, the AM broadcast stations are very powerful from 550 kHz to 1600 kHz. They often transmit with full sized vertical antenna arrays and hundreds of thousands of Watts of transmit power. And the FM stations from 88 MHz to 108 MHz are also very strong. They are both a real problem for HF receivers. The FM stations are bad because they are at the odd harmonics of the ham bands. And the AM stations are a different problem because the low frequencies are found on ground wires and power wires and are difficult to control (when your ground connection has 1/2 Volt of RF from a station at 900 kHz, what do you do?). I helped a lady once who heard music coming out of her toaster! It was a nearby AM station somehow getting rectified by a poor connection in her toaster and the heating element insulators were acting like speakers. I am not kidding. She had something like 10V of RF in her house wiring.

One trick is to use balanced filters but they get complicated and have more parts. Your 50dB of attenuation is good performance for a single filter. More than that usually requires two sets of filters each inside metal enclosures (the RF on the input of any circuit couples to the output at a level of something like -60dB to -90dB). Most of my experience is with microwaves which are worse, but I think the number is typically something like -60dB to -90dB for HF and VHF. So if you build a filter that has 500 dB of stop-band attenuation, it will not do you any good because a tiny bit of the RF will sneak past the filter and spoil all your hard work. Using multiple shielded filters can give performance much higher than 90dB, but we are straying away from simplicity again :) But you are correct, to achieve 99dB performance, the filters will need to reject the 3rd harmonic by >90dB. They need to be more than that because broadcast stations are more powerful that ham stations. This is a tough filter in the real-world. Older receivers often had preselectors - a knob on the front that tuned a narrow filter - maybe this is an idea we could investigate.

73,
Bill WH7U
 
Just to let you know I uploaded a new version of the software to my github.

* Teensy 4.1 support with DO7JBH hardware (and a self-built T4.1 to T3.6 adapter)
* Menu Assistant by tisho (thanks a lot, tisho!)
* more convenient tuning step indicator and more tuning steps (thanks a lot, tisho!)
* some small bug fixes (it seems, the T4.x sometimes gets a hickup when switching off and on again the audio interrupts . . .)
* complete redo of the ZoomFFT in order to substitute IIR lowpass filtering by the built-in polyphase FIR filters in the CMSIS decimation routines. That also fixes the long-standing bugs of using the wrong sample rate in the IIR filters and using the wrong coeffs with higher Zoom factors. At the moment, zoom factors up to 2048x are now correctly implemented (in former versions, this was only the case up to 256x).

Beware, I am not sure anymore whether the recent version still supports T3.6, but I will test with my older T3.6 SDR hardware in the next days

It is quite hard to try to support all the different hardware versions . . . and I fear I am not particularly successful in that.

https://github.com/DD4WH/Teensy-ConvolutionSDR
 
This is fun and helping me dig in and learn. I do think it could provide an affordable receiver with performance approaching the expensive commercial radios being sold. I am having fun thinking about how to optimize the design
Yes, fully agreed! :)

AM mediumwave stations do not pose problems any more here in Central Europe, because most countries have shut down all or many of their transmitters! (eg. Germany, the Netherlands, France, Belgium etc.). But I heard similar reports on high power AM QRM from other hams from your country! However, you are absolutely right about FM stations, I have 6 x 100kilowatt FM transmitters about 4km from my house :).

Yes, I really like those old school preselectors! My first SDR with a Teensy 3.2 had a preselector like that (this design: https://dd2nu.darc.de/BCC.html), it also served as a manual attenuator!

73 de Frank DD4WH
 
Oh nice. Preselectors are great. I think a good set of filters plus a preselector might be a good idea. The only people who don't like preselectors are very lazy people :)

Thank you for updating the code. I am excited about Tisho's menu assistant and tuning steps and the bug fixes! I have not loaded it yet because I have some settings I need to put in for my setup, but I am going to go work on that now.

I was playing with the FFT functions on my new oscilloscope this evening, looking at the Si5351A output. I see a problem.

I disconnected the Si5351 from the receiver and looked at the output on my scope in FFT mode. I tuned the radio to near 10 MHz and looked at the Si5351 output at ~40 MHz.
Here are the radio settings:
IMG_4919.jpg

And here is the spectrum with the LO disconnected from the radio:
IMG_4920.jpg

Then I tuned away from the 10 MHz LO frequency slightly:
IMG_4921.jpg

And this is the spectrum of the Si5351:
IMG_4922.jpg

And when I reconnect the LO to the radio, I see the same in the spectrum display:
IMG_4923.jpg

So I think there is something wrong with the Si5351. Maybe it is getting jittery settings from the Teensy or something. What do you think?
I am going to go look at the code to see if I can find something.

I have a dummy load connected to the antenna port for all of the images.

73,
Bill WH7U
 
For the new software, I get this error compiling because the define is only called with HARDWARE_DO7JBH_T41 enabled.
error.png

73,
Bill WH7U
 
Bill, I tried to exactly reproduce the situation you described:

* 50 Ohms resistor on the antenna input

1-IMG_20200830_130628273.jpg

So, the spectrum looks similar, BUT: the birdies are very very low signal strength. the overall noise level is very low (-128dBm in 500Hz bandwidth)

If I tune 500Hz up, the spectrum looks like this.

1-IMG_20200830_130650277.jpg

Now I tried to tune, so that the birdy is directly inside the passband to measure its signal power.

1-IMG_20200830_130828170.jpg
--> -111dBm in 500Hz bandwidth is not that bad and is in the expected range, I think.

Then I used my measurement direct sampling receiver to measure the LO signal of the Si5351.
* I used 52MHz LO and divided-by-4 --> 13MHz, because my rx does not receive at 40MHz
* I use a short telescope antenna to catch the Si5351 LO signal
* I verified that I am REALLY looking at the LO signal by tuning left and right and watching the signal pass by in the measurement receiver
* You can see the spectrum of the Si5351 LO signal is reasonably clean
1-IMG_20200830_132209303.jpg

So, what to conclude from this . . .
Our hardwares behave differently. There seems to be a hardware problem in your Si5351 path, what do you think?

73 de Frank DD4WH

P.S.: something completely different:

You should take care for cooling down your T4 processor! 60 degrees is too hot, I think. I get a maximum of 45 degrees, but never more than 47 degrees. Is your T4 processor covered by something or do you overclock it?
 
For the new software, I get this error compiling because the define is only called with HARDWARE_DO7JBH_T41 enabled.

Thanks for pointing me to that, You are right, I built that bug. Will try to solve that this evening.
 
So, what to conclude from this . . .
Our hardwares behave differently. There seems to be a hardware problem in your Si5351 path, what do you think?

You should take care for cooling down your T4 processor! 60 degrees is too hot, I think. I get a maximum of 45 degrees, but never more than 47 degrees. Is your T4 processor covered by something or do you overclock it?

Interesting. Perhaps it is because I am using the 8mA setting on the Si5351 or have a termination problem. I am also running the LO through a length of coax - I may have an impedance mismatch. I will investigate later today.

I too was alarmed at the temperature reading. But if I put my finger on the Teensy processor, it is not hot. I have not tried to troubleshoot that one yet.

73,
Bill WH7U
 
Is it possible to automatically search for valid channels and save the frequency?

Not sure what you mean exactly? What are "valid channels"?

Do you want an automatic frequency scan search for stations and save their frequencies in memory?

That is not implemented at the moment.

73 de Frank
 
I hope, the new version solves this problem.

73 Frank

The new version solved the problem. I have it running now. Thank you Frank! Now I have to learn how to use Tisho's menu!

I am embarrassed to say that I figured out the problem with the LO birdies and the problem was me. It turns out that the FFT mode in my new oscilloscope does not include an anti-aliasing filter. This is what I get for buying a cheap scope I guess. Sorry to make you do all that work trying to help me figure it out.
I now plan to build a little RF amp with a low-pass filter in it to make the FFT mode on my scope something other than useless.

In other news, the LO had a lot of ringing on it even at 8 mA drive. And terminating it in 50 Ohms dropped the level quite a bit. Between the ringing and the low level, it was acting strange. So I put an emitter follower on the Si5351 board and now it drives the coax and 50 Ohm termination well. I get nice square waves now at about 2.5 Vpp.

The way the birdies move through the spectrum display much faster than real signals (and sometimes in the wrong direction) makes me suspect that they are aliases in the ADC. To test this, I fixed the IF frequency at 25 kHz and changed the sample rate. The spurs move when I change the sample rate, so this confirms my suspicion. I think a low pass filter on the input of the ADC will get rid of them.

73,
Bill WH7U
 
Is DAC sample rate always equal to ADC sample rate or not? If it is,I want to use a audio codec to sync the I/O sample rate.
 
Is DAC sample rate always equal to ADC sample rate or not? If it is,I want to use a audio codec to sync the I/O sample rate.

Yes. At the moment it is programmed like that. Synch is not a problem, because both, the ADC and the DAC use the same master clock MCLK provided by the Teensy.

Paul, did you already build a Teensy Convolution SDR? If not, I would recommend to do so and after that, you can start to optimize things. There are a lot of things to optimize, I am sure :).

If you want to use a codec instead of separate external ADC and DAC, why not start with the Teensy audio board, which uses the SGTL5000 codec?
 
Hi Frank:
Now I am learning code porting on malahit sdr receiver. Arduino is strange for me now.I have builded a template now on MDK. Msi001 tunner chip is very convenient.
 
Yes, the Malahit is a nice receiver, but unfortunately closed source.

If you port the software to the STM32F7 or H7, please keep it open source and it would be very nice if you posted a link to the software source here in the thread. Thanks in advance!

For a STM32H7/STM32F7, you may also consider using the excellent UHSDR software, which is a full grown transceiver software, not only receive, but specifically for the STM32 family
 
Back
Top