Wednesday, February 18, 2009

A Quick little riff on how SDR works

I was at the Orlando Hamfest last week end and as I was walking the aisles I saw Gerald K5SDR making a beeline for the forum pavilion. I guessed he was on the way for an SDR forum so I trailed him into the tent. Sure enough he unpacked his laptop for a PowerPoint presentation. I conned him out of a few diagrams from that talk so I could give my layman's view on how to think about SDR.

Here is a modified image from that talk: (click pic for bigger)



What you see is basically a block diagram of the SDR-1000. The RF comes in the antenna, goes through some passive band pass filtering and into a QSD (quadrature sampling detector). This is basically a mixer. Mixers multiply and what you get is the two signals (VFO and RF) added and the two signals subtracted from each other. This is a direct conversion receiver. RF goes in, and audio comes out. It is a very wide-band audio, but none the less its audio. This audio is called the base-band. You can vary the frequency of what part of the RF spectrum is demodulated by the VFO, which in this case is a DDS or direct digital synthesizer. The DDS is the thing that allows for the spectacular point and shoot tuning method.

What comes out of the QSD is a special kind of audio. Its called I/Q or quadrature. and it is a digital stream instead of an analogue stream. A little digression is needed.

Most of us took a little grade school math and we learned this formula C^2=A^2 + B^2. This is the theorem of Pythagoras, who lived around 500 B.C. What he found is that if you know 2 sides of a right triangle, you can figure out the third.

If you know the frequency, and I and Q, and you sample enough data points you have enough information to completely characterize an analogue signal from this data. Here is a pictorial of how the QSD works:

You will note that RF comes into a switch. The switch rotates between one of 4 capacitors. As the switch rotates it imparts a voltage on the capacitor. That voltage is fed to an amplifier that has + and - inputs in other words 180 degrees out of phase. This gives you the data points, each with a voltage (what ever voltage is coming from the antenna) and a phase 0, 90, 180 , 270. If you know the frequency you then can sample enough information to be able to exactly reproduce the information contained in the RF signal. Basically this is a mixer. Once you have the data points, you send them into the computer via the A/D converter. The SDR-1000 used a "sound card" The sound card has an A/D converter and this is how the data arrives in the computer's memory. The F5K doesn't have a "sound card" per say, but just a very high performance A/D with a high dynamic range

Once in memory the actual DSP digital signal processing takes place. In other words it is the COMPUTER and some components of the PowerSDR software that is the DSP, NOT the sound card, and this is the true power of the Flex Radio approach to DSP.

If you look at the above daigram of the SDR-1000 you will note I have divided the diagram into 2 parts. Loosely speaking you can think of this radio as a dual conversion radio. The first conversion is the Analogue/Hardware portion of the radio. The second conversion is everything south of the A/D converter called Digital/Software. The hardware conversion relies on the very strong signal handling capability of a direct conversion receiver. One great advantage of this kind of receiver is how little distortion is added to signals. It's like the quality of crystal radio, crystal clear. As you add stages, including things like more and more IF stages and roofing filters and AGC stages etc you continiously add distortion to the signal. With the cleanliness of direct conversion you miss all that crud. Once the baseband gets digitized, there is NO more crud to be added, so you wind up with a high fidelity signal to play around with in the second conversion. The baseband could be any frequency, but it is down in the audio region because audio hardware (like the A/D converters) has a very strong dynamic range and very low distortion. People talk about direct conversion from RF to A/D, but the trade off is bandwidth vs performance. More band width = less performance.

Once you get the data into the computer, you can display it, and this is what you see on the panadapter:


a pictorial representation of the baseband audio that updates 30 times per second, virtually real time as far as your brain is concerned. This data is then acted on once more. It is demodulated. But you don't need a mixer to demodulate this data, what you need is an equation. The A/D shoots little slices of base band data into memory "bins" in the computer, and the computer sucks up the base band data and runs it through one type of equation and what comes out is a little filtered slices of the base band, and that is what gets decoded to audio. You choose what slices you want to listen to and pop then into an equation that demodulates the slices and filters the slices and then reintegrates the slices into analogue audio you can hear in your headphones. The width of the filter for you audio is entirely under your control, as are the skirts of the filter. This is how Flex obtains its "brick wall" filtering. If you click the above pic you can see what a 100hz filter looks like in the panadapter It is represented by the green line. If you want CW, you send the data through another equation and out the other end of the equation comes CW. If you want LSB you send the data through a DSB equation, and then set the upper sideband half of the data to zero. All that is left is LSB. The filters are completely adjustable if you want a 112hz filter you just dial it up. The filters do NOT ring even at 11hz. I used this to great advantage in one DX contest. Before I discuss the contest experience, I want to discuss this picture:


This is a pic from Gerald's excellent article in QEX, and it was this picture that captivated my imagination. What you see is a "bin" representation of a DSB signal. Each bin contains the data that gets sent through the FFT (fast Fourier transform) equation that returns it back to audio. If you want LSB you just set the value in all the bins on the USB side to zero. A perfect filter! The notion is so simple, so elegant, and so powerful. Back to the real world, and why all this software/math mumbo jumbo matters, back to the world of contesting!! (how real is that?)

