SDR(Software Defined Radio)

 

 

 

RF Front End

Software defined radio suggests that the software defines everything. It does not. The analogue chain in front of the converter decides what reaches the software at all. No amount of processing recovers a signal it destroyed. Most of the strange results I have chased on a bench started here rather than in the code. Each section below takes one property of that chain, and names the parts in real radios that implement it.

Executive Summary

The table is a lookup. The three architectures differ in where the signal is translated, and each choice creates a different set of impairments.

Architecture

How it translates

What it is good at

What it suffers from

Real hardware

Zero-IF, also called direct conversion

One quadrature mixer takes the carrier straight to 0 Hz.

Few parts, wide tuning, no image filter, and a baseband filter that is easy to integrate.

DC offset and LO leakage at the centre, IQ imbalance producing a mirror, and flicker noise near 0 Hz.

AD9361 and AD9363, so an ADALM-Pluto, a USRP B200 or a B210.

Low-IF

One mixer to a small fixed IF, a few MHz above 0 Hz.

Moves the wanted signal away from DC, so offset and flicker noise no longer sit on top of it.

The image is now close by, so image rejection depends on quadrature accuracy rather than on a filter.

R820T2 with an IF near 3.57 MHz, feeding an RTL2832U.

Superheterodyne, single or dual conversion

One or more mixers to a high fixed IF, then down to baseband.

Filtering and gain happen at a fixed frequency, which makes both easy to build well.

More parts, more spurious products, and a mixing plan that has to be designed rather than configured.

HackRF One, using an RFFC5072 to a 2.6 GHz IF and a MAX2837 down to baseband.

Direct RF sampling

No mixer at all. The converter samples the band directly.

No mixer spurs, no IQ imbalance, and no LO to leak.

It demands converter bandwidth, converter speed and a very clean sample clock.

HF receivers and instrument-class radios, rather than general-purpose SDR boards.

What does the RF front end have to do before the ADC sees anything?

Three jobs, and they are always the same three. The chain has to select the wanted band, amplify it, and translate it to a frequency the converter can digitise. Everything else on this page is a consequence of doing one of those three imperfectly.

Two limits box the design in, and they work against each other. At the bottom sits the noise floor, and a signal below it cannot be recovered by any later processing. At the top sits saturation, where the chain stops behaving linearly and starts creating products that were never transmitted.

The gap between those two limits is the dynamic range, and it is the single figure worth carrying. Adding gain lowers the effective noise floor and also lowers the level at which saturation begins. So gain does not widen the window. It slides the window up and down.

The noise floor has a value that is worth memorising, because it anchors every later calculation. Thermal noise in a 1 Hz bandwidth at room temperature is -174 dBm. In a bandwidth B the floor is -174 plus 10 log of B, and the receiver adds its own noise figure on top. For a 200 kHz channel that is -174 plus 53, or -121 dBm. A 3 dB noise figure puts the practical floor at -118 dBm.

The top end has no single number, because it depends on which stage gives way first. An amplifier compresses, a mixer generates intermodulation, and the converter clips. The stage that gives way first is rarely the one being watched, which is why saturation is diagnosed rather than predicted.

One more property matters and it is easy to forget. The front end is broadband before it is selective. An antenna delivers everything it receives, so the first amplifier sees the wanted signal together with every transmitter in range. A strong out-of-band signal can therefore saturate a chain that appears to be receiving almost nothing.

  • Three jobs, always the same : Select the band, amplify it, and translate it to a frequency the converter can digitise. Every impairment comes from doing one of them imperfectly.
  • Two limits define the window : The noise floor sits underneath and saturation sits above. The distance between them is the dynamic range.
  • Gain slides the window, it does not widen it : More gain lowers the effective noise floor and lowers the saturation point by the same amount.
  • Anchor everything to -174 dBm : Thermal noise in 1 Hz at room temperature. A 200 kHz channel with a 3 dB noise figure lands at about -118 dBm.
  • The top end is a symptom, not a number : An amplifier compresses, a mixer makes intermodulation, and the converter clips. The first stage to fail has to be found.
  • The chain is broadband before it is selective : A strong out-of-band transmitter can saturate a receiver that appears to be hearing nothing.

