A Software-Defined for the Masses, Part 1

This series describes a complete PC-based, software-defined radio that uses a sound card and an innovative circuit. Mathematics is minimized in the explanation. Come see how it’s done.

By Gerald Youngblood, AC5OG

certain convergence occurs speedy brought about the can completely change its functional- when multiple technologies Internet convergence. Suddenly, it all ity. This allows easy upgrade to new A align in time to make possible came together so that the Internet and modes and improved performance those things that once were only the worldwide Web joined the every- without the need to replace hardware. dreamed. The explosive growth of the day lexicon of our society. SDRs can also be easily modified to Internet starting in 1994 was one of A similar convergence is occurring accommodate the operating needs of those events. While the Internet had in radio communications through digi- individual applications. There is a dis- existed for many years in government tal signal processing (DSP) software to tinct difference between a radio that and education prior to that, its popu- perform most radio functions at per- internally uses software for some of its larity had never crossed over into the formance levels previously considered functions and a radio that can be com- general populace because of its slow unattainable. DSP has now been pletely redefined in the field through speed and arcane interface. The devel- incorporated into much of the ama- modification of software. The latter is opment of the Web browser, the teur radio gear on the market to de- a software-defined radio. rapidly accelerating power and avail- liver improved noise-reduction and This SDR convergence is occurring ability of the PC, and the availability digital-filtering performance. More because of advances in software and of inexpensive and increasingly recently, there has been a lot of discus- silicon that allow digital processing of sion about the emergence of so-called radio- signals. Many of software-defined (SDRs). these designs incorporate mathemati- 8900 Marybank Dr A software-defined radio is charac- cal functions into hardware to perform Austin, TX 78750 terized by its flexibility: Simply modi- all of the digitization, frequency selec- [email protected] fying or replacing software programs tion, and down-conversion to base-