I was on 160 in a contest, and there were 2 stations that were 40 hz apart (I measure the difference). The stations were in the S-2 range about -100dBm. One station was in the south Carribean and the other was in Eastern Europe. There were about a dozen S9+ US stations calling either one or the other of the DX stations. With my SDR-1000 I was able to narrow down the filters to minimum, and work each station as a single entity. I brought my Orion up on freq, with its roofing filters and all that, and I could not duplicate with that 3500 buck radio what I did with my little 1200 buck black box. The filters truly are brick wall, and the filtering happens in the computer. At no time did I experience any intermod or blocking or even AGC pumping with the SDR. Many strong US stations all around me and 2 puny weak DX stations hugging the noise seperated by only 40hz. The difference of 40hz is on the very low end of noticability when trying to seperate signals, much less seperate the cacouphony caused by those signals and all the US stations calling them. I mowed 'em down with the SDR and went in the ditch with the Orion.

Roofing filters: who the hell needs em? They are expensive and inferior. They add distortion and are never narrow enough to do the job, except in "laboratory test" such as the ARRL testing laboratories. In my opinion ham radio today is held hostage to this testing nonsense. These radios like the Orion and the K-3 were specifically designed to the test. If you choose a roofing filter, and then choose a test that places one signal inside the roofing filter and one signal ARTIFICIALLY outside of the roofing filter, guess what YOU WILL HAVE A HIGH DYNAMIC RANGE. Big friggin deal. You have a really strong radio in an ARTIFICIAL test. A test the radio was specifically designed to pass with flying colors, and then that result is pounded and pounded into the ham radio psyche by ARRL advertising, as if it means anything. What it does is tweak the ego. It gives the blowhard at the ham club meeting material so he can look like the smartest guy in the room. And that's why we are obsessed with roofing filters. Not because we need them but because the smartest guy in the room needs them to look smart. In the real world when it counts, you just go in the ditch as Ihave just shown. In a future article I'm going to report some data that looks at the behavior of the high buck wonder radios when they are challenged with 2 strong signals INSIDE the roofing filter. That's a test the roofing filter radio wasn't designed to pass, but the F5K was, brcause the signal processing is handled in software and not hardware. It ain't a pretty picture for the legacy radios.

Because of the nature of the receiver the radio is very quiet. It was much quieter than the Orion or the FT-1000D. I think this is largely due to the simplicity of design. Less stages = less garbage = more intelligibility. Also the AGC is perhaps the best AGC I've ever experienced. Better than the Orion's even though the Orion had a very adjustable AGC. The original AGC in the SDR-1000 wasn't all that great. The design problem was attacked by a collaborator, a software engineer who knew a thing or two about AGC's and totally redesigned. Once the design was complete it was added to the PowerSDR code for download. One day I had a crappy AGC, and the next day I had the best AGC in ham radio. AMAZING!! If I wanted a new AGC in my Orion or FT-1000D I was screwed. Those radios are legacy radios which means the AGC is in hardware not software. I trust the power of this example is not lost on your imagination. In fact the issue is so bad that it can result in 15 years of bad design. The FT-1000 series of radios have always been bothered by key clicks. If you look at at 40M at night you can actually pick out the Yaesu radios by looking at their wave forms. They are terrible. This design problem was well known but Yaesu year after year, model upgrade after model upgrade, kept pumping out radios with this problem. Eventually W8JI published a modification of the radio that addressed at least to some extent the problem. But to fix the problem you had to break open the radio and attack the circuitry. The fix wasn't complicated, but it still required soldering. In addition if you fixed the "problem" you screwed up the QSK. So you were left with a dilemma. Fix the click screw up the QSK or be a lousy ham with a clicky signal, but maintain QSK. If you had an SDR radio you could fix this problem over night, and you could export that fix to the entire fleet of SDR radios with a simple download. DUH!!!

Here is a picture of the F5K architecture for comparison


The F5K has an interesting addition. If you add the second receiver, it becomes a triplex radio. Most transceivers are half duplex. In the old days when I got into ham radio we had a transmitter and a receiver that operated all the time. With this radio you can have 2 receivers and one transmitter all on at the same time. This gives you the ability to work SO2R from one box. It works. Or you can for example monitor 6M for openings on the panadapter while at the same time DX-ing on 80M CW. One click and your can make a contact on 6 and be back to 80 with nary a beat missed. I bet it would drive W9KNI nuts.

So that's my little riff on SDR for today. The F5K is considerably more complex than my trusty old SDR-1000, and does many more things but in its heart its the same radio with higher performance components and a smarter more versitile design, such as a better pipe between the radio hardware and the DSP inside the computer (firewire)

If you want to check out Gerald's QEX articles go here

"A Software Defined Radio for the Masses P1 to P4"

It will either bore the snot out of you OR BLOW YOUR MIND as you look into the future of ham radio.

73