Zero-IF, low-IF or superheterodyne: which architecture is the radio using?

This is the first question to ask about an unfamiliar board, because the answer predicts which artefacts will appear on the spectrum. The three architectures differ in one decision only, which is where the signal is translated to. Everything else follows from that.

A zero-IF receiver mixes the carrier straight down to 0 Hz with a quadrature mixer. The wanted signal ends up centred on DC, split into an in-phase and a quadrature path. There is no image to filter. The image is the other half of the same signal, and the quadrature mixer separates the two.

The AD9361 family works this way, so an ADALM-Pluto and a USRP B200 or B210 all share this architecture. Each receive path there carries its own automatic gain control, DC offset correction and quadrature correction. Those three blocks exist because of the impairments the next two sections describe.

A low-IF receiver mixes to a small fixed frequency instead, a few MHz above 0 Hz. The point is to move the wanted signal away from DC, where offset and flicker noise live. The cost is that a real image now exists, and it sits only twice the IF away from the wanted signal.

An RTL-SDR dongle is the everyday example. Its R820T2 tuner uses a low-IF near 3.57 MHz, and the RTL2832U digitises it. So the artefacts on an RTL-SDR are image artefacts, and they behave differently from the centre spike that a Pluto shows.

A superheterodyne receiver translates to a high fixed IF, and often does it twice. Filtering and gain then happen at one frequency that never changes. That is much easier to build well than a filter which tracks the tuning. HackRF One is a dual-conversion design of exactly this kind. An RFFC5072 mixes the input to a fixed 2.6 GHz IF, and a MAX2837 brings that down to baseband IQ.

Direct RF sampling removes the mixer entirely, and the converter digitises the band as it arrives. Nothing can leak from an oscillator that is not there, and no quadrature mismatch exists without a quadrature mixer. It demands converter bandwidth, converter speed and an extremely clean sample clock instead. So it appears on HF receivers and instruments rather than on general-purpose boards.

Figure 1 puts the three mixing architectures side by side. Each row shows where the wanted signal sits after each stage, and the red marker shows where that architecture's characteristic artefact appears.

Where each architecture puts the signal, and where its artefact lands Zero-IF LNA, filter quadrature mixer 0 Hz artefact : a spike at the centre AD9361, so Pluto and B210 Low-IF LNA, filter mixer 3.57 MHz artefact : a mirror image nearby R820T2 into an RTL2832U Superhet LNA, filter mixer 1, to 2.6 GHz RFFC5072 mixer 2 MAX2837 artefact : mixing products HackRF One Direct RF sampling removes the mixer, so it has no LO to leak and no quadrature pair to mismatch. It pays for that with converter bandwidth, converter speed and a very clean sample clock.

Figure 1. The architecture predicts the artefact. A centre spike means zero-IF and a nearby mirror means low-IF. Products that move at odd rates when you retune mean a mixing plan is involved.

  • Ask the architecture first : It predicts which artefacts appear, so identifying it turns a strange spectrum into an expected one.
  • Zero-IF has no image to filter : A quadrature mixer separates the two halves. That is why the architecture needs so few parts and tunes so widely.
  • Low-IF trades DC problems for an image : Moving a few MHz off DC escapes offset and flicker noise. It places a real image twice the IF away.
  • A superhet filters at a fixed frequency : HackRF mixes to 2.6 GHz with an RFFC5072, then to baseband with a MAX2837. Each stage works at one fixed frequency.
  • Direct sampling removes two whole failure classes : With no mixer there is no LO leakage and no quadrature mismatch. The cost moves to the converter and its clock.
  • The correction blocks name the problem : An AD9361 carries DC offset and quadrature correction per channel. That is a direct statement of what zero-IF suffers from.

Why does a direct conversion receiver show a spike at the centre?

Open a Pluto or a B210 on a quiet band and a narrow spike sits at the tuned frequency. It is not a signal, and it stays there whatever the antenna is doing. Two separate mechanisms produce it, and they need different fixes.

