Sunteți pe pagina 1din 7

An Introduction to RF for SDR Beginners

This is a short guide on Radio Frequency which will introduce the concept of electromagnetic
waves, the basics of digital modulation including their uses and a rough overview of I/Q
sampling and why it works. I've tried to keep the maths minimal, but due to the nature of RF,
it is not completely avoidable. This guide was written by Xcellerator for the Hak5 Forums.

What is RF?

RF, or Radio Frequency is a section of electromagnetic spectrum. The electromagnetic


spectrum can be broadly defined as 'light'. It includes everything from gamma rays and
x-rays down through infrared, ultra-violet (as well as visible light) to WiFi, bluetooth,
microwaves all the other radio waves that we can use to transmit and recieve information.
Before we continue, we'll need to define a few terms:
Wave: Repeated motion through a field; most of the waves we'll be dealing with are called
sine waves.

Wavelength: The distance between two identical points on a wave-cycle, i.e the distance
between two peaks. Measured in metres (m).

Frequency: The number of complete cycles per second. Measured in Hertz (Hz).

Amplitude: The vertical distance between the peak and initial line (the solid grey line in the
image above). Units vary. The peak amplitude is also called the power.

The wavelength and frequency are the defining characteristics of electromagnetic waves. All
electro magnetic waves travel at the speed of light, often mathematically labeled as c. The
value of c is 299,792,458 m/s. Although electromagnetic waves will actually travel at
different speeds depending on what medium they are travelling through (air, brick, wood,
etc), the value of c remains approximately constant.

Written by Xcellerator for Hak5 Forums


The part of the electromagnetic spectrum that we use for RF is the region that contains
longer wavelengths than the rest. It's a good idea to note that wavelength and frequency are
proportional to each other via the following equation:

frequency = speed of light / wavelength

What this tells us is that when the wavelength is large, the frequency is small and vice
versa.
We use this region of the spectrum because longer waves remain more coherent over large
distances, meaning they don't change very much as they propagate (travel).

An Electromagnetic Wave

If you glance at the sine wave image above, you will see that it continues in the same
pattern both infinitely forwards and backwards. An electromagnetic wave is composed of
two parts, an electric wave and a magnetic wave. The key to know is that electric waves
produce magnetic fields at right angles to itself and vice versa. This is how an elctromagnetic
wave propagates through a region of space. As is demonstrated in this handy GIF courtesy
of Google Images.
http://www.astronomynotes.com/light/emanim.gif

With this in mind it is easy to see how an electric current running through an aerial will
generate an electromagnetic field (when lots of electromagnetic waves are produced, we
tend to call it a field). Depending on how we apply the current across the aerial, we get
different waves.

Digital Modulation What is it?

Modulation is a fancy word for changing. We use modulation to encode digital data (1s and
0s) into analogue information that is carried by a carrier wave. The carrier wave is initially a
sine wave, but is transformed (or modulated) into a more distinct shape in order to represent
our information which is called the baseband signal.

In order to understand how modulation works, I'm afraid a small bit of maths is required. Its
not much, I promise! We can describe our carrier signal by the following equation:
c = Asin(2f + )
A = the amplitude of the wave
f = the frequency of the wave
= the phase
We need some new definitions:
Phase Angle: The Phase Angle is the name we give to the speed that the angle is changing
added to the phase, i.e 2f + is equal to the phase angle.

Phase: The Phase is difference between the progress of two otherwise identical waves.
This is a bit hard to understand, so imagine this: Pretend you can start EM
(electromagnetic) waves by yourself. Imagine starting one off, then another a
few seconds later. They'll both be identical apart from the fact that they are
out-of-sync. The amount by which they're both out of sync is called the phase.

Written by Xcellerator for Hak5 Forums


As you can see, we have three variables: A, f and (the greek letter phi, pronouced f-eye).
By varying each one we modulate the wave in a different way!

Digital Modulation Type 1: ASK


Varying amplitude is called Amplitude Shift Keying or ASK. Our bits of data from the
baseband signal are modulated onto our carrier wave like so:

As you can see, areas of high amplitude correspond to a 1, and areas of low amplitude
correspond to a 0. This is a very basic form of modulation and is very susceptible to
interference, so is only really used in optical fibres where there is very little chance of the
wave becoming decoherent, but also because it requires a much lower power to transmit and
the equipment is cheaper!

Digital Modulation Type 2: FSK


Varying the frequency to encode a digital signal is referred to as Frequency Shift Keying or
FSK. The changes in frequency across the wave are proportional to the order of 1s and 0s in
our data (from the baseband signal). Its VERY important to remember that the time until the
frequency is changed is very important. For example, if you wanted to send two '0's, then
you'd have to have a region of low frequency twice as long as if you wanted to send one '0'!