Jul/Aug 2002 13 band. Such systems can be quite com- seven functions) and let’s get started. does. It uses a sampling clock to mea- plex and somewhat out of reach to But first, let’s set forth the objectives sure discrete samples of an incoming most amateurs. of the complete SDR design: analog signal at precise times, and it One problem has been that unless • Keep the math simple produces a digital representation of you are a math wizard and proficient • Use a sound-card equipped PC to pro- the input sample voltage. in programming C++ or assembly lan- vide all signal-processing functions In 1933, Harry Nyquist discovered guage, you are out of luck. Each can be • Program the user interface and all that to accurately recover all the com- somewhat daunting to the amateur as signal-processing algorithms in ponents of a periodic waveform, it is well as to many professionals. Two Visual Basic for easy development necessary to use a sampling frequency years ago, I set out to attack this chal- and maintenance of at least twice the bandwidth of the lenge armed with a fascination for • Utilize the Intel Signal Processing signal being measured. That mini- technology and a 25-year-old, virtu- Library for core DSP routines to mum sampling frequency is called the ally unused electrical engineering de- minimize the technical knowledge Nyquist criterion. This may be ex- gree. I had studied most of the math in requirement and development time, pressed as: college and even some of the signal and to maximize performance ≥ (Eq 1) processing theory, but 25 years is a • Integrate a direct conversion (D-C) 2 ff bws long time. I found that it really was a receiver for hardware design sim- where fs is the sampling rate and fbw is challenge to learn many of the disci- plicity and wide dynamic range the bandwidth. See? The math isn’t so plines required because much of the • Incorporate direct digital synthesis bad, is it? literature was written from a math- (DDS) to allow flexible frequency Now as an example of the Nyquist ematician’s perspective. control criterion, let’s consider human hear- Now that I am beginning to grasp • Include transmit capabilities using ing, which typically ranges from 20 Hz many of the concepts involved in soft- similar techniques as those used in to 20 kHz. To recreate this frequency ware radios, I want to share with the the D-C receiver. response, a CD player must sample at Amateur Radio community what I a frequency of at least 40 kHz. As we have learned without using much Analog and Digital Signals in the Time Domain will soon learn, the maximum fre- more than simple mathematical con- quency component must be limited to cepts. Further, a software radio To understand DSP we first need to 20 kHz through low-pass filtering to should have as little hardware as pos- understand the relationship between prevent distortion caused by false im- sible. If you have a PC with a sound digital signals and their analog coun- ages of the signal. To ease filter re- card, you already have most of the terparts. If we look at a 1-V (pk) sine quirements, therefore, CD players use required hardware. With as few as wave on an analog oscilloscope, we see a standard sampling rate of 44,100 Hz. three integrated circuits you can be up that the signal makes a perfectly All modern PC sound cards support and running with a Tayloe detector— smooth curve on the scope, no matter that sampling rate. an innovative, yet simple, direct-con- how fast the sweep frequency. In fact, What happens if the sampled band- version receiver. With less than a if it were possible to build a scope with width is greater than half the sampling dozen chips, you can build a trans- an infinitely fast horizontal sweep, it rate and is not limited by a low-pass ceiver that will outperform much of would still display a perfectly smooth filter? An alias of the signal is produced the commercial gear on the market. curve (really a straight line at that that appears in the output along with point). As such, it is often called a con- Approach the Theory the original signal. Aliases can cause tinuous-time signal since it is continu- distortion, beat notes and unwanted In this article series, I have chosen to ous in time. In other words, there are spurious images. Fortunately, alias focus on practical implementation an infinite number of different volt- can be precisely predicted rather than on detailed theory. There ages along the curve, as can be seen on and prevented with proper low-pass or are basic facts that must be understood the analog oscilloscope trace. band-pass filters, which are often re- to build a software radio. However, On the other hand, if we were to ferred to as anti-aliasing filters, as much like working with integrated cir- measure the same sine wave with a shown in Fig 1. There are even cases cuits, you don’t have to know how to digital voltmeter at a sampling rate of where the alias frequency can be used create the IC in order to use it in a de- four times the frequency of the sine to advantage; that will be discussed sign. The convention I have chosen is to wave, starting at time equals zero, we later in the article. describe practical applications fol- would read: 0 V at 0°, 1 V at 90°, 0 V at This is the point where most texts lowed by references where appropriate 180° and –1 V at 270° over one com- on DSP go into great detail about what for more detailed study. One of the plete cycle. The signal could continue sampled signals look like above the easier to comprehend references I have perpetually, and we would still read Nyquist frequency. Since the goal of found is The Scientist and Engineer’s those same four voltages over and this article is practical implementa- Guide to Processing by again, forever. We have measured the tion, I refer you to Chapter 3 of the Steven W. Smith. It is free for download voltage of the signal at discrete mo- DSP Guide for a more in-depth discus- over the Internet at www.DSPGuide. ments in time. The resulting voltage- sion of sampling, aliases, A-to-D and com. I consider it required reading for measurement sequence is therefore those who want to dig deeper into called a discrete-time signal. implementation as well as theory. I will If we save each discrete-time signal refer to it as the “DSP Guide” many voltage in a computer memory and we times in this article series for further know the frequency at which we study. sampled the signal, we have a discrete- So get out your four-function calcu- time sampled signal. This is what an Fig 1—A/D conversion with antialiasing lator (okay, maybe you need six or analog-to-digital converter (ADC) low-pass filter.

14 Jul/Aug 2002 D-to-A conversion. Also refer to Doug Smith’s article, “Sig- We can mix the signal with an oscillator tuned to the RF nals, Samples, and Stuff: A DSP Tutorial.”1 carrier frequency to translate the bandwidth-limited sig- What you need to know for now is that if we adhere to the nal to a 0-Hz IF as shown in Fig 2. Nyquist criterion in Eq 1, we can accurately sample, pro- The example in the figure shows a 14.001-MHz carrier cess and recreate virtually any desired waveform. The signal mixed with a 14.000-MHz local oscillator to translate sampled signal will consist of a series of numbers in com- the carrier to 1 kHz. If the low-pass filter had a cutoff of puter memory measured at time intervals equal to the 1.5 kHz, any signal between 14.000 MHz and 14.0015 MHz sampling rate. Since we now know the amplitude of the would be within the passband of the direct-conversion re- signal at discrete time intervals, we can process the digi- ceiver. The problem with this simple approach is that we tized signal in software with a precision and flexibility not would also simultaneously receive all signals between possible with analog circuits. 13.9985 MHz and 14.000 MHz as unwanted images within the passband, as illustrated in Fig 3. Why is that? From RF to a PC’s Sound Card Most amateurs are familiar with the concept of sum and Our objective is to convert a modulated radio-frequency difference frequencies that result from mixing two signals. signal from the frequency domain to the time domain for When a carrier frequency, fc, is mixed with a local oscilla- software processing. In the frequency domain, we measure tor, flo, they combine in the general form: amplitude versus frequency (as with a spectrum analyzer); in the time domain, we measure amplitude versus time (as 1 []−++= ffffff )()( (Eq 2) with an oscilloscope). c lo 2 c lo c lo In this application, we choose to use a standard 16-bit PC When we use the direct-conversion mixer shown in Fig 2, sound card that has a maximum sampling rate of we will receive these primary output signals: 44,100 Hz. According to Eq 1, this means that the maxi- mum-bandwidth signal we can accommodate is 22,050 Hz. ff 14.001 MHz 14.000 MHz =+=+ 28.001 MHz With quadrature sampling, discussed later, this can actu- c lo =−=− ally be extended to 44 kHz. Most sound cards have built-in c ff lo 14.001 MHz 14.000 MHz .0 001 MHz antialiasing filters that cut off sharply at around 20 kHz. Note that we also receive the image frequency that “folds (For a couple hundred dollars more, PC sound cards are over” the primary output signals: now available that support 24 bits at a 96-kHz sampling −=+−=+− rate with up to 105 dB of dynamic range.) c ff lo 14.001 MHz 14.000 MHz .0 001 MHz Most commercial and amateur DSP designs use dedicated DSPs that sample intermediate frequencies (IFs) of 40 kHz A low-pass filter easily removes the 28.001-MHz sum or above. They use traditional analog superheterodyne tech- frequency, but the –0.001-MHz difference-frequency image niques for down-conversion and filtering. With the advent of will remain in the output. This unwanted image is the very-high-speed and wide-bandwidth ADCs, it is now pos- lower sideband with respect to the 14.000-MHz carrier fre- sible to directly sample signals up through the entire HF quency. This would not be a problem if there were no sig- range and even into the low VHF range. For example, the nals below 14.000 MHz to interfere. As previously stated, Analog Devices AD9430 A/D converter is specified with all undesired signals between 13.9985 and 14.000 MHz will sample rates up to 210 Msps at 12 bits of resolution and a translate into the passband along with the desired signals 700-MHz bandwidth. That 700-MHz bandwidth can be used above 14.000 MHz. The image also results in increased in under-sampling applications, a topic that is beyond the noise in the output. scope of this article series. So how can we remove the image-frequency signals? It The goal of my project is to build a PC-based software- can be accomplished through quadrature mixing. Phasing defined radio that uses as little external hardware as pos- or quadrature transmitters and receivers—also called sible while maximizing dynamic range and flexibility. To Weaver-method or image-rejection mixers—have existed do so, we will need to convert the RF signal to audio fre- since the early days of single sideband. In fact, my first quencies in a way that allows removal of the unwanted SSB transmitter was a used Central Electronics 20A ex- mixing products or images caused by the down-conversion citer that incorporated a phasing design. Phasing systems process. The simplest way to accomplish this while main- lost favor in the early 1960s with the advent of relatively taining wide dynamic range is to use D-C techniques to inexpensive, high-performance filters. translate the modulated RF signal directly to . To achieve good opposite-sideband or image suppression, phasing systems require a precise balance of amplitude and 1Notes appear on page 21. phase between two samples of the signal that are 90° out

Fig 2—A direct-conversion real mixer with a 1.5-kHz low-pass Fig 3—Output spectrum of a real mixer illustrating the sum, filter. difference and image frequencies.

Jul/Aug 2002 15 of phase or in quadrature with each of the squares of the other two sides— Signals: Complex, But Not Compli- other—“orthogonal” is the term used according to the Pythagorean theo- cated,” by Richard Lyons. It can be in some texts. Until the advent of digi- rem. Or restating, the hypotenuse as found at www.dspguru.com/info/ tal signal processing, it was difficult mt (magnitude with respect to time): tutor/quadsig.htm. The article de- to realize the level of image rejection velops in a very logical manner how performance required of modern radio 2 += 2 (Eq 3) quadrature-sampling I/Q demodula- tt QIm t systems in phasing designs. Since tion is accomplished. A basic under- digital signal processing allows pre- The instantaneous phase of the sig- standing of these concepts is essential cise numerical control of phase and nal as measured counterclockwise to designing software-defined radios. amplitude, quadrature from the positive I axis and may be We can take advantage of the ana- and are the preferred computed by the inverse tangent (or lytic capabilities of quadrature signals methods. Such signals in quadrature arctangent) as follows: through a quadrature mixer. To under- allow virtually any modulation   stand the basic concepts of quadrature method to be implemented in software φ = −1 Qt  (Eq 4) mixing, refer to Fig 6, which illustrates t tan   using DSP techniques.  I t  a quadrature-sampling I/Q mixer. Therefore, if we measured the in- First, the RF input signal is band- Give Me I and Q and I Can stantaneous values of I and Q, we pass filtered and applied to the two Demodulate Anything would know everything we needed to parallel mixer channels. By delaying First, consider the direct-conversion know about the signal at a given mo- the local oscillator wave by 90°, we can mixer shown in Fig 2. When the RF sig- ment in time. This is true whether we generate a cosine wave that, in tandem, nal is converted to baseband audio us- are dealing with continuous analog forms a quadrature oscillator. The RF ing a single channel, we can visualize signals or discrete sampled signals. carrier, fc(t), is mixed with the respec- the output as varying in amplitude With I and Q, we can demodulate AM tive cosine and sine wave local oscilla- along a single axis as illustrated in signals directly using Eq 3 and FM tors and is subsequently low-pass Fig 4. We will refer to this as the in- signals using Eq 4. To demodulate filtered to create the in-phase, I(t), and phase or I signal. Notice that its magni- SSB takes one more step. Quadrature quadrature, Q(t), signals. The Q(t) tude varies from a positive value to a signals can be used analytically to re- negative value at the frequency of the move the image frequencies and leave modulating signal. If we use a diode to only the desired sideband. rectify the signal, we would have cre- The mathematical equations for ated a simple envelope or AM detector. quadrature signals are difficult but Remember that in AM envelope de- are very understandable with a little tection, both modulation sidebands study.2 I highly recommend that you carry information energy and both are read the online article, “Quadrature desired at the output. Only amplitude information is required to fully de- modulate the original signal. The problem is that most other modulation techniques require that the phase of the signal be known. This is where quadrature detection comes in. If we delay a copy of the RF carrier by 90° to Fig 4—An in-phase signal (I) on the real Fig 5—I +jQ are shown on the complex form a quadrature (Q) signal, we can plane. The magnitude, m(t), is easily plane. The vector rotates counterclock- wise at a rate of 2πππf . The magnitude and then use it in conjunction with the measured as the instantaneous peak c voltage, but no phase information is phase of the rotating vector at any instant original in-phase signal and the math available from in-phase detection. This is in time may be determined through Eqs 3 we learned in middle school to deter- the way an AM envelope detector works. and 4. mine the instantaneous phase and amplitude of the original signal. Fig 5 illustrates an RF carrier with the level of the I signal plotted on the x-axis and that of the Q signal plotted on the y-axis of a plane. This is often referred to in the literature as a phasor diagram in the complex plane. We are now able to extrapolate the two signals to draw an arrow or phasor that represents the instantaneous magnitude and phase of the original signal. Okay, here is where you will have to use a couple of those extra functions on the calculator. To compute the Fig 6—Quadrature sampling mixer: The RF carrier, fc, is fed to parallel mixers. The local magnitude m or envelope of the sig- oscillator (Sine) is fed to the lower-channel mixer directly and is delayed by 90° (Cosine) t to feed the upper-channel mixer. The low-pass filters provide antialias filtering before nal, we use the geometry of right tri- analog-to-digital conversion. The upper channel provides the in-phase (I ) signal and the angles. In a right triangle, the square (t) lower channel provides the quadrature (Q(t)) signal. In the PC SDR the low-pass filters of the hypotenuse is equal to the sum and A/D converters are integrated on the PC sound card.

16 Jul/Aug 2002 channel is phase-shifted 90° relative to frequency without any of the low- adjacent bin and a decrease in the the I(t) channel through mixing with frequency noise issues. This also value of the current bin. Mathemati- the sine local oscillator. The low-pass significantly reduces the effects of lo- cal analysis fully describes the rela- filter is designed for cutoff below the cal-oscillator phase noise. Once we tionship between FFT bins,6 but such Nyquist frequency to prevent aliasing have digitally captured the signal, it is is beyond the scope of this article. in the A/D step. The A/D converts con- a trivial software task to shift the de- Further, the FFT allows us to mea- tinuous-time signals to discrete-time modulated signal down to a 0-Hz offset. sure both phase and amplitude of the sampled signals. Now that we have the signal within each bin using Eqs 3 and I and Q samples in memory, we can DSP in the Frequency Domain 4 above. The complex version allows us perform the magic of digital signal pro- Every DSP text I have read thus far to measure positive and negative fre- cessing. concentrates on time-domain filtering quencies separately. Fig 8 illustrates Before we go further, let me reiter- and demodulation of SSB signals us- the output of a complex, or quadra- ate that one of the problems with this ing finite-impulse-response (FIR) fil- ture, FFT. method of down-conversion is that it ters. Since these techniques have been The bandwidth of each FFT bin may can be costly to get good opposite-side- thoroughly discussed in the litera- be computed as shown in Eq 5, where 1, 3, 4 band suppression with analog circuits. ture and are not currently used in BWbin is the bandwidth of a single bin, Any variance in component values will my PC SDR, they will not be covered fs is the sampling rate and N is the size cause phase or amplitude imbalance in this article series. of the FFT. The center frequency of between two channels, resulting in a My PC SDR uses the power of the each FFT bin may be determined by corresponding decrease in opposite- fast Fourier transform (FFT) to do al- Eq 6 where fcenter is the bin’s center sideband suppression. With analog most all of the heavy lifting in the fre- frequency, n is the bin number, fs is the circuits, it is difficult to achieve better quency domain. Most DSP texts use a sampling rate and N is the size of the than 40 dB of suppression without lot of ink to derive the math so that one FFT. Bins zero through (N/2)–1 repre- much higher cost. Fortunately, it is can write the FFT code. Since Intel has sent upper-sideband frequencies and straightforward to correct the analog so helpfully provided the code in ex- bins N/2 to N–1 represent lower-side- imbalances in software. ecutable form in their signal-process- band frequencies around the carrier Another significant drawback of di- ing library,5 we don’t care how to write frequency. rect-conversion receivers is that the an FFT: We just need to know how to noise increases as the demodulated sig- use it. Simply put, the FFT converts = fs (Eq 5) BWbin nal approaches 0 Hz. Noise contribu- the complex I and Q discrete-time sig- N tions come from a number of sources, nals into the frequency domain. The = nfs (Eq 6) fcenter such as 1/f noise from the semiconduc- FFT output can be thought of as a N tor devices themselves, 60-Hz and large bank of very narrow band-pass If we assume the sampling rate of 120-Hz line noise or hum, microphonic filters, called bins, each one measur- the sound card is 44.1 kHz and the mechanical noise and local-oscillator ing the spectral energy within its number of FFT bins is 4096, then the phase noise near the carrier frequency. respective bandwidth. The output re- bandwidth and center frequency of This can limit sensitivity since most sembles a comb filter wherein each bin each bin would be: people prefer their CW tones to be be- slightly overlaps its adjacent bins low 1 kHz. It turns out that most of forming a scalloped curve, as shown in 44100 == BWbin 10.7666 Hz and the low-frequency noise rolls off above Fig 7. When a signal is precisely at the 4096 1 kHz. Since a sound card can process center frequency of a bin, there will be = signals all the way up to 20 kHz, why a corresponding value only in that bin. center nf 10.7666 Hz not use some of that bandwidth to move As the frequency is offset from the away from the low frequency noise? The bin’s center, there will be a corre- What this all means is that the PC SDR uses an 11.025-kHz, offset- sponding increase in the value of the receiver will have 4096, ~11-Hz-wide baseband IF to reduce the noise to a manageable level. By offsetting the local oscillator by 11.025 kHz, we can now receive signals near the carrier

Fig 7—FFT output resembles a comb filter: Each bin of the FFT overlaps its adjacent bins just as in a comb filter. The 3-dB Fig 8—Complex FFT output: The output of a complex FFT may be thought of as a series points overlap to provide linear output. The of band-pass filters aligned around the carrier frequency, fc, at bin 0. N represents the phase and magnitude of the signal in each number of FFT bins. The upper sideband is located in bins 1 through (N/2)–1 and the bin is easily determined mathematically lower sideband is located in bins N/2 to N–1. The center frequency and bandwidth of with Eqs 3 and 4. each bin may be calculated using Eqs 5 and 6.

Jul/Aug 2002 17 band-pass filters. We can therefore create band-pass filters from 11 Hz to approximately 40 kHz in 11-Hz steps. The PC SDR performs the following functions in the frequency domain af- ter FFT conversion: • Brick-wall fixed and variable band- pass filters • Frequency conversion • SSB/CW demodulation • Sideband selection • Frequency-domain noise subtraction • Frequency-selective squelch • Noise blanking • Graphic equalization (“tone control”) • Phase and amplitude balancing to remove images • SSB generation Fig 9—SDR receiver software architecture: The I and Q signals are fed from the sound- • Future digital modes such as PSK31 card input directly to a 4096-bin complex FFT. Band-pass filter coefficients are and RTTY precomputed and converted to the frequency domain using another FFT. The frequency- Once the desired frequency-domain domain filter is then multiplied by the frequency-domain signal to provide brick-wall filtering. The filtered signal is then converted to the time domain using the inverse FFT. processing is completed, it is simple to Adaptive noise and notch filtering and digital AGC follow in the time domain. convert the signal back to the time do- main by using an inverse FFT. In the PC SDR, only AGC and adaptive noise filtering are currently performed in the time domain. A simplified diagram of the PC SDR software architecture is provided in Fig 9. These concepts will be discussed in detail in a future article.

Sampling RF Signals with the Tayloe Detector: A New Twist on an Old Problem While searching the Internet for information on quadrature mixing, I ran across a most innovative and el- egant design by Dan Tayloe, N7VE. Dan, who works for Motorola, has de- veloped and patented (US Patent #6,230,000) what has been called the Tayloe detector.7 The beauty of the Tayloe detector is found in both its Fig 10—Tayloe detector: The switch rotates at the carrier frequency so that each design elegance and its exceptional capacitor samples the signal once each revolution. The 0° and 180° capacitors differentially sum to provide the in-phase (I) signal and the 90° and 270° capacitors sum performance. It resembles other con- to provide the quadrature (Q) signal. cepts in design, but appears unique in its high performance with minimal components.8, 9, 10, 11 In its simplest form, you can build a complete quadra- the cycle. The rotating switch will ture down converter with only three or therefore sample the signal at 0°, 90°, four ICs (less the local oscillator) at a 180° and 270°, respectively. cost of less than $10. As shown in Fig 11, the 50-Ω imped- Fig 10 illustrates a single-balanced ance of the antenna and the sampling version of the Tayloe detector. It can be capacitors form an R-C low-pass filter visualized as a four-position rotary during the period when each respec- switch revolving at a rate equal to the tive switch is turned on. Therefore, carrier frequency. The 50-Ω antenna each sample represents the integral or Fig 11—Track and hold sampling circuit: impedance is connected to the rotor and average voltage of the signal during its Each of the four sampling capacitors in the Tayloe detector form an RC track-and-hold each of the four switch positions is con- respective one-quarter cycle. When circuit. When the switch is on, the nected to a sampling capacitor. Since the switch is off, each sampling capaci- capacitor will charge to the average value the switch rotor is turning at exactly tor will hold its value until the next of the carrier during its respective one- the RF carrier frequency, each capaci- revolution. If the RF carrier and the quarter cycle. During the remaining three- quarters cycle, it will hold its charge. The tor will track the carrier’s amplitude rotating frequency were exactly in local-oscillator frequency is equal to the for exactly one-quarter of the cycle and phase, the output of each capacitor carrier frequency so that the output will be will hold its value for the remainder of will be a dc level equal to the average at baseband.

18 Jul/Aug 2002 value of the sample. components converted to baseband. Since the duty cycle of each switch If we differentially sum outputs of Fig 12 provides the schematic for a is 25%, the effective resistance in the the 0° and 180° sampling capacitors simple, single-balanced Tayloe detec- RC network is the antenna impedance with an op amp (see Fig 10), the out- tor. It consists of a PI5V331, 1:4 FET multiplied by four in the op-amp gain put would be a dc voltage equal to two demultiplexer that switches the signal formula, as shown in Eq 7: times the value of the individually to each of the four sampling capaci- sampled values when the switch rota- tors. The 74AC74 dual flip-flop is con- tion frequency equals the carrier fre- nected as a divide-by-four Johnson R (Eq 7) G = f quency. Imagine, 6 dB of noise-free counter to provide the two-phase clock 4R gain! The same would be true for the to the demultiplexer chip. The outputs ant 90° and 270° capacitors as well. The of the sampling capacitors are differ- For example, with a feedback resis- Ω 0°/180° summation forms the I chan- entially summed through the two tance, Rf , of 3.3 k and antenna im- Ω nel and the 90°/270° summation forms LT1115 ultra-low-noise op amps to pedance, Rant, of 50 , the resulting the Q channel of the quadrature down- form the I and Q outputs, respectively. gain of the input stage is: conversion. Note that the impedance of the 3300 As we shift the frequency of the car- antenna forms the input resistance for G = = 16 5. rier away from the sampling fre- the op-amp gain as shown in Eq 7. This 4×50 quency, the values of the inverting impedance may vary significantly phases will no longer be dc levels. The with the actual antenna. I use instru- The Tayloe detector may also be output frequency will vary according mentation amplifiers in my final de- analyzed as a digital commutating fil- to the “beat” or difference frequency sign to eliminate gain variance with ter.12, 13, 14 This means that it operates between the carrier and the switch-ro- antenna impedance. More informa- as a very-high-Q tracking filter, where tation frequency to provide an accu- tion on the hardware design will be Eq 8 determines the bandwidth and n rate representation of all the signal provided in a future article. is the number of sampling capacitors,

Fig 12—Singly balanced Tayloe detector.

Jul/Aug 2002 19 Rant is the antenna impedance and Cs increase in noise figure. In the Tayloe architecture of the PC SDR receiver as is the value of the individual sampling detector, the sum frequency resides at it currently exists. The challenge has capacitors. Eq 9 determines the Qdet the first alias frequency as shown in been to build a low-noise analog chain of the filter, where fc is the center fre- Fig 13. Remember that an alias is a that matches the dynamic range of the quency and BWdet is the bandwidth of real signal and will appear in the out- Tayloe detector to the dynamic range the filter. put as if it were a baseband signal. of the PC sound card. This will be cov- Therefore, the alias adds to the base- ered in a future article. 1 BW = (Eq 8) band signal for a theoretically loss- I am currently prototyping a det π nRantCs less detector. In real life, there is a complete PC SDR transceiver, the slight loss due to the resistance of the SDR-1000, that will provide general- = fc (Eq 9) switch and aperture loss due to imper- coverage receive from 100 kHz to Qdet BWdet fect switching times. 54 MHz and will transmit on all ham By example, if we assume the sam- bands from 160 through 6 meters. pling capacitor to be 0.27 µF and the PC SDR Transceiver Hardware antenna impedance to be 50 Ω, then The Tayloe detector therefore pro- SDR Applications BW and Q are computed as follows: vides a low-cost, high-performance At the time of this writing, the typi- method for both quadrature down-con- cal entry-level PC now runs at a clock version as well as up-conversion for frequency greater than 1 GHz and = 1 = BWdet − 5895 Hz transmitting. For a complete system, costs only a few hundred dollars. We (π )(4)(50)( 7.2 ×10 7 ) we would need to provide analog AGC now have exceptional processing to prevent overload of the ADC inputs power at our disposal to perform DSP × 6 = 14. 10001 = and a means of digital frequency con- tasks that were once only dreams. The Qdet 2375 5895 trol. Fig 14 illustrates the hardware transfer of knowledge from the aca- Since the PC SDR uses an offset baseband IF, I have chosen to design the detector’s bandwidth to be 40 kHz to allow low-frequency noise elimina- tion as discussed above. The real payoff in the Tayloe detec- tor is its performance. It has been stated that the ideal commutating mixer has a minimum conversion loss (which equates to noise figure) of 3.9 dB.15, 16 Typical high-level diode mixers have a conversion loss of 6-7 dB and noise figures 1 dB higher than the loss. The Tayloe detector has less than 1 dB of conversion loss, remarkably. Fig 13—Alias summing on Tayloe detector output: Since the Tayloe detector samples the How can this be? The reason is that it signal the sum frequency (f c + f s) and its image (–f c – f s) are located at the first alias is not really a mixer but a sampling frequency. The alias signals sum with the baseband signals to eliminate the mixing detector in the form of a quadrature product loss associated with traditional mixers. In a typical mixer, the sum frequency energy is lost through filtering thereby increasing the noise figure of the device. track and hold. This means that the design adheres to discrete-time sam- pling theory, which, while similar to mixing, has its own unique character- istics. Because a track and hold actu- ally holds the signal value between samples, the signal output never goes to zero. This is where aliasing can actually be used to our benefit. Since each switch and capacitor in the Tayloe detector actually samples the RF sig- nal once each cycle, it will respond to alias frequencies as well as those within the Nyquist frequency range. In a traditional direct-conversion re- ceiver, the local-oscillator frequency is set to the carrier frequency so that the difference frequency, or IF, is at 0 Hz and the sum frequency is at two times the carrier frequency per Eq 2. We Fig 14—PC SDR receiver hardware architecture: After band-pass filtering the antenna is fed directly to the Tayloe detector, which in turn provides I and Q outputs at baseband. A normally remove the sum frequency DDS and a divide-by-four Johnson counter drive the Tayloe detector demultiplexer. The through low-pass filtering, resulting LT1115s offer ultra-low noise-differential summing and amplification prior to the wide- in conversion loss and a corresponding dynamic-range analog AGC circuit formed by the SSM2164 and AD8307 log amplifier.

20 Jul/Aug 2002 demic to the practical is the primary WA5VTV; Ken Simmons, K5UHF; Rick 11D. H. van Graas, PA0DEN, “The Fourth limit of the availability of this technol- Kirchhof, KD5ABM; and Chuck Method: Generating and Detecting SSB ogy to the Amateur Radio experi- McLeavy, WB5BMH. These guys put Signals,” QEX, Sep 1990, pp 7-11. This circuit is very similar to a Tayloe detector, menter. This article series attempts to up with my questions every week and but it has a lot of unnecessary compo- demystify some of the fundamental have given me tremendous advice and nents. concepts to encourage experimenta- feedback all throughout the project. I 12M. Kossor, WA2EBY, “A Digital Commu- tion within our community. The ARRL also want to thank my wonderful wife, tating Filter,” QEX, May/Jun 1999, pp 3-8. recently formed a SDR Working Group Virginia, who has been incredibly pa- 13C. Ping, BA1HAM, “An Improved Switched for supporting this effort, as well. tient with all the hours I have put in on Capacitor Filter,” QEX, Sep/Oct 2000, pp 41-45. The SDR mimics the analog world in this project. 14P. Anderson, KC1HR, “Letters to the Edi- digital data, which can be manipu- tor, A Digital Commutating Filter,” QEX, lated much more precisely. Analog Where Do We Go From Here? Jul/Aug 1999, pp 62. radio has always been modeled math- Three future articles will describe 15D. Smith, KF6DX, “Notes on ‘Ideal’ Com- ematically and can therefore be pro- the construction and programming of mutating Mixers,” QEX, Nov/Dec 1999, cessed in a computer. This means that the PC SDR. The next article in the pp 52-54. 16P. Chadwick, G3RZP, “Letters to the Editor, virtually any modulation scheme may series will detail the software interface Notes on ‘Ideal’ Commutating Mixers” (Nov/ be handled digitally with performance to the PC sound card. Integrating full- Dec 1999), QEX, Mar/Apr 2000, pp 61-62. levels difficult, or impossible, to attain duplex sound with DirectX was one of with analog circuits. Let’s consider the more challenging parts of the Gerald became a ham in 1967 dur- some of the amateur applications for project. The third article will describe ing high school, first as a Novice and the SDR: the Visual Basic code and the use of the then a General class as WA5RXV. He • Competition-grade HF transceivers Intel Signal Processing Library for completed his Advanced class license • High-performance IF for microwave implementing the key DSP algorithms and became KE5OH before finishing bands in radio communications. The final high school and received his First • Multimode digital transceiver article will describe the completed Class Radiotelephone license while • EME and weak-signal work transceiver hardware for the SDR- working in the television broadcast • Digital-voice modes 1000. industry during college. After 25 years • Dream it and code it of inactivity, Gerald returned to the ac- tive amateur ranks in 1997 when he For Further Reading Notes 1D. Smith, KF6DX, “Signals, Samples and completed the requirements for Extra For more in-depth study of DSP Stuff: A DSP Tutorial (Part 1),” QEX, Mar/ class license and became AC5OG. techniques, I highly recommend that Apr 1998, pp 3-11. Gerald lives in Austin, Texas, and is you purchase the following texts in 2J. Bloom, KE3Z, “Negative Frequencies currently CEO of Sixth Market Inc, a order of their listing: and Complex Signals,” QEX, Sep 1994, hedge fund that trades equities using pp 22-27. Understanding Digital Signal Pro- 3 artificial-intelligence software. Gerald cessing by Richard G. Lyons (see Note M. E. Frerking, Digital Signal Processing in Communication Systems (New York: Van previously founded and ran five tech- 6). This is one of the best-written text- Nostrand Reinhold, 1994, ISBN: nology companies spanning hardware, books about DSP. 0442016166), pp 272-286. software and electronic manufacturing. Digital Signal Processing Technol- 4D. Smith, KF6DX, Digital Signal Processing Gerald holds a Bachelor of Science De- ogy by Doug Smith (see Note 4). This Technology (Newington, Connecticut: gree in Electrical Engineering from ARRL, 2001), pp 5-1 through 5-38. new book explains DSP theory and 5 Mississippi Stage University. application from an Amateur Radio The Intel Signal Processing Library is avail- able for download at developer.intel. Gerald is a member of the ARRL perspective. com/software/products/perflib/spl/. SDR working Group and currently Digital Signal Processing in Com- 6R. G. Lyons, Understanding Digital Signal enjoys homebrew software-radio devel- munications Systems by Marvin E. Processing, (Reading, Massachusetts: opment, 6-meter DX and satellite op- Frerking (see Note 3). This book re- Addison-Wesley, 1997), pp 49-146. 7 erations. lates DSP theory specifically to modu- D. Tayloe, N7VE, “Letters to the Editor, lation and demodulation techniques Notes on‘Ideal’ Commutating Mixers (Nov/ Dec 1999),” QEX, March/April 2001, p 61. for radio applications. 8P. Rice, VK3BHR, “SSB by the Fourth Method?” available at ironbark.bendigo. Acknowledgements latrobe.edu.au/~rice/ssb/ssb.html. I would like to thank those who have 9A. A. Abidi, “Direct-Conversion Radio assisted me in my journey to under- Transceivers for Digital Communications,” IEEE Journal of Solid-State Circuits, standing software radios. Dan Tayloe, Vol 30, No 12, December 1995, pp 1399- N7VE, has always been helpful and 1410, Also on the Web at www.icsl.ucla. responsive in answering questions edu/aagroup/PDF_files/dir-con.pdf about the Tayloe detector. Doug Smith, 10P. Y. Chan, A. Rofougaran, K.A. Ahmed, KF6DX, and Leif Åsbrink, SM5BSZ, and A. A. Abidi, “A Highly Linear 1-GHz have been gracious to answer my ques- CMOS Downconversion Mixer.” Presented at the European Solid State Circuits Con- tions about DSP and receiver design on ference, Seville, Spain, Sep 22-24, 1993, numerous occasions. Most of all, I want pp 210-213 of the conference proceed- to thank my Saturday-morning break- ings. Also on the Web at www.icsl.ucla. fast review team: Mike Pendley, edu/aagroup/PDF_files/mxr-93.pdf

Jul/Aug 2002 21