The first is DC offset. Every amplifier in the baseband path has some input offset voltage. After the mixer that path extends all the way to the converter. A constant voltage at baseband is a constant, and a constant is 0 Hz. Since 0 Hz at baseband is the tuned frequency at RF, the offset appears exactly at the centre of the display.

The second is LO leakage, and it is the more interesting one. The local oscillator runs at the tuned frequency and it is physically close to the mixer input. Some of it couples back and reaches the mixer input, where the mixer multiplies the LO by itself. Multiplying a sine wave by itself produces a DC term, so the leakage lands at 0 Hz as well.

That mechanism is called self-mixing, and it explains a behaviour that otherwise looks like a fault. The spike tracks the tuning perfectly, because it is generated by the thing that sets the tuning. Moving the radio, changing the antenna and terminating the input all leave it where it is.

Flicker noise sits underneath both of them. Semiconductor noise rises as frequency falls. So the region around DC is noisier than the rest of the band, even with no offset at all. A zero-IF receiver puts the wanted signal exactly there, which is the fundamental objection to the architecture.

Three responses are used, and the first is the one to reach for on a bench. Tune deliberately off centre, then shift the signal back in software. A 1 MHz offset moves the wanted signal away from the spike, at the cost of a little extra bandwidth. Every SDR application offers it as an option.

The second is the correction built into the chip. An AD9361 carries DC offset tracking per channel, and it estimates the offset and subtracts it continuously. The limitation is that tracking assumes the wanted signal has no genuine DC component of its own, which is not true for every modulation.

The third applies to transmit rather than receive, and it is worth naming because the symptom is visible to other people. LO leakage on a transmitter emits an unmodulated carrier at the centre of your own signal. A quadrature calibration reduces it, and an uncalibrated transmitter radiates a tone that a receiver will see as interference.

  • Two mechanisms, one symptom : Amplifier DC offset and LO self-mixing both land at 0 Hz, which is the tuned frequency at RF.
  • Self-mixing explains the tracking : The LO leaks to the mixer input and multiplies itself. So the spike follows the tuning exactly and ignores the antenna.
  • Flicker noise raises the floor too : Semiconductor noise grows as frequency falls, so the region a zero-IF receiver uses is inherently the noisiest.
  • Tuning off centre is the bench fix : Offset the LO by a megahertz and shift back in software. It costs a little bandwidth and nothing else.
  • Chip correction has an assumption : DC offset tracking assumes the wanted signal carries no real DC component, which some modulations violate.
  • On transmit the leakage is radiated : An uncalibrated transmitter emits a carrier in the middle of its own signal. That one is other people's problem too.

What is IQ imbalance, and why does it produce a mirror image?

A quadrature mixer relies on two paths being identical in gain and exactly 90 degrees apart in phase. Neither is ever exactly true. The result is a mirror image, and it is the second characteristic artefact of a quadrature receiver.

The mechanism is worth stating in one sentence, because the usual explanation goes through algebra that hides it. A perfect quadrature pair can distinguish a signal above the LO from a signal below it. An imperfect pair cannot separate them completely, so some of each leaks into the other.

The visible result is a copy of every signal reflected about the tuned frequency. A transmission 1 MHz above the centre produces a weaker copy 1 MHz below it. The copy moves the opposite way when the real signal moves. That is the quickest way to tell an image from a real transmission.

The number that quantifies it is the image rejection ratio. A gain mismatch of about 1 percent, together with a phase error of about 1 degree, gives roughly 40 dB of rejection. Getting to 60 dB needs both errors about ten times smaller. That is difficult to hold across a wide tuning range and across temperature.

That difficulty is why the correction is digital. An AD9361 includes quadrature correction, with a static and a tracking component. It estimates the gain and phase error, then applies the inverse. The correction is applied per channel, and it has to be redone when the tuning or the gain changes appreciably.

Low-IF receivers depend on the same correction for a different reason. There the image is a genuinely different signal rather than a reflection of the wanted one. So poor rejection puts an unrelated transmission on top of the wanted one. On an RTL-SDR that is the mechanism behind a station appearing where no station exists.

