For the last month I’ve been working hard on prototyping the SM2000 – an open source VHF radio. It’s purpose is to test some advanced VHF/UHF ideas I have for FreeDV.
The SM2000 will be a small box (like the SM1000), that contains a fully functional VHF SDR Digital Voice radio. It will run advanced open source Digital Voice modes, have a 1W power output and adequate tx/rx filtering for real-world operation on the 2M band. No Host PC required. Open Hardware and Software, price TBD but a few hundreds of $. It will also run analog FM but no modes with a proprietary codec.
Just yesterday I demonstrated demodulation of 1200 bits/s 2FSK at -135dBm, right in line with predicted performance.
This is an important milestone. Analog FM and first generation digital voice (D-star/DMR/C4FM and friends) fall over at about -120dBm. One of my aims is equivalent performance to these systems at 10dB lower. With completely open hardware and software.
I need custom RF hardware to develop and demonstrate VHF DV ideas I have formed over the past year. However I am not a RF expert, am just one guy, and have limited resources. So I will focus on those areas that I can uniquely contribute to. Choose my battles. In other areas (e.g. certain aspects of RF performance), I will just shoot for acceptable.
I have a similar approach to architecture. There are many ways to build a radio, and I have chosen one that suits me at this time. Feel free to warm up your soldering iron and substitute your own favourite.
What I care about:
- I don’t trust any part of the modem being in hardware. This means software defined waveforms, and SSB style up and down conversion. Direct FM is out. And don’t get me started on data running through analog FM modems.
- TDMA needs a “bare metal” uC for hard real time, so no OS. Host PC/USB peripheral type designs won’t work.
- Functional demos of advanced features such as sub -130dBm Digital Voice, $100 TDMA repeater, diversity to handle multipath, low cost, open hardware and software.
- No chip sets or SoCs. This is open source. I need control.
- Don’t have to a tick all boxes first time around.
- Minimal cost
- Sparkling RF performance in areas such as phase noise, IP3, blocking, ACR, high tx power, multi-band operation, low spurious, power consumption. The RF Gurus can do that better than me so I’ll leave it to them.
- Gold plating – is the feature going to add to our schedule? Can anyone else implement it? Will it introduce risk? Who will step up to make it happen?
Your Suggestions Welcome
But I’ll probably ignore them. What I really want is your contribution. If you want your-favourite-must-have-feature to happen, step up and make it happen. Innovation is 1% inspiration and 99% perspiration. I get overwhelmed by well-meaning people with inspired ideas, and underwhelmed when I ask them to help implement those ideas.
Can you make my TODO list shorter, not longer? Now you have my attention.
The receiver is a dual conversion superhet, with IFs at 10.7MHz and 24kHz. It is designed primarily for constant amplitude waveforms such as FSK, so does not have an AGC.
I used this Gain and Noise Spreadsheet as a tool to design the radio. It calculates cascaded NF, the NF of the ADC, and the gain required to get the MDS we need. I also have some sub-sections that I plug numbers into as I test, e.g. for NF calculations, and tuned circuit calculations. Very useful.
I haven’t designed the first BPF yet, but anticipate it will have a low loss (to maintain system NF), and a fairly broad response.
The PGA103 is a 0.5dB NF, 20dBm input IP3, 20dB gain block which sets up the overall receiver noise figure of 1.5dB. It’s major disadvantage is high power consumption (90mA at 5V), so I am considering a discrete transistor amplifier here.
The BPF near the mixer provides attenuation of out of band signals. Through a process of slightly mystified experimentation I have settled on a double tuned circuit:
Which has a response like this:
For reasons I do not understand (parasitic capacitive coupling?) changing the position of the coils relative to each other sets the position of the notches. I’ve set up the 60dB notch on the 126MHz image frequency. I’ve built it a couple of times with the same dimensions and the response is quite predictable. Each coil is 6 turns wound on a 1/4 inch drill bit, with a tap at half a turn for the 50 ohms input and output. The other end of each coil has a 12pF trimmer cap.
A Si5351 is employed for the local oscillators. For the purists I will include a Si570 option for the first LO. The RF switch for the two Si5351 outputs is to support diversity (two channel) reception. The radio can quickly shift to a channel a few hundred kHz away to receive a packet, effectively receiving on two frequencies at the same time.
I’m using a SBL-1 mixer but will move to an ADE-1. The RF Gurus tell me that termination of the IF port of the mixer is important. So I’m using a 15dB gain Termination Insensitive Amplifier (TIA) that presents a 50 ohm load to the mixer over a wide range of frequencies. I swept the TIA input using a return loss bridge and confirmed around 20dB return loss out to 300MHz (the sum of the LO and RF signals). The TIA has bandwidth of 50MHz which should effectively filter out the LO+RF IF signal.
A 10.7MHz 15kHz wide crystal filter attenuates off channel signals (47dB down at +/- 25kHz) and performs bandpass anti-aliasing filtering for the ADC. To get a nice flat response there is some impedance matching either side of the crystal filter.
I messed around with a few 2nd mixers (sub harmonic, discrete transistor, diode). I had some problems with noise when using a transistor mixer (LO injected into emitter, RF into base) which held me up for a few days. Then I tried a NE602 and it worked really well, and provides some gain. With a good Z-match on the input the 2nd mixer noise problem was gone. So that will do for now.
The baseband amp takes the 24 kHz IF and boosts it 50dB before feeding it to the uC ADC. It’s just two transistors with emitter degeneration to set the gain. The ADC is configured to sample at 96kHz, and upload samples to a Host PC via USB. I can then use a GNU Octave script (e.g. fsk_horus.m) to demodulate the FSK signal.
I am designing for test, e.g. using 50 ohm building blocks. This allows me to break out each section and test separately, for example sweeping the crystal filter, or driving the TIA with a 10.7MHz FSK signal, or measuring NF of a section.
I have been testing the Bit Error Rate (BER) performance from the very early building block stage. This measure neatly defines the performance of a digital radio. Much better to test BER early than wait for final integration and have dozens of problems to solve. We want to know as soon as possible if there is a problem.
This block diagram shows an example of testing from the IF down:
I modified the fsk_horus modem to support 1200 bit/s and a sample rate of Fs=96kHz. This is a well tested modem that has performance bang on ideal.
The radio is implemented with garden variety transistors, the most exotic parts being the ECS M15B crystal filter, SBL-1 mixer, PGA-103 LNA, and NE602. There are no transformers. I have used some toroids to wind my own inductors however these are not critical in terms of Q or tolerance and can be replaced with off the shelf parts.
There are three trimmer capacitors that need aligning with the use of a spectrum analyser. Although it may be possible to have an alignment mode, e.g. use the Si5351 to sweep a test signal, sample the signal and display a spectrum on a Host PC.
I used Manhattan style construction:
The two PCBs in the background are a STM32F4 Discovery board and an OpenRadio which I’m just using for it’s Si5351 outputs.
I didn’t even need a printed circuit board to prototype and reach the -135dBm performance milestone. This has allowed me to remove a large chunk of risk from the project very early on – a huge benefit.
I think it’s remarkable that with rough construction, no shielding, a poor layout to the STM32F4 ADC, I can demodulate such weak signals. I guess the engineering is subtle and not related to the physical appearance. It does go crazy when I key my HT next to it though!
When we do move to a PCB the same parts in surface mount packages will result in a nice compact design.
- Build a 1W transmitter prototype. In particular deal with RF amplifiers and diode switching to make a TDMA transciever.
- Testing of the receiver, e.g. other specs apart from MDS
- Work with Rick, KA8BMA, to develop a Rev A prototype PCB version of the entire radio.
- Lots of software work
- The 1200 bit/s 2FSK modem has been used so far as it’s what I had lying around. For the final system I’m favouring 4FSK at 2400 bit/s which I estimate will work at -132dBm. So need to get 4FSK running soon.
- Work towards functional demonstration of the project goals.
I haven’t planned any further forward. I’m not sure when a SM2000 product will emerge. Some time in 2016 I guess. Sooner if you help!
I’m documenting this here so I don’t forget.
Use fsk_horus to generate modem signal at Fs=96kHz. Use hackrf_uc.m to up-convert to IQ samples at Fs=10MHz for replay by the HackRF. hackrf_uc.m also adds a 700kHz offset (IQ designs have a black hole at DC).
For testing the IF we can then play a 10.7MHz signal from HackRF using:
/codec2-dev/octave$ hackrf_transfer -t fsk_10M_EbNo80dB.iq -f 10000000 -a 1 -x 20
For testing at 146MHz input of the radio use:
~/codec2-dev/octave$ hackrf_transfer -t fsk_10M_EbNo80dB.iq -f 145300000 -a 0 -x 15
Note the 700kHz offset.
In both cases adjust the -a and -x options and use an attenuator to get the level you want for testing. The level can be checked on a spec-an, although this gets tricky beneath -120dBm.
Simultaneously sample by flashing the STM32F4 Discovery with adc_rec_usb.elf, and then upload Fs=96kHz samples using:
~/codec2-dev/octave$ sudo dd if=/dev/ttyACM0 of=test.raw count=10000
Then demod using fsk_horus:
Fs: 96000 Rs: 1200 Ts: 80 nsym: 1200
demod of raw bits....
centre: 23976 shift: 1272 twist: -1.4 dB
coarse offset: 1192 nerrs_min: 25 next_state: 1
frames: 13 Tbits: 14400 Terrs: 2 BER 0.000 EbNo: 12.23
Here is a plot of the STM3F4 ADC with -135dBm at the rx input:
You can see the passband of the crystal filter – the internal noise from the radio front end passed through the filter creates the trapezoidal spectral shape at the input to the ADC. The two lines in the centre are the low and high FSK tones centered on the 24kHz IF, the hump of “noise” between them are part of the FSK signal. Not sure what that line around 17kHz is all about.
The lines on the far left are harmonics of the 1.2kHz interrupt service routine on the STM32F4. I cleaned most of this noise up with some power supply filtering, it was initially 20dB higher and all over the spectrum:
A little noise goes a long way with 100dB of gain.
Measuring Noise Figure with the Rigol DSA-815
After lots of reading on NF and a few false starts, I can now reliably measure noise figures, e.g. in my LNA, mixer, BPF, and IF amplifiers. For example the TIA amplifier is spec-ed at 5 dB and I measured 5.2dB. I have also measured the single (BPF in front) and double sided NF of the SBL-1 mixer and they were 3dB apart.
You need to have noise above the noise floor of the 815. With the 815 terminated in 50 ohms I measured -162dBm/Hz, which suggests a NF of 12dB. With gains of greater than 20dB on the device or system you are measuring, the numbers from the 815 start to make sense. So plan your tests such that the measured No is higher than -140dBm/Hz.
Here are the Rigol settings I use:
- Amplitude: attenuation 0dB. Pre-amp On
- BW/Det: sample
- Trace/P/F: Power average
- Marker Function: No function (to measure gain) Noise Marker (to measure No)
The procedure is: measure the gain G using a test signal, then switch the test signal off, terminate with 50 ohms, and measure No (noise power/Hz). NF = No – G + 174.
Here is my working for an earlier LNA-Mixer-IF amp combination:
Input power -80.00
Output power -10.00
Noise pwr -102.20
My design had a calculated NF of 1.3dB, so 1.8dB is reasonable given the 1.5dB accuracy of the 815. I have a spreadsheet setup so I can just plug the numbers in.
Mel K0PFX, and Jim, N0OBG for buying me the spec-an, which has been invaluable. Neil, VK5KA, for RF advice; John VK3IC and Craig VK3CDN for cables, test equipment, and RF advice; Matt, VK5ZM and Brady for bouncing ideas off; Glen English for RF guidance and in particular explaining ADC NF.
Brady pointed me at the DSP10 2M radio from 1999 which turns out is very similar to what I have come up with! Some very similar design decisions, and a useful example for me.