The dotted blue line here illustrates the binary data being carried (in this case, it's 0101) by
the signal. The frequency (remember the number of complete wave cycles per second!) is
drastically different across the wave. We refer to the frequency corresponding the '1' as the
mark frequency because its what we mark against (or refer to). The '0' is the space
frequency because its more spaced out than the mark frequency. For any oldschool BBS
users, this may be starting to ring some bells because FSK is what was used in the old
dial-up modems! FSK was used because even on low power microcontrollers its relatively
easy to demodulate the signal.

Written by Xcellerator for Hak5 Forums


Digital Modulation Type 3: PSK
Finally, if we vary the phase of the signal to transmit data, we call it Phase Shift Keying or
PSK. In PSK, increasing the phase of the signal, corresponds to a '1' and surprisingly
enough, decreasing the phase equates to a '0'!

Although on the cover, PSK may look fantastically enticing (if you're as nerdy as I am..!) due
to its ability to remain coherent. Unfortunately though, the equipment required is pretty
complex and demodulators have to be specifically designed to work with the modulators
settings. However, there is a form of PSK called Binary Phase Shift Keying that only uses
two phases at 0 and 180, hence is only capable of modulating 1 bit per symbol. Despite its
low data-rate, BPSK is more than suitable for many forms of RFID communications!
You may be wondering what form of modulation the WiFi standard uses. The answer is
really beyond the scope of this article, but suffice to say that it uses more complex forms of
PSK depending on whether its 802.11b or 802.11a/g/n

Reception

Now that we understand some of the ways that digital data can be modulated onto an
analogue carrier wave, we can talk about how signals are actually received and interpreted.
First, we're going to talk about something called 'sampling'.

Refer back to the image of the wave earlier on. Lets say you want to receive that signal so
you can process in with some software on your computer. How could you go about that? Any
mathematicians will already know that one of the key characteristics of sine waves is that
they are continuous. This is because we measure them against time.
If you don't get this, imagine a number line. How many times can you 'zoom' into it? How
many times can you divide a number into smaller parts? The answer is infinitely! The same
goes for time! We can't have our computer recording an infinitely large set of data! We'd be
there all night! (or there abouts...)
The way we get around this problem is by taking samples of the wave. Essentially, we divide
the wave up to into suitably small chunks and take the average readings from each chunk. As
long as our chunks (from now on - samples) are small enough then the inaccuracy of our
data is so small that it really doesn't matter. The sample rate is the number of samples we
take per second!
This probably sounds a bit of a cheat, but if you imagine that the innacuracy arising
interference is millions of times greater than the innacuracy from sampling, then the problem
pretty much clears itself up.

Now imagine a wave travelling through space towards our antenna. So far, we have always
drawn our diagrams in two-dimensions. However, we do not live in a two-dimensional world.
This creates a problem for us. To demonstrate, I'd like you to grab some pipe-cleaner or firm

Written by Xcellerator for Hak5 Forums


wire and bend it roughly into the shape of a sine wave.
1. Now hold it out infront of you by the ends. Like this, you should see that the wave is clear
and our samples would be accurate.
2. Move on your hands away from you so that the wave is at an angle to your field of vision.
This is a very different wave you can now see with a higher frequency that what our actual
wave has. If we were to take samples from this, we would be hideously innacurate.
3. Bring the wave back to how you held it to begin with. Finally, tilt the bottom half towards
you so that the top half tilts away. Yet again, you can see a different wave with a smaller
amplitude that doesn't represent our initial wave at all!

What can we do about this problem? The answer is in the form of a very special kind of
sampling, reffered to as I/Q Sampling.

What we do with I/Q Sampling is sample the wave head on AND from directly above. This
might sound a little odd, but with some very basic maths skills we'll quickly see how easy it is
to extract our true wave from an I/Q Sample.

We are going to draw a graph.

As you can see, we have two axes, one labelled Q and one labelled I. We are now going to
take two (imaginary) samples and plot them on our graph. The side view sample will be
plotted on the I-axis, and the top view sample on the Q-axis.
The data we record is:
I = 0.3
Q = 0.4

Written by Xcellerator for Hak5 Forums


Therefore:

So how do we combine this data to give us our actual wave properties at this point in time?
Our good old friend Pythagroas (don't groan!) is going to help us!
0.3 + 0.4 = A
A = 0.5
I've chosen A for this because this is the actual amplitude value!

Written by Xcellerator for Hak5 Forums


And, ofcourse we can use Trigonometry to find which is the phase angle because I/Q
sampling assumes that the real signal on the I-axis is a form of I = Acos().

cos() = 0.3 / 0.5


cos() = 0.6
= 53.13

So, now we know, our Amplitude is 0.5 and is 53.13. If we know ASK is being used, then
we can proceed because we know the maximum amplitude!
If we know FSK is being used, then we can also proceed because we know that = 53.13
and the phase isn't going to change.
If we wanted to demodulate PSK, then we'd need a bit more information from the modulator
to be able to get the raw data back.

Conclusion

I hope this guide has been helpful to those are looking to better understand Radio Frequency
technology for what it is, rather than just this mysterious thing called radio waves. Although
it's been written from a physicists point of view (because I am one!) it should help you to be
better able to visualise what is actually going on when you plug in that antenna, or switch to
FSK modulation.

Notes

Any physicists reading this may have noticed that certain definitions and explanations
relating to electromagnetism have been smudged slightly to allow for an easier read. This is
for convenience only as an indepth knowledge of the mathematics and terminology of
electromagnetic fields is not required to be able to understand and use Radio Frequency
technology effectively.

Readers may have noticed that I have tended to use the terms sine and cosine almost
synonymously. While this is not mathematically correct, as far as RF and the overall shape of
the waves is concerned, we are alright to do so.

For those interested, the relationship between cosine and sine is as follows:
cos(x) = sin(90 - x)

Written by Xcellerator for Hak5 Forums

S-ar putea să vă placă și