Software Defined Radio

I present my exploits with SDR. You'll find the open source in C# for an AM receiver.

It's about time I got around to playing with Software Defined Radio. There have been several amateur designs kicking around since 2004; so it's time to start playing. I'm pretty familiar with a lot of the technology - I just haven't put all the bits together!

I and Q quadrature components?  Been there, done that with modems 10 years ago. (Not to say U/V PAL colour from the good old telly bashing days.)

DSPs - yes from college projects. (High speed systolic multiplier accumulators, designed with hardware simulators.)

What does the hardware involve?

An oscillator

A couple of 7474 flip flops to get a 4 phase switch

A commutator switching IC (FST3253)

An audio amp / filter

A sound card

A PC with some clever DSP software.

An Aerial!

What do I need to get started?

An excellent way to start is with a kit for £30. Here's the ad from Walters and Stanton:

SOFTROCK-V6 * NEW * Software Defined Radio 40/80m Kit (jumper on board for bands)

* 40/80m band (jumper on board between bands) * Crystal frequency 28.060MHz divided down for 40 & 80m * QSD mute if required * Rocky SDR program provided * Requires PC - works in conjunction with soundcard on PC * PCB size 38.1 x 48.26mm (1.5 x 1.9in) * Supply 9-12V DC * Build time approx 3 hours (contains surface mount components) * 40m with a soundcard 48kHz sampling rate - 7.032 to 7.08MHz. 96kHz sampling rate 7.008 to 7.106MHz * 80m with a soundcard 48kHz sampling rate - 3.504 to 3.552MHz. 96kHz sampling rate 3.48 to 3.576MHz.
This kit contains 1 PCB plus all the components to make up the board. Does not include audio cable. There are a number of surface mount components so a certain amount of skill is required plus the right type of equipment. A grounded tip soldering iron (15 to 20W) is required with a small tip. Some form of visual magnification such as an 'OptiVisor' is essential. SoftRock Kit supplied with CD-ROM with builders notes, schematic on PDF and Rocky Software program.

What are my aims?

Experience the results! Does it cut the mustard?

An exercise: cut code in C# to get an AM detector and IF at 22.050 kHz. (This I've started before I build up the Softrock - there's enough sample I Q .wav files available on the web.) An enhanced version of this code can be seen here.

Bernie's Comments:

One good thing about these software defined radios is that you set the filtering completely - i.e., not just filter width but upper edge (say 3.5 KHz) and lower edge (say 300Hz), and because these filter responses are very sharp, you get a really good feel for the effect of varying the actual cut-off frequency - try it on a broadcast AM signal too (in either sideband mode [being crystal controlled, you can get the carrier frequency set within a Hz or so, and completely loose the Donald Duck effect normally associated with SSB reception. Truly fascinating.

All the hardware has to do is to mix a window of RF down to ħaudio - the difficult stuff is all in the software (and soundcard hardware), and you already have that (it's the expensive bit too, of-course - i.e., the PC).

Am I saying the obvious? - if so, read no further.

The hardware needs frequency stability, which it has because it's crystal controlled, and a modicum of signal handling capability. Now I think (from what I have read previously) that the Softrock hardware uses a high speed cmos quad switch, each commutated at 90 degrees (i.e., the switch control feeds are at 0, 90, 180, and 270 degrees). This is easy to do using an oscillator at x4 frequency and a pair of JK flip-flops. One pair of switches are combined to give I, the other to give Q. You won't have much RF filtering, but the only spurious responses will be harmonics of the LO, i.e., at least an octave away, which is about as easy as it gets radio wise.

The performance limiting section is the sound card, so you want a card that has the highest resolution and most important of all, highest dynamic range - but this is also what is wanted in the most demanding soundcard applications, so a high-end soundcard should also be best in this role.

I guess what I'm saying is, don't expect crappy performance. The Softrock may be only thirty quid, but the 'real' cost needs to include the PC and soundcard, which of-course, you have already previously bought.

I hope you'll do software for a Tx path, using the soundcard I hope! Hardware wise, the current softrock board could be used totally unmodified (apart from linking out the two op-amps. The commutating mixer is obviously bi-directional.

The Softrock v6 uses a 28.224 MHz crystal, so on 40m you will be centred on 7.056, which is fine - you'll get both the CW and SSB parts of the band, but when you link it for 80m, you will be centred on 3.523 MHz, which is a little low. You'll get all the CW end(!), but very little of the SSB section.

I suggest initially linking it for 40m.

The circuit does have front end filtering, and it uses the quad cmos switch as a commutating mixer. At most, this passive mixer has only 3dB of loss, so no RF amp is needed, and it will have very good signal handling performance - as good as any professional receiver. Not bad for thirty quid.

If you're not astounded at the performance you get, I'll be very very surprised.

I think the educational quota per buck is very high on this project.

The Softrock V6 design musings

Audio coupling caps

The audio coupling caps seem a bit light - 0.1uF.

Absolutely - I use at least 10uF!, and it does matter because one is trying to keep the two channels tracking accurately (to maintain the phasing accuracy). To use 0.1uf really implies that a 1% component be used - and I bet it isn't.

I guess the software is running an IF at 11.025 kHz so "bass" doesn't really matter.

No! You are using all the spectrum from DC to 48 (or 96) kHz as far as the hardware is concerned. The IF - which can be anywhere in that range, is completely a software realisation AFTER digitization.

Audio Amp Gain

I question another part of the design: The mixer output looks like 50 ohms (it's just commutating the RF path, which is 50 ohms), so the op-amp gain on the I and Q paths have a gain of 4990/(50 +10) which at 100 or so is a tad high, given that the two op-amps must track perfectly. I would have used two op amps each with a gain of 10.

I also question the caps shunting the output of the commutating switch. Apparently they convert the commutating switch from a mixer into a sampling detector. What the RF impedance sees, and what the audio amp input impedance sees needs a bit of contemplation.

The Kit Arrives

An Essex voice: "Dunno" - intake of breath - "A week to 10 days sir."

Top SideTop side
Botton SideBottom side
Bag of bitsBags of bits
WIPWork in Progress
WIPBottom side completed
Switching clocksTayloe Detector switching clocks

Initial appraisal

I've been using the supplied Rocky exe. I'm impressed.

On 80m there's usually 5 or so CW stations. (ITU Europe: 3.5 - 3.8MHz)

On 40m there's CW and SSB. All resolvable. (ITU Europe: 7.0 - 7.2MHz)

Some comments:

1, Would you expect to be able to resolve SSB if you've only got one audio channel connected? (I can!) I can disconnect the I or Q  channel - no problem!

Yes. What you wouldn't get is any unwanted sideband rejection. Select either LSB or USB and you'll still hear the same signal, though you will have to retune to the point the other side of the '0' line (i.e. symmetrically disposed about the turn-over point). This is very obvious on a waterfall display (such as WinRad includes), where you simply see the same signals either side of 0 Hz (One the reflection of the other).

2, I need to sketch a timing diagram. For half the time the "sample and hold" caps are not connected to the low Z RF circuit, so form a hold state. Here's the sequence:

Switch 1 (Q)

Counter Switch input Sequence RF sense Sample / Hold
00 1 1 RF+ Sample
10 3 2 RF+ Hold
11 4 3 RF- Sample
01 2 4 RF- Hold

Switch 2 (I)

Counter Switch input Sequence RF sense Sample / Hold
00 1 1 RF+ Hold
10 3 2 RF- Sample
11 4 3 RF- Hold
01 2 4 RF+ Sample

There has been a lot of talk on the Softrock forum about what the optimum mark/space ratio should be. As I see it, it should never be 'off', but either sample or hold. Given all the talk, what you have could well be what Tony was wanting.

3, Looking at the IQ phase on my test app - all looks good. A lovely circular field.


The Kit is excellent value - and gets you going. Signals are so strong on 40 and 80 metres you don't need sensitivity. (You would if you were down-converting from another band.)

If you're critical of a circuit - well - design your own! Isn't that the heart of Amateur Radio?

What changes would I make?

  • I'd use a GAL (OK if you can program these!) The Tayloe switch would be fed from a synchronous state machine in a 16V8. There's potential for phase errors attributed to different propagation delays in the Q and Q bar of U2 (stage 1).
  • Improve impedance matching around the op-amps.
  • Use commercial coils.


        Digital Crystal Set

Coding Notes

Download the FlexRadio Systems source 1.6.1 source... all looks reasonable. (This is only used for Morse key support. We know what to do with classes that support Morse keys, don't we?) Bizarre that. Use DirectX graphics - cool - or for getting your hands on to the soundcard buffers - cool - but a Morse key?

Good news - it's .NET C#, albeit 1.1.

(Testing by repeatedly playing test.wav - it's just like Groundhog Day.)

FFT library used is:

The authors seem to like unmanaged  memcpy, not Array.Copy(...). Why?

Page last updated 14th February 2014

Valid CSS!   Valid XHTML 1.0 Strict