One diagnostic separates image from reality in a few seconds, and it needs no equipment. Retune the receiver by a small amount and watch which way each feature moves. A real signal stays at its own frequency, so on a display referenced to the tuned frequency it moves one way. An image moves the other way, at the same rate.

  • Two paths that are never identical : A quadrature mixer needs equal gain and exactly 90 degrees. The residual error is what creates the image.
  • The image is a reflection about the centre : A signal 1 MHz above the tuned frequency produces a weaker copy 1 MHz below it.
  • 1 percent and 1 degree is about 40 dB : Reaching 60 dB needs both errors roughly ten times smaller, across tuning range and temperature.
  • The correction is digital and conditional : An AD9361 estimates gain and phase error and inverts it. The estimate has to be refreshed after a retune.
  • On low-IF the image is a different signal : Poor rejection there delivers an unrelated transmission, rather than a copy of the wanted one.
  • Retune to identify it : A real signal and its image move in opposite directions at the same rate. That settles the question without any equipment.

Where should the gain go?

Total gain is the number people set, and position is the number that decides the result. The same total gain placed differently gives a receiver that hears weak signals, or one that overloads on the first strong one. One equation settles where it belongs.

The cascade rule says that the noise figure of a chain is dominated by its first stage. Each later stage contributes its own noise divided by all the gain in front of it. So a stage with 20 dB of gain in front of it contributes a hundredth of what it would contribute alone.

The practical consequence is short. Put a low-noise amplifier first, and put it as close to the antenna as possible. A cable before the amplifier adds its loss directly to the noise figure. So 3 dB of coax in front of an LNA costs a full 3 dB. The same 3 dB after the LNA costs almost nothing.

A worked example makes the size of the effect concrete. Take an LNA with a 1 dB noise figure and 20 dB of gain, followed by a receiver with a 10 dB noise figure. The chain comes out at about 1.4 dB. Reverse the order, so the cable and receiver come first, and the chain is 10 dB whatever the amplifier does afterwards.

The opposite error is just as common and it is harder to spot. Too much gain drives the converter into clipping, and the display then fills with products that are not on the air. A receiver reporting a full-scale indication has already stopped being a measurement instrument.

So the target is neither maximum nor minimum. Set the gain so that the strongest signal present sits a few dB below the converter's full scale. Then check that the noise floor still rises when the antenna is connected. If connecting the antenna does not raise the floor, the receiver is limited by its own noise. More gain in front will help.

That last test deserves a name because it is the most useful one on this page. It is the noise floor test, and it distinguishes the two failure modes directly. A floor that does not move means too little gain at the front. A floor full of spurious products means too much.

Figure 2 draws both arrangements with the cumulative noise figure after each stage. The two chains contain identical parts, and only the order differs.

Same parts, different order, and a 8.6 dB difference in noise figure LNA first antenna LNA, NF 1 dB gain 20 dB cable, 3 dB loss receiver, NF 10 dB total 1.4 dB Cable first antenna cable, 3 dB loss LNA, NF 1 dB gain 20 dB receiver, NF 10 dB total 10 dB Each stage contributes its own noise divided by all the gain in front of it. So loss before the first amplifier is paid in full, and the same loss after it costs almost nothing. The opposite error is invisible here : too much front-end gain clips the converter instead.

Figure 2. Position beats quantity. Moving the amplifier in front of the cable is worth 8.6 dB here. Buying a better receiver behind the cable would be worth almost nothing.

  • The first stage dominates : Later stages contribute their noise divided by all the gain ahead of them. So the front of the chain decides the noise figure.
  • Loss before the LNA is paid in full : 3 dB of cable in front costs 3 dB of noise figure. The same cable behind the LNA costs almost nothing.
  • The example is 1.4 dB against 10 dB : Identical parts in the opposite order. That is why an antenna-mounted amplifier is worth the installation trouble.
  • Too much gain is the other failure : Clipping fills the display with products that were never transmitted. A full-scale reading is not a measurement.
  • Aim a few dB below full scale : Set the gain from the strongest signal present rather than from the weakest one you hope to find.
  • Use the noise floor test : If connecting the antenna does not raise the floor, add front-end gain. If the floor fills with spurs, remove it.

