1 00:00:01,260 --> 00:00:04,320 So, I'm Nick, the Exploding Lemur. 2 00:00:05,340 --> 00:00:10,060 I'm going to zarg you about RF, and how it kind of works. 3 00:00:10,900 --> 00:00:14,680 So, I'm, you know, like pretty much everyone else here, a geek. 4 00:00:14,680 --> 00:00:16,660 I've been playing with computers forever. 5 00:00:16,660 --> 00:00:23,100 I've been a ham radio guy for mumble mumble years, because I'm old. 6 00:00:24,160 --> 00:00:25,660 Playing with RF. 7 00:00:25,660 --> 00:00:28,440 I've been coming to DEF CON since DEF CON 7. 8 00:00:28,780 --> 00:00:30,160 That's a great time. 9 00:00:30,540 --> 00:00:31,680 Whee! 10 00:00:31,680 --> 00:00:33,340 Welcome to DEF CON. 11 00:00:33,980 --> 00:00:38,100 And the lack of speakers, it just sort of a, you know, whatever. 12 00:00:38,100 --> 00:00:39,340 It happens. 13 00:00:40,660 --> 00:00:44,860 So, what is radio? 14 00:00:44,860 --> 00:00:47,960 When we're receiving radio, what are we seeing? 15 00:00:48,240 --> 00:00:55,880 This is the chunk of the electromagnetic spectrum that is usually referred to as radio. 16 00:00:56,600 --> 00:01:07,320 So, everything here is measured in cycles, or hertz, which is the number of wiggles per second that an electron makes. 17 00:01:07,720 --> 00:01:12,640 Goes all the way from, as we sometimes say, DC to daylight. 18 00:01:12,640 --> 00:01:17,680 So, zero hertz all the way up to literal visible light and beyond. 19 00:01:17,680 --> 00:01:20,460 Those are all electromagnetic waves. 20 00:01:21,260 --> 00:01:22,220 Error. 21 00:01:23,240 --> 00:01:33,840 Usually, we don't deal with the visible light or infrared or UV, but all of this is just kind of, you know, in the radio milieu. 22 00:01:35,820 --> 00:01:40,940 So, we can zoom in and... Okay, there we go. 23 00:01:40,980 --> 00:01:43,380 So, we can see there's kind of this chunk of radio spectrum. 24 00:01:43,380 --> 00:01:46,240 Above it, you have all of the higher energy stuff. 25 00:01:46,240 --> 00:01:56,040 So, infrared, visible light, UV, x-rays, and all of the fun stuff beyond that is very spicy and you don't want. 26 00:01:56,500 --> 00:01:59,080 Something to note about RF. 27 00:01:59,080 --> 00:02:07,800 Whenever you see something that says, RF radiation or radio radiation, it is non-ionizing radiation. 28 00:02:07,800 --> 00:02:13,140 All RF can do is heat things, and not very well. 29 00:02:13,520 --> 00:02:18,580 So, don't worry about 5G altering your DNA or some bullshit like that. 30 00:02:18,740 --> 00:02:20,440 It's all a bunch of crap. 31 00:02:22,640 --> 00:02:34,520 So, usually, the electromagnetic spectrum is split up by whatever your regional authority is into different bands for different specific use cases. 32 00:02:34,640 --> 00:02:45,400 So, you know, land mobile for general commercial use, there's some public safety stuff, maritime, satellite, it's all split up into different frequencies. 33 00:02:50,180 --> 00:02:54,760 Basically, what this is, think of a slinky. 34 00:02:55,180 --> 00:02:57,720 That's an electromagnetic wave. 35 00:02:57,720 --> 00:03:07,720 You wiggling it is basically you oscillating a charge on some sort of tuned object. 36 00:03:07,720 --> 00:03:09,500 We call them antennas. 37 00:03:10,360 --> 00:03:14,960 And that object is resonant at some wiggling rate. 38 00:03:15,040 --> 00:03:27,620 And so, as you do this wiggling of electrons at, you know, 100 megahertz, say 100 million times a second, then that produces an electromagnetic wave that propagates through the universe. 39 00:03:29,460 --> 00:03:32,360 You end up with two components of this wave. 40 00:03:32,480 --> 00:03:37,560 There's an electric field and perpendicular to that is a magnetic field. 41 00:03:37,940 --> 00:04:00,680 You can actually set up antennas that are specifically designed to pick up what is called the H field or magnetic field, which is kind of cool for some frequencies that tend to be very noisy as the magnetic portion of it tends to have less local noise generated. 42 00:04:00,900 --> 00:04:07,980 So if you have like an HF listening station, then and set up a magnetic antenna and it doesn't sound quite as terrible. 43 00:04:09,180 --> 00:04:14,600 Anyway, oh, this is going to be fun. 44 00:04:16,740 --> 00:04:19,220 I am going to go into a little bit of math here. 45 00:04:19,440 --> 00:04:22,300 It's not too bad, so stay with me. 46 00:04:23,720 --> 00:04:33,000 So the speed of light is 299,792,458 meters per second. 47 00:04:33,000 --> 00:04:37,300 For simplicity purposes, we're going to round that up to 300 million. 48 00:04:37,300 --> 00:04:39,220 I'll show you why in a moment. 49 00:04:39,720 --> 00:04:43,600 Speed of light is constant ish. 50 00:04:44,680 --> 00:04:48,020 This is the speed of light in a vacuum. 51 00:04:48,400 --> 00:04:55,600 I'm going to talk about velocity factor later because physics is fun. 52 00:04:57,240 --> 00:05:08,260 We have the decibel, which is a logarithmic unit of measurement. 53 00:05:09,720 --> 00:05:14,560 Every 10 decibels is an increase of 10 times. 54 00:05:14,700 --> 00:05:23,380 So 10 dB is 10 times, 20 dB is 100 times, 30 dB is 1000 times, and so on. 55 00:05:23,540 --> 00:05:26,780 Also a handy one is that 3 dB is double. 56 00:05:27,020 --> 00:05:38,240 So 3 dB 2 times, 6 dB 4 times, 9 dB 8 times, and then the little bit more gets you to 10 dB of 10 times. 57 00:05:41,280 --> 00:05:44,780 And then we have dBm, which is the unit of measurement. 58 00:05:44,780 --> 00:05:47,660 It's decibels in relation to milliwatts. 59 00:05:47,660 --> 00:05:50,100 So a decibel is unitless. 60 00:05:50,520 --> 00:05:58,020 In order for it to make sense, you can just say decibel and have it as a relative change, or you can have it in relation to something. 61 00:05:58,380 --> 00:06:05,140 So 0 dBm is 1 milliwatt, 10 dBm, 10 dBm, 10 milliwatts, etc. 62 00:06:05,260 --> 00:06:07,700 And that's what we measure RF power. 63 00:06:09,920 --> 00:06:13,000 Oh, come on. 64 00:06:14,470 --> 00:06:15,870 No, there we go. 65 00:06:15,870 --> 00:06:24,750 Okay, so another measure of an RF signal is its wavelength. 66 00:06:24,750 --> 00:06:30,150 The wavelength and the frequency are inversely proportional. 67 00:06:30,150 --> 00:06:37,630 As you go up in frequency, you go down in wavelength. 68 00:06:38,330 --> 00:06:51,410 It's basically the the wavelength is the amount of space a single wave propagates over at the speed of light in a vacuum. 69 00:06:51,410 --> 00:06:57,910 And the frequency is the number of times you're really wiggling it per second. 70 00:06:57,910 --> 00:07:06,810 So think as you wiggle something once per second, that one wave as it propagating out is very long. 71 00:07:06,810 --> 00:07:12,490 To wiggling something 100 times a second, it's producing these really short waves. 72 00:07:15,050 --> 00:07:25,810 We have 100 megahertz signal, 300 million meters per second as the rounded up value, divided by 100 million cycles per second. 73 00:07:26,150 --> 00:07:32,150 The second values cancel out, and so we end up with 3 meters per cycle. 74 00:07:32,150 --> 00:07:34,550 So 100 megahertz, the wavelength is 3 meters. 75 00:07:36,050 --> 00:07:38,490 Come on, here we go. 76 00:07:38,490 --> 00:07:44,210 10 megahertz, same calculation, except now we see it's 30 meters. 77 00:07:44,210 --> 00:07:48,710 So lower frequency, larger wavelength. 78 00:07:53,380 --> 00:07:57,900 Let's talk a little bit about kind of the history of radio. 79 00:07:57,900 --> 00:08:07,160 Early transmitters were called spark gap transmitters, and it was literally just two electrodes and you zap energy between them. 80 00:08:07,160 --> 00:08:12,340 It produces a spark that produces just a huge amount of broadband RF noise. 81 00:08:12,820 --> 00:08:15,580 These were basically used for vorse coats. 82 00:08:15,580 --> 00:08:17,400 It's called CW, continuous wave. 83 00:08:17,400 --> 00:08:20,500 So it's basically, it's on or it's off. 84 00:08:21,200 --> 00:08:22,440 And they would do that. 85 00:08:22,740 --> 00:08:29,680 It's really inefficient, uses up a whole lot of spectrum, really noisy. 86 00:08:29,680 --> 00:08:31,380 So it wasn't that great. 87 00:08:32,820 --> 00:08:39,420 Crystal radios made use of a tuned circuit. 88 00:08:39,420 --> 00:08:48,580 You have an inductor or some sort of coil and some type of capacitor. 89 00:08:48,840 --> 00:08:56,300 So you can actually have an actual capacitor, or you could use parasitic capacitance of the antenna, which I'll talk about a little bit more later. 90 00:08:56,300 --> 00:09:01,280 And then you have a diode or what they called the crystal. 91 00:09:01,280 --> 00:09:07,300 It's just like a germanium diode, or sorry, germanium crystal, which is one of the early diodes. 92 00:09:07,300 --> 00:09:13,580 And that would actually directify the signal to produce an audio wave. 93 00:09:14,260 --> 00:09:18,620 And I'll talk about the modulation of that a little bit later. 94 00:09:18,620 --> 00:09:23,820 That was used for AM reception, amplitude modulation. 95 00:09:24,740 --> 00:09:37,080 Vacuum tubes, we had basically diode type tubes that produce the rectification and triodes, which are used to provide the amplification. 96 00:09:37,480 --> 00:09:47,760 And then of course, transistor radios, where we had little solid state devices to produce the amplification as well as do the rectification of the signal. 97 00:09:48,680 --> 00:10:00,180 And then software defined radios, where you digitize the RF spectrum as close to the antenna as you can, and then do everything else in software. 98 00:10:00,180 --> 00:10:10,260 Just run a whole bunch of map on it in an FPGA or computer, and then get your signal or your resulting stuff out of that. 99 00:10:13,250 --> 00:10:17,780 So receiving the wave, we use an antenna. 100 00:10:17,920 --> 00:10:22,700 This is a dipole antenna, so-called, because it has two holes. 101 00:10:24,000 --> 00:10:25,770 Let's see if my mouse can... 102 00:10:29,220 --> 00:10:46,560 Okay, so as the signal propagates through, it basically resonates these elements of the dipole and produces a wiggling charge on those, which you detect, and that's what you receive with your radio signal. 103 00:10:50,300 --> 00:10:55,300 Antennas are tuned to radiate for a particular frequency and bandwidth. 104 00:10:55,300 --> 00:10:59,040 So bandwidth is literally the width of the band. 105 00:10:59,040 --> 00:11:12,700 You have a chunk of radio spectrum that you receive there, and an antenna is typically tuned to live within some chunk of bandwidth of some frequency. 106 00:11:12,700 --> 00:11:32,080 So you can have a single band like FM broadcast antenna that's usually tuned to receive okay-ish between 88 and 108 megahertz, or you can have a dual band ham radio antenna that's tuned for 146 and 440 megahertz. 107 00:11:32,600 --> 00:11:35,120 So an antenna... 108 00:11:45,910 --> 00:11:46,790 So 109 00:11:55,740 --> 00:12:02,520 when you want to talk about antenna performance, antenna gain is also measured in decibels. 110 00:12:04,380 --> 00:12:14,660 It's decibels isotropic, so in relation to an antenna that radiates perfectly in all dimensions, which does not exist. 111 00:12:14,800 --> 00:12:17,520 So that would be a zero dbi antenna. 112 00:12:17,520 --> 00:12:30,580 Typically what you get is a basic dipole is going to be a 3 dbi antenna, and that's going to radiate mostly all around, kind of in a donut-shaped radiation pattern. 113 00:12:31,260 --> 00:12:41,120 As you increase the gain, it increases the signal strength, but reduces the area in which it sends it. 114 00:12:41,120 --> 00:12:48,640 So think of a dipole, 3 dbi, sends out a broad swath everywhere. 115 00:12:48,640 --> 00:13:02,920 Go to a 9 dbi dipole, and your radiation pattern is much more flattened, so it's putting a lot more signal out in a smaller vertical chunk around the antenna. 116 00:13:03,580 --> 00:13:08,420 As you increase gain, you get more signal, but in a more focused direction. 117 00:13:08,420 --> 00:13:12,460 You don't get something for free, so that's what it basically is. 118 00:13:12,460 --> 00:13:24,940 Kind of like, take a light bulb, light it up, it kind of lights up the room, put a reflector behind it, and it lights up a big spot, but the 119 00:13:29,190 --> 00:13:31,390 Thank you, village neighbors! 120 00:13:31,390 --> 00:13:32,670 What village is this from? 121 00:13:34,830 --> 00:13:39,670 Thank you, adversary village, for your speaker! 122 00:13:43,650 --> 00:13:45,070 All right. 123 00:13:50,540 --> 00:13:53,780 Okay, let me finish this slide and see if this comes on. 124 00:13:53,780 --> 00:13:58,520 So, here we have a radiation chart of a directional antenna. 125 00:13:58,980 --> 00:14:01,820 It shows the... oh, hot damn. 126 00:14:11,760 --> 00:14:13,520 Okay, that's much better. 127 00:14:14,900 --> 00:14:17,040 Okay, can everyone hear me still? 128 00:14:17,040 --> 00:14:17,900 Excellent. 129 00:14:18,000 --> 00:14:20,200 Can those who did not hear me now hear me? 130 00:14:20,200 --> 00:14:21,760 Okay, you want to start over? 131 00:14:21,940 --> 00:14:23,220 No, we're not starting. 132 00:14:23,600 --> 00:14:42,760 All right, so we have the polar radiation chart shows the radiation pattern of the antenna in the E and H fields, or the kind of the vertical and horizontal components of this antenna's radiation. 133 00:14:45,580 --> 00:14:48,470 You can see it's got sort of this big kind of... 134 00:14:49,920 --> 00:14:52,140 getting most of my house... there we go! 135 00:14:52,340 --> 00:14:53,370 So, you've got this big little... 136 00:14:54,620 --> 00:14:56,200 big little... what am I talking about? 137 00:14:56,200 --> 00:14:59,900 So, a big section of the radiation pattern is this way. 138 00:14:59,900 --> 00:15:02,320 This is where the signal is the strongest. 139 00:15:02,780 --> 00:15:04,700 And then you have these weird little things. 140 00:15:04,700 --> 00:15:11,220 These are called side lobes, and that's just the thing that happens with directional antennas sometimes. 141 00:15:11,220 --> 00:15:13,720 You get some weird little stuff off the back. 142 00:15:13,720 --> 00:15:17,940 You also don't have a perfect radiation in one direction. 143 00:15:18,060 --> 00:15:22,640 You can see there's still a little bit of signal kind of leaking out the back. 144 00:15:22,800 --> 00:15:24,640 It just happens. 145 00:15:25,740 --> 00:15:28,700 There are lots of different types of antennas. 146 00:15:28,720 --> 00:15:35,280 The dish antenna, where you've got the reflector and the actual receive portion is here. 147 00:15:35,820 --> 00:15:43,350 This is a kind of double double discone type. 148 00:15:44,970 --> 00:15:47,610 Slotted waveguide. 149 00:15:48,210 --> 00:15:49,270 This is a... 150 00:15:51,430 --> 00:15:53,230 Okay, brain fart. 151 00:15:53,310 --> 00:15:56,790 Logarithmic antenna or log periodic. 152 00:15:56,790 --> 00:16:01,570 It basically is good for a whole lot of frequencies. 153 00:16:01,570 --> 00:16:05,550 It's a very wideband antenna, and it's a little bit directional. 154 00:16:08,870 --> 00:16:17,690 Cell phone sector antennas, bi-quad antennas with reflectors. 155 00:16:17,910 --> 00:16:19,450 Yeah, all kinds of stuff. 156 00:16:19,470 --> 00:16:26,090 And then we want to get the signal from the antenna to your radio, and so we need some sort of feed line. 157 00:16:26,210 --> 00:16:29,850 So the common type that you'll see is coaxial cable. 158 00:16:29,930 --> 00:16:35,390 It's got an outer jacket, a shield, a dielectric, and a center conductor. 159 00:16:35,390 --> 00:16:41,990 Usually what happens is the signal that you're feeding goes along the center conductor, and the shield, well, shields it. 160 00:16:43,530 --> 00:16:46,410 And then we also have a stuff called twin lead. 161 00:16:46,410 --> 00:16:49,370 There's something similar that's called a ladder line. 162 00:16:51,090 --> 00:16:53,950 And now let's talk about velocity factors. 163 00:16:53,950 --> 00:16:55,910 So I talked about the speed of light earlier. 164 00:16:56,250 --> 00:17:01,650 The speed of light through materials is not always the speed of light in a vacuum. 165 00:17:01,870 --> 00:17:09,370 So when you look at coax cable, that can be 66% speed of light or 80% speed of light, depending on the construction of the cable. 166 00:17:09,750 --> 00:17:18,990 If you're doing anything where the wavelengths and cable length need to match up in some way, you need to keep that in mind. 167 00:17:20,290 --> 00:17:30,210 Twin lead, I think, has a much higher... the velocity factor is, I don't know if you would say higher or lower, it's closer to the speed of light. 168 00:17:31,150 --> 00:17:34,290 And yeah, of course, physics, yay. 169 00:17:35,110 --> 00:17:37,490 Why do we have these different types of feed lines? 170 00:17:38,350 --> 00:17:43,310 There's a thing, basically you have balanced versus unbalanced signals. 171 00:17:43,970 --> 00:17:46,650 And, nope, thought I had something else there. 172 00:17:46,790 --> 00:17:55,430 Think of it as, if you're familiar with HDMI, HDMI is a balanced differential signal. 173 00:17:55,750 --> 00:18:03,630 If you have old school composite video, that is an unbalanced signal, single-ended. 174 00:18:05,610 --> 00:18:13,010 Unbalanced signals, or unbalanced, I'm sorry, feed lines, you have a different return path to ground. 175 00:18:13,010 --> 00:18:17,170 So your signal goes up the center conductor, your ground return path is on the outer conductor. 176 00:18:17,750 --> 00:18:29,630 If you have mismatch issues when you're transmitting a lot of power, you can actually get some signal coming back on that shield, that's called common mode current. 177 00:18:30,150 --> 00:18:32,970 That's bad, because then you get RF where you don't want to. 178 00:18:32,970 --> 00:18:35,630 There are things you can do that, you put a choke on it, it's happy. 179 00:18:36,110 --> 00:18:38,010 Because it's, you know, it's like that. 180 00:18:38,350 --> 00:18:47,030 If you want to know more about the common mode current and common mode chokes and things like that, Ham Radio Village, they can tell you all about those fun things. 181 00:18:48,350 --> 00:19:10,650 And yeah, if anybody remembers what those things are on the picture there that are old like me, that's from an old analog television with a sort of a dipole antenna that uses a balanced feed line and then goes to what's called a ballon, which is balanced to unbalanced, 182 00:19:10,650 --> 00:19:13,530 or I guess they call it a balancing unit now, I don't know. 183 00:19:13,610 --> 00:19:18,050 But that just converts one type to the other using some transformers. 184 00:19:21,300 --> 00:19:31,960 Other fun things in RF that are necessary, let's say you have a chunk of spectrum and you only want to see a little bit of it, you can use a filter. 185 00:19:32,340 --> 00:19:36,460 The most common ones are the ones on the top there. 186 00:19:37,100 --> 00:19:45,080 So a low pass cuts off everything above a certain frequency, high pass cuts off everything below a certain frequency. 187 00:19:45,720 --> 00:19:51,020 A band pass just gives you a chunk of frequency and a notch filter cuts out a portion of a frequency. 188 00:19:53,060 --> 00:19:56,600 These can be constructed in all kinds of interesting ways. 189 00:19:58,160 --> 00:20:03,640 We've got just standard LC filters, which are inductors and capacitors. 190 00:20:03,760 --> 00:20:10,120 A capacitor is something that will block low frequencies and pass high frequencies. 191 00:20:11,460 --> 00:20:31,480 An inductor blocks high frequencies and passes low frequencies, so in order to make a low pass, high pass, or band pass, you just have an arrangement of different value inductors and capacitors, either in series or to ground, and that will do the job of passing some portion of the signal and shunting the rest of it to ground, 192 00:20:31,480 --> 00:20:33,820 so you get only what you want. 193 00:20:35,320 --> 00:20:42,820 Crystal filters, just like a little crystal oscillator type thing, gets a little piece of that vibrates at a particular frequency. 194 00:20:42,820 --> 00:20:46,760 You can use that as a filter because it doesn't resonate at other frequencies. 195 00:20:47,480 --> 00:20:49,580 Saw filters are kind of cool. 196 00:20:49,840 --> 00:21:01,380 They convert the RF signal to an actual acoustic wave that goes across a device that is only resonant at that frequency and then converts it back to an electrical signal. 197 00:21:04,480 --> 00:21:14,440 Cavity filters are just resonant cans, basically, that are tuned to resonate at a precise frequency, so anything that is not resonant kind of gets blocked. 198 00:21:14,980 --> 00:21:23,020 And then distributed element filters, which are evil magic that should not exist, and I'm going to show you why. 199 00:21:24,680 --> 00:21:25,640 Seriously? 200 00:21:26,600 --> 00:21:37,400 Like, okay, so we get this stub and we shunt it to ground and it does one thing, or if we don't shunt it to ground it does another thing, but it's just like a little trace on the circuit board. 201 00:21:38,000 --> 00:21:44,700 And then if we cut a hole in it, it does one thing, or if we cut a slot in it, it does another. 202 00:21:44,960 --> 00:21:47,900 Like, there is no god. 203 00:21:48,500 --> 00:21:50,740 And what in the shit are these? 204 00:21:50,740 --> 00:21:51,560 Really? 205 00:21:51,660 --> 00:21:53,140 This is madness. 206 00:21:54,180 --> 00:21:55,320 I hate these. 207 00:21:57,990 --> 00:22:06,190 Okay, let's talk about software-defined radio a little bit and sort of what it looks like. 208 00:22:06,190 --> 00:22:17,290 So an SDR is effectively an antenna that goes into an analog-to-digital converter that goes into some sort of signal processing device. 209 00:22:19,250 --> 00:22:23,650 In order to reject signals that we don't want, we'll add a filter. 210 00:22:23,790 --> 00:22:32,950 For example, there are some HF SDRs that are what are called direct sampling, where the antenna literally is just run into the ADD converter. 211 00:22:33,430 --> 00:22:45,010 And we don't want to get signals that are too high frequency, because we end up with what's called aliasing, which I will describe in a little bit. 212 00:22:45,350 --> 00:22:55,850 So we have a low-pass filter set up so that only the frequencies, you know, up to like 30 megahertz go in and everything else gets cut off. 213 00:22:57,630 --> 00:23:02,750 We're going to add a little amplifier to increase the strength of the signals received. 214 00:23:02,750 --> 00:23:09,870 This is a low noise amplifier, so-called, because it is an amplifier that does not introduce much noise. 215 00:23:10,030 --> 00:23:19,870 Whenever you amplify a radio signal, you aren't just amplifying this like one little bit of whatever you want, you're amplifying everything. 216 00:23:19,870 --> 00:23:31,070 And that includes all of the background noise and the some of the characteristics of these devices is that they introduce additional noise, which can actually overwhelm your signal. 217 00:23:31,070 --> 00:23:38,890 So you want a specifically designed amplifier that does not introduce that extra noise, so that you actually see what you want to see. 218 00:23:40,650 --> 00:23:50,610 Then we're going to accidentally flip where our filter and LNA are, and we're going to add a mixer and an oscillator. 219 00:23:50,710 --> 00:24:08,310 A mixer is a neat device that you put in two RF signals, and you end up with the original signal, the oscillator's input signal, the sum of the two signals, and the difference between the two signals. 220 00:24:08,430 --> 00:24:27,930 So if you have a, let's say, a 200 megahertz signal that's coming in, you have a 100 megahertz local oscillator, you mix those together, you end up with the output of the 200 megahertz input signal, the 100 megahertz local oscillator, and then you end up with 100... 221 00:24:27,930 --> 00:24:30,550 okay, that's a bad example because the math doesn't work out. 222 00:24:31,070 --> 00:24:32,130 Let's pretend this is... 223 00:24:32,670 --> 00:24:34,070 okay, I'm just going to keep going. 224 00:24:34,070 --> 00:24:40,790 A 100 megahertz difference between the two signals, and a 300 megahertz sum of the two signals. 225 00:24:41,050 --> 00:24:49,930 So this is really handy if you have a device that is only set up for a certain chunk of frequency range. 226 00:24:50,150 --> 00:25:00,890 For example, an analog to digital converter, which they can only receive from DC to 30 megahertz, but you want to shove a 600 megahertz signal into it. 227 00:25:00,890 --> 00:25:16,170 You mix that with a... hang on... a 580 megahertz signal, and you end up with the output of 20 megahertz, which is within the 30 megahertz bandwidth of your analog to digital converter. 228 00:25:18,570 --> 00:25:21,310 Does that... who have I lost so far? 229 00:25:22,730 --> 00:25:24,550 Nope, okay, okay. 230 00:25:25,610 --> 00:25:28,770 Keep that in mind, we'll hit questions at the end. 231 00:25:30,150 --> 00:25:31,890 Hang on, I need to know what time it is. 232 00:25:32,290 --> 00:25:34,230 Okay, I got 20 minutes. 233 00:25:35,830 --> 00:25:53,890 Cool, so that's how you end up tuning your radio, is you use that local oscillator to feed in to the mixer to get the output that you want that will actually match up with your analog to digital converter. 234 00:25:57,950 --> 00:26:17,830 Let's see, okay, so something that you need to do when doing the analog to digital conversion is you have to sample your signal at least twice the frequency of what the signal is, called the Nyquist rate. 235 00:26:18,770 --> 00:26:22,610 If you don't, you end up with something called aliasing. 236 00:26:22,790 --> 00:26:27,730 I have a slide for that in a couple secs, and it's bad. 237 00:26:27,730 --> 00:26:30,430 You end up with ghost signals that aren't there. 238 00:26:30,890 --> 00:26:47,810 So if you want to sample a really wide bandwidth signal, you either need one really fast analog to digital converter that is twice the speed, or twice the sample rate of the bandwidth of the signal you want to capture. 239 00:26:47,810 --> 00:26:57,610 So the signal you want to capture is 60 megahertz wide, you need an ADC that samples 120 million times per second, or 120 megahertz. 240 00:26:57,610 --> 00:26:59,470 Those are really expensive. 241 00:26:59,650 --> 00:27:16,470 What's a lot cheaper is getting two ADCs that are running at the sample rate, or at the at the rate of the bandwidth of the signal you want to grab. 242 00:27:16,470 --> 00:27:22,870 And then you have them 90 degrees out of phase with each other. 243 00:27:22,870 --> 00:27:26,770 This is called in-phase and quadrature sampling, or IQ sampling. 244 00:27:26,890 --> 00:27:31,290 If you have one of those little RTL-SDR dongles, that's what they do. 245 00:27:31,290 --> 00:27:46,070 They have two ADCs in them that are running at 2.2 mega samples per second, and together with one of them running 90 degrees out of phase, you can capture 2.2 megahertz of signal. 246 00:27:46,170 --> 00:27:54,270 Whereas if it was just a single ADC sampling directly, you would need to run it at 4.4 mega samples per second. 247 00:27:58,370 --> 00:28:06,430 The cool thing about this is you don't see this in old analog radios because it's kind of a pain in the butt to deal with there. 248 00:28:06,630 --> 00:28:12,910 But once you digitize this, it's all just math, and you can reconstruct the signal however you want. 249 00:28:15,350 --> 00:28:23,390 So here's the kind of what happens when you're oversampling, or I'm sorry, not oversampling, aliasing. 250 00:28:23,390 --> 00:28:31,270 So the Nyquist rate, like I said, is going to be... you have to sample at twice the sample rate of the signal that you're capturing. 251 00:28:33,030 --> 00:28:45,990 On this graph, we can see we've got... okay, so there's this signal here in the kind of light blue or teal, and then we have a much lower sample rate than what that signal is. 252 00:28:46,250 --> 00:28:55,070 And when you sample at those points, it looks like you have this yellow signal instead, which is not actually there. 253 00:28:55,530 --> 00:29:09,710 So what you need to do again is capture it at twice the cycle rate of the signal so that you can actually see what it's doing, the high points and low points. 254 00:29:11,470 --> 00:29:23,050 Then when you're digitizing it, you have a sample depth, or the number of bits that you'd use to represent each sample. 255 00:29:23,150 --> 00:29:32,030 As your signal goes up and down, you can say, okay, this is a one bit sample. 256 00:29:33,890 --> 00:29:36,630 No, I guess it would be two bits, or one bit signed. 257 00:29:37,270 --> 00:29:44,430 So the sample is either on, or plus one, or negative one. 258 00:29:44,590 --> 00:29:48,750 But you don't have a lot of fidelity in between to really see what's going on. 259 00:29:48,750 --> 00:29:53,450 And if you have a weaker signal in there, it's just going to get lost completely. 260 00:29:54,250 --> 00:30:03,330 So as you increase the number of bits, you can more accurately reconstruct this. 261 00:30:04,270 --> 00:30:10,110 And you'll be able to capture any other weaker signals that are mixed in there as well. 262 00:30:10,110 --> 00:30:12,170 It gives you what's called dynamic range. 263 00:30:13,810 --> 00:30:16,310 So more sample depth, better. 264 00:30:21,210 --> 00:30:27,550 And okay, so you've got all these wiggling electrons, how do we make them make sense of something? 265 00:30:27,730 --> 00:30:29,270 This is called modulation. 266 00:30:29,510 --> 00:30:33,030 And that is how you encode data in a carrier signal. 267 00:30:34,430 --> 00:30:38,090 So we have... let me get the other charts on. 268 00:30:38,090 --> 00:30:39,650 There we go. 269 00:30:40,010 --> 00:30:43,890 All right. 270 00:30:44,450 --> 00:30:48,130 So here, you can see here's our signal. 271 00:30:48,130 --> 00:30:56,230 Think of this as just like an audio signal, where you're trying to get that encoded into the radio, like somebody's voice. 272 00:30:56,840 --> 00:31:09,290 We have AM, amplitude modulation, where you adjust the strength of the signal, or how much power you're putting out, based on the input signal. 273 00:31:09,290 --> 00:31:15,290 So if somebody is whispering, then it's going to wiggle very, very little. 274 00:31:15,290 --> 00:31:19,910 If somebody's shouting, it's going to wiggle a whole lot in terms of the amount of power output. 275 00:31:20,570 --> 00:31:30,310 And the frequency at which the amplitude changes is going to be related to the frequency of the sound that you put into it. 276 00:31:31,130 --> 00:31:42,070 Then FM is a frequency modulation, where the output power stays the same, but the frequency of the carrier shifts up or down. 277 00:31:42,390 --> 00:31:48,810 The amount that it shifts up or down is related to the loudness of your sound that you input. 278 00:31:48,830 --> 00:31:55,090 The rate at which it shifts up and down is related to the frequency of the sound that you put into it. 279 00:31:56,830 --> 00:32:11,270 We have just kind of an on-off keying sort of thing here, which is common in key fobs, remote controls, where your signal is literally either there or not. 280 00:32:12,010 --> 00:32:24,070 Or you can have some frequency shift keying, where this frequency encodes a 1, this frequency encodes a 0, goes on up in there. 281 00:32:25,510 --> 00:32:50,890 Something cool with the in-phase and quadrature stuff that I mentioned before, the in-phase and quadrature elements are real and imaginary number components of the signal, and you can plot them as the x and y coordinates on a graph, and you can end up with a sort of constellation of points on this graph, 282 00:32:50,890 --> 00:32:56,890 and each of those points can be encoded with a different bitmask. 283 00:32:56,890 --> 00:33:05,470 So let's say this is quadrature amplitude modulation 16. 284 00:33:05,630 --> 00:33:26,970 So we have 16 points, and yeah, the encoding of each of these is based on a different inq xy coordinate, and it just kind of lets you pack a lot more bits into your signal that you wouldn't have been able to before. 285 00:33:26,970 --> 00:33:35,430 The downside is you need a much quieter channel in order to get this to a point where you can decode it. 286 00:33:35,590 --> 00:33:37,650 Otherwise it all just looks like noise. 287 00:33:39,930 --> 00:34:03,130 There's also another thing called polar modulation, where instead of just the xy coordinates, you encode it as sort of a radius or amplitude value and theta or phase angle, and so you can then also get the same sort of thing by saying, okay, I'm going to go with, 288 00:34:03,130 --> 00:34:09,810 you know, 270 degrees and whatever radius pops you up here. 289 00:34:10,310 --> 00:34:15,690 And it's just similar output, but just a different way of mathing it. 290 00:34:18,200 --> 00:34:43,100 As far as how much data we can send, like with that quadrature amplitude modulation thing where we need a less noisy channel, so Claude Shannon and someone partly, first name I forget because I'm a terrible person, came up with this kind of channel capacity theorem within the field of information theory. 291 00:34:43,740 --> 00:34:44,720 And basically you have 292 00:34:48,160 --> 00:35:01,620 a constant times the width of the band that you're transmitting in, so say a 10 megahertz wide chunk of spectrum times 10 log 10 of the signal to noise ratio in decibels. 293 00:35:01,860 --> 00:35:08,520 And the decibels cancel out because that's what math does. 294 00:35:08,520 --> 00:35:21,740 So let's say we have a 20 megahertz bandwidth signal, the signal strength is received at negative dBm, the noise is at negative 90 dBm. 295 00:35:23,420 --> 00:35:30,620 If I did the math right, that means we get a maximum theoretical capacity of that channel of 86 megabits per second. 296 00:35:31,380 --> 00:35:43,100 If we improve the signal noise ratio, we can get it to let's say negative 60 dB signal, negative 110 dB noise, 112 megabits per second. 297 00:35:43,200 --> 00:35:50,840 If we double the of that, we get 225 megabits per second. 298 00:35:51,040 --> 00:35:59,860 So you'd see with this, changes in the signal to noise ratio have a logarithmic effect on your bandwidth. 299 00:35:59,880 --> 00:36:06,240 And then changes in, I'm sorry, bandwidth is an overloaded term. 300 00:36:06,240 --> 00:36:09,620 So let me restart that. 301 00:36:10,880 --> 00:36:17,680 Changes in your signal noise ratio have a logarithmic effect on your channel data capacity. 302 00:36:18,100 --> 00:36:26,280 Changes in the bandwidth in use have a linear effect on your channel data capacity. 303 00:36:26,560 --> 00:36:33,200 So the more bandwidth you have, that has an absolute linear progression on how much data you can pack in there. 304 00:36:33,200 --> 00:36:37,840 Changing the signal noise gives you a logarithmic change. 305 00:36:37,840 --> 00:36:46,340 So a little bit of signal noise ratio improvement doesn't have too much effect, but the more you can do that, the more and more and more that improves. 306 00:36:47,660 --> 00:36:59,840 MIMO, multiple in, multiple out, also increases this, but there's a relationship that I'm not quite sure about when they are in like the same frequency band. 307 00:36:59,840 --> 00:37:02,060 So that you would have to look up. 308 00:37:02,060 --> 00:37:02,720 Sorry. 309 00:37:02,720 --> 00:37:03,200 Okay . 310 00:37:04,900 --> 00:37:18,220 So that is me spewing a whole bunch of stuff out that hopefully kind of helped a little bit with understanding what the hell all this radio stuff is. 311 00:37:19,520 --> 00:37:21,480 There are lots of talks here. 312 00:37:21,480 --> 00:37:24,480 There, oh my god, that blue did not turn out well. 313 00:37:24,780 --> 00:37:25,720 I'm sorry. 314 00:37:25,840 --> 00:37:32,700 Let me see if I can, 315 00:37:36,140 --> 00:37:39,640 oh , that, nope, that did not work at all. 316 00:37:39,640 --> 00:37:40,280 All right. 317 00:37:40,360 --> 00:37:46,840 Well, I'll leave this up on my laptop for a second. 318 00:37:46,840 --> 00:37:50,860 If you want to come up after take a screenshot of my laptop, that's fine. 319 00:37:51,320 --> 00:37:54,020 Basically, we've got the RF village here. 320 00:37:54,020 --> 00:37:58,480 Lots of good talks about signal decoding, all kinds of cool stuff like that. 321 00:37:58,800 --> 00:38:09,460 There's the ham radio village, where you can go get your ham radio license that will allow you to transmit on a lot of these frequencies and do more playing and experimenting. 322 00:38:09,460 --> 00:38:11,560 They're doing testing all throughout the weekend. 323 00:38:12,000 --> 00:38:17,860 They've also got a bunch of talks over there, kind of on more of the amateur radio side of things. 324 00:38:19,040 --> 00:38:29,940 There are, yeah , some other videos and documents there that you can't see because there's no contrast. 325 00:38:30,620 --> 00:38:31,500 Yeah. 326 00:38:32,660 --> 00:38:35,980 And then I'm on Mastodon and so forth. 327 00:38:36,280 --> 00:38:38,140 So, all right. 328 00:38:38,820 --> 00:38:43,420 Now, for all the people that I confused, what questions do we have? 329 00:38:47,880 --> 00:38:53,260 I've either confused you so much, you don't know what to ask, or somehow I managed to explain everything. 330 00:38:53,520 --> 00:38:54,740 And I don't think it's the latter. 331 00:38:54,740 --> 00:38:55,400 Yes. 332 00:38:57,240 --> 00:38:58,640 I'm sorry? 333 00:38:59,760 --> 00:39:02,120 Oh, the right-hand rule. 334 00:39:02,220 --> 00:39:19,840 So, when you have an electromagnetic field on a conductor, you have the right-hand rule, which is, what is it, the electron flow, the magnetic field goes this way. 335 00:39:19,840 --> 00:39:22,820 And yeah, there is a right-hand rule. 336 00:39:22,820 --> 00:39:28,100 I don't remember exactly what it is because it's been, I don't know how many years since I took physics. 337 00:39:33,440 --> 00:39:35,720 Anyone else, please, questions? 338 00:39:37,160 --> 00:39:37,900 No? 339 00:39:38,080 --> 00:39:39,320 Oh, yes. 340 00:39:41,990 --> 00:39:43,570 Oh, I'm sorry. 341 00:39:43,570 --> 00:39:44,370 I can't. 342 00:39:53,690 --> 00:39:54,670 Oh, yes. 343 00:39:54,670 --> 00:39:55,910 Bit depth. 344 00:39:56,350 --> 00:40:11,630 So, um, let's take CD audio is a 44 kilohertz 16-bit kind of file or rate. 345 00:40:11,630 --> 00:40:37,050 Those 16 bits mean that you have for every sample point, you have 65,536 potential values to represent where the wave is at that point in that signal. 346 00:40:37,710 --> 00:40:50,110 As you increase those number of bits, you end up with, let's say you go to a 24-bit sample, you have 16.7 million ways to represent the signal at that point. 347 00:40:51,030 --> 00:40:59,210 As you end up with a, let's say you have a very, in terms of CD audio again, let's say you have 348 00:41:02,310 --> 00:41:04,270 Tchaikovsky blasting a cannon. 349 00:41:04,890 --> 00:41:09,310 And then there's also somebody just kind of snapping their fingers in the side. 350 00:41:09,970 --> 00:41:16,950 As you increase that bit depth, you're able to pick up more subtle variations in that signal at every point. 351 00:41:16,990 --> 00:41:25,930 And so you're able to basically pull out much quieter things when there is a very loud source present. 352 00:41:25,930 --> 00:41:27,530 Does that make sense? 353 00:41:30,430 --> 00:41:31,670 Yes. 354 00:41:33,410 --> 00:41:34,430 Ah, aliasing. 355 00:41:34,430 --> 00:41:35,250 Yes. 356 00:41:35,670 --> 00:41:36,250 Okay. 357 00:41:36,250 --> 00:41:37,490 Let me get back to my graph. 358 00:41:37,490 --> 00:41:38,170 Okay. 359 00:41:38,250 --> 00:41:48,590 So yeah, this teal signal is the one that we want to capture, but our sample rate is too low. 360 00:41:48,590 --> 00:41:59,690 And so as this teal signal is going along, you know, we, we capture a sample here and then a sample here and a sample here and a sample here. 361 00:41:59,890 --> 00:42:14,670 And when we reconstruct that, assuming it is some form of sine wave, we end up with this, what looks like a much lower frequency signal. 362 00:42:14,790 --> 00:42:21,390 And that is the kind of aliased signal of this higher frequency signal that's there. 363 00:42:21,390 --> 00:42:24,670 So this yellow line doesn't exist. 364 00:42:24,670 --> 00:42:31,990 It's an artifact of us having sampled this original signal at too low a rate. 365 00:42:32,030 --> 00:42:52,350 So if we to capture it properly, you know, if we captured it here and here and here and here and here and here, then we would be able to reconstruct this signal properly. 366 00:42:56,520 --> 00:42:58,260 Anyone else? 367 00:43:00,420 --> 00:43:01,100 Nope. 368 00:43:01,100 --> 00:43:01,900 Okay. 369 00:43:01,900 --> 00:43:03,160 All right. 370 00:43:03,160 --> 00:43:14,260 I'm gonna apparently lose my mouse again, and I will sit here for a minute with my laptop on that where to find more things slide. 371 00:43:15,740 --> 00:43:18,080 You can come and take pictures of. 372 00:43:18,080 --> 00:43:20,700 So thank you everyone.