How much signal can it take before it stops being linear?

Every stage is linear until it is not, and the transition is gradual rather than sudden. Two numbers describe it, and both appear on datasheets in a form that is easy to misread. They matter because a saturated front end invents signals, and invented signals waste a great deal of time.

The first number is the 1 dB compression point, written P1dB. It is the input level at which the output has fallen 1 dB below what a linear stage would produce. Above it the stage still works, and it no longer scales, so amplitude measurements taken there are wrong.

The second number is the third-order intercept, written IIP3 when referred to the input. It describes intermodulation rather than compression. When two signals are present, the stage produces new signals at twice one frequency minus the other. Those products land close to the originals rather than far away.

Proximity is what makes third-order products the dangerous ones. Two transmissions at 100.1 and 100.3 MHz generate products at 99.9 and 100.5 MHz. Filtering cannot remove them, because they are inside the band being received.

The intercept point is a projection rather than a measurement, and knowing that prevents a common confusion. The wanted output grows 1 dB for every 1 dB of input, and the third-order product grows 3 dB for every 1 dB. Extending both lines until they cross gives the intercept, and the stage saturates long before the input ever reaches it.

That 3 to 1 slope is also the field diagnostic, and it needs no instrument beyond the receiver itself. Reduce the input by 10 dB with an attenuator. A real signal falls by 10 dB, and a third-order product falls by 30 dB. If a suspect feature disappears when a real one merely dims, it was never on the air.

Blocking is the same phenomenon described from the other end. A strong signal outside the wanted channel compresses the front end and reduces the gain available to everything else. The wanted signal then fades without changing at all. The strong signal does not have to be anywhere near the tuned frequency, which is what makes this hard to guess.

Figure 3 draws the two slopes and the intercept, and it shows why the intercept point is never reached in practice.

input level, dB output level, dB wanted signal, slope 1 third-order product, slope 3 IIP3, a projection P1dB : real compression starts the stage never reaches IIP3 Field test : attenuate the input by 10 dB. A real signal drops 10 dB and a third-order product drops 30 dB.

Figure 3. The intercept is where the two lines would meet, and compression stops the stage well before that. The 3 to 1 slope is the useful part, because it turns a 10 dB attenuator into a test for whether a signal is real.

  • P1dB marks the end of proportionality : Above it a stage still works and no longer scales, so amplitude readings taken there are wrong.
  • Third-order products land in band : Two signals at 100.1 and 100.3 MHz produce products at 99.9 and 100.5 MHz. No filter can remove them.
  • IIP3 is a projection, not a rating : It is where the slope 1 and slope 3 lines would cross. Compression arrives long before the input gets there.
  • The 10 dB attenuator settles it : A real signal falls 10 dB and a third-order product falls 30 dB. That identifies an invented signal in seconds.
  • Blocking needs no nearby signal : A strong out-of-band transmitter compresses the front end, and the wanted signal fades without changing at all.
  • Saturation invents rather than degrades : A weak signal is merely noisy, and a saturated front end adds features that were never transmitted.

How does AGC decide, and when does it get it wrong?

Automatic gain control solves the problem of the previous two sections without asking the user anything. It measures the level reaching the converter and moves the gain to keep it in range. That works well for continuous signals, and it fails in ways worth recognising for everything else.

The loop has two time constants and they are deliberately different. Attack is fast, because a signal that suddenly appears has to be turned down before it clips. Decay is slow, because raising the gain immediately after a signal ends would pump the noise floor up and down continuously.

That asymmetry is exactly what breaks on pulsed transmissions. A radar pulse, a burst from a time division system or a frequency hopping signal all arrive, trigger the fast attack, and then stop. The gain stays low through the quiet period, so the receiver is deaf immediately after every burst.

A second failure is more subtle, and it corrupts measurements rather than losing them. The AGC responds to total power reaching the converter, not to the power of the wanted signal. A strong neighbour therefore reduces the gain, and the wanted signal drops with it. Its apparent level then depends on what else is on the air.

The consequence for measurement work is direct. Any amplitude comparison across time needs the gain held fixed, because a changing gain makes the record uninterpretable. Every SDR framework offers manual gain, and using it is the difference between a measurement and an impression.

An AD9361 exposes the middle ground, and it is the setting most people should be using. Its gain control runs in a slow attack mode, a fast attack mode, or under manual control. Each receive path has its own. Slow attack suits continuous signals, fast attack suits bursts, and manual suits anything being measured.

One habit removes most of the confusion, and it costs one line in a script. Record the gain setting alongside the samples. A capture with a moving gain and no gain log cannot be turned into absolute levels. That discovery usually arrives too late to repeat the measurement.

  • Attack is fast and decay is slow : The asymmetry protects the converter from sudden signals without pumping the noise floor after they end.
  • Pulsed signals defeat it : Radar, burst and hopping transmissions leave the gain low through the quiet period. The receiver is then deaf just after each burst.
  • It responds to total power : A strong neighbour lowers the gain. The apparent level of the wanted signal then depends on what else is transmitting.
  • Measurement needs manual gain : Amplitude comparison across time requires a fixed gain, otherwise the record cannot be interpreted afterwards.
  • Real chips offer three modes : An AD9361 runs slow attack, fast attack or manual per receive path. Those map onto continuous, bursty and measured signals.
  • Log the gain with the samples : An unlogged moving gain makes absolute levels unrecoverable. That is discovered too late to repeat the capture.

What does the filtering actually protect against?

Filters look like the least interesting part of the chain. They decide whether the rest of it survives contact with a real antenna. Three distinct jobs are involved, and a board that skips one of them fails in a way the datasheet does not mention.

The first job is anti-aliasing. Any energy above half the sampling rate folds back into the digitised band, and once folded it cannot be separated from a real signal. So a filter before the converter is not optional, and its stopband has to reach the level the converter can resolve.

The second job is image rejection, and it applies only to architectures that have an image. A low-IF receiver has one at twice the IF away, and a superheterodyne has one at twice the IF from the wanted frequency. Filtering it before the mixer is easier than correcting it afterwards, which is a large part of why a superhet uses a high IF.

The third job is protecting against out-of-band signals, and this is the one that matters most on a bench. The previous sections showed that a strong transmitter anywhere in the passband can compress the front end. A filter that removes it restores the whole dynamic range, and nothing in software can achieve the same thing.

The everyday case makes the point better than any specification. Point a wideband dongle at an antenna near an FM broadcast transmitter. Signals then appear across the spectrum that have nothing to do with FM. Broadcast FM runs at very high power, and the dongle has almost no input filtering. The front end is being compressed by energy it is not trying to receive.

The fix is a physical part costing very little. An FM band-stop filter between the antenna and the receiver removes the broadcast band and leaves everything else. The spurious signals disappear with it. A band-pass filter for the band of interest does the same job more thoroughly.

One general point follows, and it is the reason this section closes the page. Filtering is the only tool that improves dynamic range rather than trading it. Gain slides the window and AGC moves it automatically. A filter removes the signal that was forcing the window to the wrong place.

  • Anti-aliasing is not optional : Energy above half the sampling rate folds into the band and becomes indistinguishable from a real signal.
  • Image rejection depends on the architecture : Only designs with a real image need it, and filtering before the mixer beats correcting after it.
  • Out-of-band signals compress the front end : A strong transmitter anywhere in the passband costs dynamic range everywhere in it.
  • The FM broadcast band is the usual culprit : Wideband dongles with little input filtering show products across the spectrum near a broadcast site.
  • A physical filter is the fix : An FM band-stop or a band-pass filter at the antenna removes the cause. No software setting substitutes for it.
  • Filtering is the only tool that adds dynamic range : Gain and AGC move the window. A filter removes what was pushing it to the wrong place.

Reference

The list below is where the device architectures and part numbers come from. The vendor documentation is the authority for anything specific to a chip. The ShareTechnote pages carry the stages that follow this one.