All right. Thanks. Thanks for bearing with me. And thanks for all turning up. Everyone enjoying DEF CON so far? Better now. All right. Well, my name is Balint Siva. I'm the Director of Vulnerability Research at Bastille. And I like SDR. SDR is pretty cool. I thought today I'd share some more tips and tricks with you. I've got a couple of different projects that I've been working on for some of the many years. And I thought I might just take you through some flow graphs, how to build them up. We'll leave that one until later. We'll build up to that one. And, of course, don't forget that here's the first tip. You might appreciate this for this one. If you, oh, what the hell did I just do? X-Quartz with multi-monitor is crazy. There we go. So, but tip zero, if you're using X-Quartz on OS X, who uses a Mac, by the way? Yeah? Linux? Windows? Windows? Yeah? If you're on OS X, OS X is really good. You can use Homebrew and Mac ports to set up. I'm running an older version, but there's this button here. I think it's Control-B, right? Control-B. Control-B. Control-B. Control-B. Control-B. Control-B. Control-B. Control-B. Control-B. Control-B. Control-B. Control-B. Control-B. Control-B. Control-B. Control-B. Control-B. And some other stuff, but I was just updating the InMarsat stuff so you might like that. Again, all of this is pretty experimental and it's just mainly so that people can get an appreciation of what you can do with Rayo. You might remember this, I've spoken about this a couple of times. This was a system that I put together using Gunu Radio back in Sydney, it would track all the planes. Everyone, who's tracked planes with ADS-B before? Yeah, it's quite a bit of fun. And the software that sort of drives this aviation mapper, it's just been collecting dust so I'm going to open source it when I get home. I've added support for all the different decoders so you can do cool stuff like this. But what I wanted to demonstrate here is that apart from the trails of the planes, you have these dots. And so these dots actually represent ACARS messages. Who's read ACARS messages before? Aircraft Communication Reporting System. So a lot of these short text message like messages, transmissions are sent to and from aircraft. They contain performance reports, human readable text messages to the cockpit, information that carries waypoints of the planned flight routes and so on. And this is really cool because it's VHF so it propagates a long way and you can easily receive these on the ground. You can go to your airport and see all the information. You can go to your airport and see all the different messages that are going on. But there are areas around the world where you can't receive these terrestrial messages like over the ocean, transatlantic flights for example, or Transpacific. And there are two other systems that are used there. One is using HF so on the order of 10 to 20 megahertz and they send very short messages over those frequencies and they obviously propagate a long way because the wavelengths are very long and you can get quite good distribution. The other one is SATCOM and SATCOM is of course enabled by the fact that you have satellites that orbit the Earth that allow you to relay messages. So all sorts of interesting stuff you can see. So can anybody tell me what we're looking at here in terms of this diagram? What is this diagram portraying given what I've just told you? The satellite footprint. The satellite footprint. Yeah. That's exactly right. So this is the portion of the Earth that this particular satellite sees. And we're going to look at. And there's a nice document the FCC has, you can look that up there. And this is a sort of artist's rendition of InMarsat 3 geostationary satellite. InMarsat is a company that has a constellation of satellites and they offer a whole different bunch of services to different customers in different sectors. The one that we're going to look at in particular is for aviation. And they have these geostationary birds. Placed around the Earth so they have really good coverage of the entire Earth and their orbits of nearly 36,000 kilometers above the surface of the Earth. So obviously geostationary so they spin at the same rate as the Earth spins and so they're always at the same point in the sky. So the one that we're going to look at is 3e, oh I can't see it, 3f3 maybe? Anyway. What's that? 3f3. 3f3. So how does it actually work? Well in these instances this is just a dumb satellite. The satellite is a linear transponder, it essentially just receives messages sent from an Earth ground station on one frequency and then sends it back down, relays back down on another one. And anything coming back up from another frequency will get relayed back down to the ground station. So the objects of interest here are commercial airliners. If you look at them you can see on the top one of those sort of bumps is usually the SATCOM antenna and you can make phone calls and it's also used to convey these text messages and so on so that pilots can maintain communications with your home base and air traffic control and so on. There are these pretty much two large companies Aaron considered that actually roll out and deploy and manage aviation networks around the world. The ones that obviously use A-cars. They have their V-cars. They have their VHF data link set up. And they also have these internetworking agreements so it's like a different sort of large scale network that planes and operators and so on can use to transfer messages. I guess much like the internet. So the ground station to SAT link is C-band and the L-band is the link to the plane. So let's have a look at what the bent pipe transponder architecture usually looks like. You've got your L-band antenna here which operates in this frequency. This frequency is nice because you can use pretty much every SDR to receive it and this is what is sent down to planes and what the planes communicate back up to the satellite with. So we can, as it turns out, pretty easily listen to the downlink to the planes and I'll show you what sort of antenna you need to use to do that. And then on the other end, if a plane sends something up, it downlinks it back to the ground station on 3 and 6 gig. I can't remember which one is which but that's on the C-band. So if you want to use that, then you need a slightly more sophisticated setup. So we haven't got to that point yet. But essentially, if you look at the architecture here, it's basically receiving stuff, doing some processing, going in beamformer, coming back down and then the reverse process on the other end. So this is what you need to actually receive the downlink. My friend and colleague Ian Buckley has helped a lot with this and he actually found this old dish and he created this feed, custom feed. It's a left-hand, circularly polarized helical feed. So if you look at it, it's pretty much this bent wire that rotates in this particular circular polarization which is the polarization that's used on, in, often on the ground but in satellite links. And then that goes to a band pass filter. So you filter out all the other noise and then there's also an LNA there to give you a bit of a boost in the signal. And, you know, essentially you can calculate roughly where the bird is in the sky, set the dish up, have a little spectrum analyzer running, FFT, what have you, and then, you know, adjust the pointing of your dish until you get good peaks on your spectrum and then you're good to go. So, there's only one LNA out there now. So it's actually relatively easy to do. So why is this service interesting? Well, as it turns out, there are a lot of different channels on it and I should put out there that, you know, this is just one stab at it. Other people have also done different implementations and looked at different things, some really nice stuff out there. But I just want to share this with you because I've sort of attacked it from the Goody Radio side and, you know. Yeah. If you want to build on it at some point, then that would be great. But everything begins with the P channel and that's where the coordination and timing is set for the system. It's this time division multiplex packet mode signaling. And if we're listening to the information that's addressed to all the aircraft, they're contained in little packets called signaling units. And it's basically just a constant stream of these on I think there were nine P channels that are available there. There are other channels than the R channel, T channel, C channel that are used for random access signaling from the aircraft. So if you imagine kind of like cellular networks now, there's a random access channel if your phone wants to get the attention of the network. Once you actually coordinate and set up a reservation on the T channel, you have TDMA. So that's from the aircraft for data transmissions. And then you've got the circuit mode C channel, which is something that carries voice to the P channel and also user data. So once you actually receive it and synchronize to the P channel, all of the other channels are synchronized in terms of timing to the P channel. And then once you go through the layers and end up decoding more of the protocol, then you can get to the point where you can actually follow the establishment of calls and then decode that data and put it through vocoder and maybe get voice. I've not looked at that part of it, but that's not outside the realm of possibility. That's what it used to look like. I cleaned it up a little bit. And I made it even cleaner. And believe it or not, for those of you that know the in-joke, I use hierarchical blocks. So I'll go through and show you that shortly, but I'll just go through the system, the theory, and the process of breaking it down, and then I'll step through the flow graph. So this is the old version. What we did initially was just record the spectrum. We did it a while and then do offline processing. So remember, we only want to look at the P channel. And what you can see here is the P channels that are actually available coming down. I think they're on the different spot beams. But because it's a satellite link, obviously your signal-to-noise ratio isn't fantastic. But luckily, it's good enough so that you can use the simple blocks and demodulator and clock synchronization to do it. You don't need to do anything particularly fancy. At this link budget, anyway. So the first thing, obviously, is you want to select the channel that you want to listen to. There are actually a bunch of P channels, as it turns out. In this case, we're just going to decode one. And you want to basically tell your channelizer to move your baseband spectrum to that point and then filter out just that one channel. The narrower you get, the better. But as you will see, one of the common things you have to deal with with a real-world radio system is clock drift. So the oscillator that's originally being used to synthesize the signal is going to be drifting in relation to the synthesizer on your own SDR, which means that when you tune to the particular frequency you might know this is at, it might be offset. Or even if you manage to zero it down completely, it'll move back and forth. And that could be due to a whole bunch of different factors. But usually, you want to implement some sort of a scheme to keep a lock on it. And I'll show you how to do that. This is one way to do it. As it turns out, the signal is actually GMSK, Gaussian Minimum Shift King. So it's essentially two-level frequency shift king with a pulse shape filter on it. And I'll show you what this looks like in board line. Who's used board line before, by the way? Yeah, a couple of you. I'll show you. It's a really cool tool. It's one of the most invaluable tools for doing offline and online signal analysis. I can demonstrate that to you. But one nice property about GMSKs or FSKs is that if you square the signal, like you literally take a complex sample and you square it, and then you take the FFT, you get these two peaks coming out. And these peaks, as it turns out, are separated in terms of hertz by what your board rate is. So immediately from this, you might guess that this is how fast are the symbols coming down, if it's a separation between these two. Okay, I'll come back to it. But the point is, as this moves around, you want to be tuned to exactly the midpoint here. And so this green line is showing where the tracker is locked onto that line. That was the first primitive stab that had a problem, and then I'll show you why. So the second thing is you want to identify how quickly the symbols are coming out. So if you're looking down, instead of looking at it that way, what you can do is you can take the sample and then multiply it by another stream, which is a delayed version. So basically you can just delay by one sample. So you basically multiply your current sample by the previous sample. And then you take the FFT of that. And then your first big peak is your symbol rate. That's telling you what the periodic component to your symbol is. And this works with a whole bunch of different modulations. Primitive ones. This is here. So what's our board rate? 600 bits per second. Symbols per second. Yeah, that's it. So it's just a really convenient way. I was coming at this as I usually try to do from sort of what's called the blind signal analysis perspective. So you don't actually know what the properties of your signal are, and you want to use some DSP tricks like this to figure out what's going on. So the next step then is you've got your raw symbols, and I've oversampled here. But you want to turn those, those samples into discrete symbols that you can then turn into a bit. So one neat visualization you can do is with samples, instead of drawing lines, you can draw them as dots. And so this is where I haven't classified them as bits yet. We're purely just looking at the samples coming in on our channel. And you can see that they're sort of scattered all throughout between one and negative one. So that means, you know, we've got them in the right range. We're essentially doing FMD modules and then we're going to do a bit of simulation on this, and then adjusting the deviation appropriately, or the gain on that so it falls between these normalized values. But we want to turn them into a symbol stream, and a really easy way to do that is just to slice around the middle. But to slice around the middle, we want to have clock recovery going on so that we have a block that will lock on and say, oh, I'm going to sample here, then I'm going to go forward a couple of samples, sample here, and sample, and keep sampling like that. And make sure that we get really good separation between our symbol streams so that we can turn them into bits. So I think I may have oversampled by four here or something. So there are four times as many dots here. So you're seeing the intermediary dots between each symbol. And here it's tracking it and just picking out the one symbol that represents a bit. And you can see that it's actually doing that really well because there's this big gap between the bottom line and the top line. So then we can just simply say, right, draw a line through the middle across zero. Anything above that's going to be a one. Anything below that's going to be a zero. And then that's a really basic way of doing it. There are far more sophisticated ways of doing it if you know things about your modulation or you've got a really low signal and so on. But this is just the simple approach. And then the next step is you want to actually visualize your bits to see if there's some sort of structure to them, if there's some sort of a pattern. And then you can use that to further deconstruct and deframe your packets. So there's a cool raster plot. I'll show you how to do that. Actually in this flow graph I have it going out a UDP socket and then I've just got a little flow graph that's listening on that and then plotting all the data that comes out. And then usually when there is some structure like here, if you're looking for the scan line length or your fixed frame length so that they all pile up on top of one or another and then you're synchronized, then you'll get these as straight lines. If you're offset then they're going to be diagonal and you just need to sort of adjust your length until it looks good. And once you do that you can see here that the vast majority of this packet or each scan line looks like it's random, right? It just looks like a mixture of ones and zeros, no structure to it. However, in here there is this very repetitive series of bits which is why you get these vertical lines. So each one of these scan lines has the same series of bits here and then there's some sort of a counter or some marker happening here as well. So that would be indicative of a synchronization process in the field to begin decoding that packet. So it appears random and then when you often deal with links and satellite links in this case, there are often three measures that are employed to add more redundancy and allow you to decode your signal in your packets even in the presence of errors that might have corrupted your data. So the first thing is interleaving and this will protect against burst errors. I'll show you why. Forward error correction, so that adds a little bit more data so that you can recover the data if bits are corrupted or flipped. And scrambling, and that's important because if you have a long sequence of the same bits, a long sequence of ones or zeros, there aren't changes to which the receiver can train its clock recovery. So you want to have as many flipped bits as possible so that there are these back here, these excursions to either end as often as possible. If you don't do it as often as possible, then you may lose synchronization. And there are scrambling codes, fixed scrambling codes that use a polynomial in a shift register and then you can actually deterministically figure out what that is. So, you can go that far. I found a couple of hints, which is what that's about. But the hints are that a frame payload consists of multiple fixed signaling units. And for the P-channel, it usually depends on the data rate, but here it's six SUs and each of them are 96 bits. So, for transmission, you basically construct the entire group, you scramble it, use a half-rate convolutional encoder, then you put it through interleaver. So what does that actually look like? You have your six 96-bit signaling units here, you have a scramble, so you generate your scrambling sequence, you take all the bits and you X-all them together. Once you've got that, you put them through a convolutional encoder, I'll show what it looks like, and then you interleave them and create your payload now. And that fixed set of lines that we saw before, that's your unique word and the frame header. And that's what's used to demarcate then the payload. And these just run back-to-back the entire time on each one of those channels. So, what is an interleaver, or how does the D interleaver actually work? In this case, you can consider an interleaver as a memory cell, and you write into the interleaver in one particular order and you read out of it in another order. And what that does is it distributes temporally the bits. So, we've got N rows and N columns, and in terms of writing in, we're going to write row-wise, like this. So we write across each row, and once the interleaver is full, then we read out column-wise. So instead of going the same way, we go 1, 5, 9, 13, and so on like this, until we've read out each of the columns. And what we've effectively done there is instead of having 1 and 2 next to one another, we've got 1 and 5, so we've redistributed them temporarily. Because, remember we've also got forward error correction on this, if we affect some of these bits, then if we were to read it out, if we weren't interleaving and we just had them serially in order, if we had a burst error that affected some of these bits, it might affect too many in that one small group for the error corrector to actually correct fully, because there's only so far that an error corrector can go, given the amount of additional bits that you're putting in there. However, if you put them, if you distribute these bits temporarily, so they're not in sequence anymore, but they're temporarily distributed like that, then if we end up affecting these three bits 1, 5, 9, then we can still rely on the error correcting data that might be in this smaller group around 1 to fix 1, and then also fix 5, and then also fix 9. So, it's just a really effective way of doing it. It's pretty much used in every single modern communication system, even on CDs, for example, because, you know, you can take a drill, right, and drill a hole in your CD and it will still play back. It's because they use a hell of a lot of this and other error correcting codes. And then the next step is a convolutional encoder. This is used in all... I mean, this has been superseded now by much more modern codes like turbo coding that's used in LTE, but this was used for a very long time and still is used. A lot of the NASA space probes used to use this and so on. But what you do is you feed your data bits into a buffer, and then you basically take these taps off and produce extra bits for the incoming bits. And then that adds the redundancy. So what happens is, depending on the polynomial that you've used, how you've configured this, then you can generate this trellis, it's called. I won't go into details because it's a bit outside the scope here, but you can use a decoder then. And as you fill in your received symbols, the decoder will try and find the most likely path to traverse through the trellis that matched the symbols that you actually received. So although you might receive some symbols in error, that won't exactly match what's in these elements here, it will still find the most likely path because there are going to be paths that are more likely than others, and then it'll use that as the data that you actually received. And in that way you can then correct or recover the bits that might have been corrupted. It's a really neat system. One problem with this approach is that if you implement it on a PC, because processes, although there is parallelism, you've only got a certain number of cores, this actually is highly parallelizable. So on FPGAs you can pretty much do the entire thing in one step because you can have like 256 or really more branches and compute it really quickly, but on a serial machine you actually have to traverse all of them all, and so that can be quite computationally expensive for very large values of k, which defines how long your... your constraint length, how long the trellis is. But what's nice is GNU Radio has blocks to do all this kind of stuff already, and in grfeq, which is a submodule in the main tree, there's this nice extended decoder object, and then you can configure that with this definition, and as it turns out, they actually used the original configuration that was on the Voyager space probe. So that's convolutional code of k7 and these two polynomials, and you put that in there, and magically things start working. The next step is that they use scrambling. So you can set up your own scrambler, an additive scrambler. There's a different sort of scrambler called a multiplicative scrambler, but here we use additive, and we implement that as a linear feedback shift register. The one that's already in GNU Radio didn't quite do what I wanted it to do. It wasn't... It had to read out the bits before or after the opposite one. So I just modified that into this new one, and then you can use this mask in the seed to initialize it, and every time you reach a frame boundary, it just spits out your scrambling sequence and it descrambles it. So when you actually do that, remember that really noisy plot that we had before? Now it looks like it has far more structure, and it's repeating. Can you see that? It's not that random mess anymore. So that's really good. That means that we're on the right track. The last thing in a communications system is often adding a checksum on the end of your frame. So once you've decoded it, you can verify that the data that you've received and decoded is actually correct and free of errors. So in this case, they're using CRC16CCITT, which is one particular variant. That's just on the end of the payload there, and when you run it, you should get this value. So once you do that, the program will start spitting out these SUs. So this is 96 bits worth plus the CRC on the end. And these just come out in order one after another. And well, what are they? As it turns out, they mean a whole bunch of different things. But what I was particularly interested in is there's a certain combination of bits in the upper significant, most significant bits of the first byte that determines what sort of a message it is. And in particular, this user data message. So what they do is it can be of arbitrary length and cross multiple signaling units. And there's a sequence number that's indicated by the rest of the bits in the message. And as you can see, it counts down. So this indicates that we're starting an ISU, and then it's D6543210. And on the end of it, once you've been accumulating those bytes, you can then turn that into a message. And there's a whole bunch of other stuff going on here. Remember, this is the coordination channel, so you see logons and acknowledgements and information about the constellation, system time, and so on. So once you accumulate that, in this case, it was going on for longer, and it finally ends when you get to C0. Then you can turn that into, actually, as it turns out, a message that looks an awful lot like the sort of ACARS messages that we see on the ground. So in this case, you know, this has this weird formatting, but I actually see this often. Please arrive at the boarding gate at least however many minutes before departure. Late passengers may not be accepted. I thought they weren't generally accepted. But you also see, from all around the world, actually, I was looking this morning, I was seeing them from Hong Kong and I think Singapore, notices regarding those particular airports and weather reports. So these are all being downlinked to planes that are probably en route to those airports, and they want to know what the weather conditions are. And instead of, you know, calling someone up, they can just have the, you know, request weather and it'd be sent over in Marsat to the cockpit. And so this is saying that, you know, there's a taxiway K that's closed between runway 33 and taxiway J, blah, blah, blah. And then you have these METAR weather reports. So if you actually look online, you can figure out what it means. They refer to visibility and various, you know, that's overcast and various other aviation acronyms. And this is where it gets really interesting with CPDLC and AFN. These are a layer on top of the, you know, the messaging protocol. And again, it looks like some odd things, but, you know, here you've got some sort of obvious encoding. This is another ADS protocol. And again, that'll be, you know, one of the next steps to look at. But this actually relates to airlines sort of logging on and off these various networks and various updates as they fly through the sky. And then, you know, scheduling and often you see all sorts of free text messages too. It was sending various names and so on of the flight crew. So let's actually have a look then what the flow graph looks like. So not that one. Let's start with... this one. So this is the original one. This is testing one, one two. So one other nice thing you can do is, and I'll show you how this works, is that if you've got simple data streams like this, it can also be a bit of a clue to actually listen to them because this is slow rate data and it's FSK. You can pretty simply modulate this into your sound card and you get something that sounds like that. And, you know, that sounds like it should. So you can see down the bottom there as it's actually working. I'll bring the console over so you can see that. So it's just getting this on one particular channel and it's constantly decoding that. When it gets a message, it'll print that out. But usually, you know, it's this sort of fixed frames that are happening all the time and then every so often you see the interesting text messages. So if you look at the flow graph itself, then is it going to fit more or less? So here we've got these various channels. And... What's neat is that in this... You can just click on one. Oh, what's that? Special reach. Yeah. You can just click on... Come on. You can click on one of these and then, you know, see what the baseband looks like, do that power stuff that I was talking about with the squaring and looking for the peaks, you know, looking for the board rate and so on. So I'll show you this in the newer version. But initially, I just thought, well, why not do something like once you actually click on one of these things, the channels are really narrow, so you have to be pretty accurate. But you can't be accurate all the time, so you wanted to do some automatic tuning. So if you look here, you see how the green line's tracking over and trying to find the midpoint there. In this case, I was using that squaring technique with the peaks. See? Even that... That should get it. The newer version does get it, but that's still slightly off. So what this is doing then is it actually takes the output of this FFT and then it looks in one half for the highest peak and then uses that to calculate the frequency offset because this peak should be at 300. It should be at half the symbol right out from the middle. And so whatever the difference is between that expected peak and where the actual peak is, that's how much it'll shift the frequency over automatically. But the obvious problem with that is if you've got two peaks in one side of the spectrum, then it won't know which one is the one to use. So that didn't work. But the implementation is a bit fun if you can... Well, it's a mess, really, but you go into this FFT and then when you take the output, the output of that FFT, these are some nice blocks you can use. You can go into... Basically, you take the magnitudes, do the log of that, and then you use argmax, which finds the maximum input value and the maximum index where that value was found in the array that you end up passing through. And then you hook the index into this probe signal. And what the probe signal does is it just basically feeds on the incoming data. And then here in this function probe, you supply the ID of this probe signal, which is probe max FFT index. And in function probe, it basically just calls level, which is a function that's exposed by probe signal, and that gets the index. What? I guess five times a second or something. And then when it does that, you put it through one of these variables and then it calculates that as a frequency offset. Which then is fed back as a variable into this rotator. So it takes the fine offset divided by the baseband sample rate and then multiplies it by pi. And so it shifts the baseband around so it lines it up. But that wasn't so good because of those obvious issues I pointed out. So let's take a look at how you can build up a decoder. So the first step was The first step was decoding this as an FM signal because this is GMSK. This is basically just moving your frequency around a center frequency to convey bits. So you have your baseband coming in to quadrature demodulator, which is your FM demod. You go into an FIR filter. So I just made up some Gaussian pole-shaped taps there. And what that does is you might have a really noisy incoming signal and that smooths it out nicely so that you have some symbols that you can then do clock recovery on. And then you do this very simple subtraction here. So this single pole IR filter is actually really a long-term averaging filter. And so when you actually see the signal it'll be moving between two values. Hopefully negative one and one. But it might be elsewhere. But the point is remember how we were scrambling our incoming signal, which means that it's changing between one and zero. The bits are. That means that we have a lot of transitions. And so if you average that over a very long period of time, that should average to zero. And so what we can do is we do that long-running average and then subtract that from our original signal. And then we will get something that's actually nicely sitting around the zero point. And you'll see why that's important in a second. So this is the demod part of it. Very simple. And then we go and actually look at how that's used here. So this is the next hierarchical block layer. So you've got the demod here. And then you go into clock recovery. So here I've oversampled by eight. Because it's quite cheap here at this low rate. And then once you get your soft bits out. So remember these are not hard ones and zeros. These are soft bits because remember in that bottom diagram here when they were just above and below zero, they were sort of sprinkled around there with that separation. But they're not sort of your hard one and zero bit. That will go into this block. So this is actually a Python block. I've become really lazy so I don't actually make the GRC XML definitions anymore. I just want to use my block. So I write the code, expose it in Python, and then drop one of these any blocks in. And here you can simply type in the Python block that GRC would ordinarily inject for you. You can just do it in there manually. And then that'll make the block. You set input, output, and then that's done. So what this block is doing is it's looking for that magic sequence that begins at the beginning to mark the beginning of a payload. And then de-interleave them like I showed you with that interleaver diagram. So it builds up the memory because we know how long the payload is. And then once the interleaver's full, it just spits all the bits out here to the next stage. So nothing is coming out of this port until it's seen the synchronization sequence and then filled up the interleaver. Then it pumps everything out and then resets its state internally. And what's nice is that this is actually just Python code inside. There's no C++. It actually turns out to be the most expensive block in the entire flow graph. So if you want to run it, you probably should implement a C++. But for the purpose of prototyping offline, that was quite easy. And then as you saw before, you can go to this FEC decoder. So this is what's implementing that convolutional decoding. And it's passed an entire payload's worth and then it decodes that payload. And then these are soft bits coming in. And then it puts hard bits out. So it uses those soft bits when traversing that trellis to find the most likely path. And then once you've got your path decided, it outputs the hard bits that make up the traversal of that path. So once you come out of this, you've got error-corrected, hopefully, bits from your original receive symbol stream. Now our length at this point is 576 bits. So we go stream to tag stream, which basically takes the first 576 bits and puts a length tag on that to say how long the actual stream is, that packet in the stream, and then turns it into here, into a PDU, which is like a message. So so far, we've been sending samples and bytes through the flow graph in a continuous streaming manner. And at this point, we turn our payloads, our bits, into a packet, which we can just asynchronously send through the rest of the system. So this now is sending a message to this block here, which is the descrambling block. Again, this is just a Python block. So you saw before that you basically need to generate a scrambled stream. This block will do it too. But this block also internally checks the CRC. So once it descrambles, it descrambles it, and makes sure it's a valid CRC, and then adds metadata to the message, saying if it's valid or not. If I was to use this outside, I need to also implement another block to do the CRC checking separately. But at the moment, that's all being done in there. So out of this, then, you get a message that contains your individual signaling units. Remember, we had six. This will descramble them, CRC check them, and then break them up into the individual packets. And then that's output on this to whatever is using this particular flow graph here. And at that point, we're good to go. So this is the GUI here. And this is a little bit simpler than before. So we have this file, which we recorded. And then we put that into this frequency-translating FIR filter. So that's used to actually select the channel that we want to listen to. And then, again, we do that tricky stuff where we square stuff just to visualize it anyway. And then there are a couple of different ways of doing this. But in this case, we go into the decoder here. And I've also got a DMOD here. And the reason why I have the DMOD is I'm not using the output. I'm just looking at the average value. So remember how the DMOD actually subtracted the average? We could actually just run it by itself. But because I want to visualize what the frequency offset is and maybe plot it or what have you, I'm bringing this DMOD in here and just using the output of the average here. And then in this case, it's feeding back to the rotator, which is doing a frequency adjustment for that. Just another way to do it anyway. So the output, remember, we're getting messages. And here we've got these two blocks. One of them is the message parser. So it's just going to tell you all the messages that are coming in. And the other one is this user message parser, which will specifically look for those user messages and then accumulate the data and then print out the payloads. And then in addition, I go PDU back to a stream, unpack those bytes to bits, and then send it out on a UDP sync because then there's another little flow graph that you can run that will do the raster plot for you so we can see what the structure of the data actually looks like. And then in this corner is the audio output. So basically, you're taking in your bits here. You're resampling them to an audio rate, doing some filtering, using a VCO data to generate one of two tones, moving those tones and the separation between them and then going out to your audio sync. So that's just a nice little visualized audio. What's the term to convert it? Sonification? Sonifying? So have a look at this. So this is that recording again. And we've clicked on that particular frequency. You can see it's printing out the information there. Here, you'll notice that this is where I clicked on it in the previous one. So you'll notice that this is 0, DC, but I clicked on it so it's slightly offset. And here the green line is showing you where the center of this particular signal is. And then we can use that rotator to rotate that back so it's exactly at DC again. And good for slicing. So how does that work? Well, we're not using this technique anymore. Why is that so slow? Hello. There we go. So this is what's originally coming in. You can square it and those peaks are still offset. Here we've moved it back because we're showing what the output post rotator is and that's nicely lined up around the center marker there. It's off the screen, unfortunately, but it actually has a little graphical text box that's telling you what the detected frequency offset is. But there's a really easy way to do it. Of course, we've got the board right there and it's exactly at 600 as we expect. So let's look at this. So you can see the green line is the DC average, which is nicely at 0. And then we have our symbol stream, which is the blue line, nicely shaped after the filtering that we end up slicing on. So you can see that we've got these nice excursions and it all looks good. So let's look at the clock recovery and we can do the dots and you've got the nice separation there. That all looks good. So this is actually what's coming out of the FM demodulator and then once we do that filtering, it turns that into that. So you can see what an effect a nice match filter is. So you can see what an effect filter can have on your signal and the performance of your decoder. Another nice view is if you use the histogram, then these are actually the soft bits that are coming out of the clock recovery. So again, this is a sort of nice representation of that separation between a negative one and one. So that's like looking at this from the side. Now, one thing I didn't want to show you was . . . That DC, which I'll show you in a second, that DC value and that little number that would show the frequency offset, that's cool just to watch it and maybe you output to a block and then you plot it later. And there's probably other ways of doing this too, but I pulled this in a while back and it seemed to work quite nicely. I have a Python module called Real Time Graph and it's been quite handy because it just gives you a really simple Pythonic interface to draw stuff in Matplotlib. And in this case, you can just import it and I have this variable here which is just an empty list, which are the points that we're going to plot. And then we have this AnyCode one and AnyCode is a block where you can inject arbitrary Python into the Python that this generates. So in this case, I just go Real Time Graph and the title is Fine Tuning and I want to show it and that's it. I just call this block Graph and then here I use this AnyCode with this variable dependency. So this code then gets fired every time frequency shift changes. And every time frequency shift changes is when that probe is running on that average value that's used to compute the DC offset. So what that does is it just goes fine tune points and then add the shift value to that list and then set the data of the graph. I'm actually using a semicolon there to do two lines of Python in one. And that just automatically fires every time we get a new point. So what's cool is when you run it, you get... This is popping up on my screen here so I'll just move it over. So this is showing you as the program is running that the receiver is adjusting its fine tuning of the incoming signal and moving the baseband and now it's actually locked on the signal properly. So that's about a 250 and a bit-ish hertz offset from where we clicked on this to where it actually needs to be centered up. So that's this offset that's showing you in that graph. So how does that actually work? Well, it's really quite simple. So let's have a look over here. What I'm going to do is instead of plotting the DC coming out of the already corrected version... Go away. I'm going to plot it coming out of here which is effectively the same as if I did not rotate and just use the output of that. But this is what sort of coming out actually. What I'm going to do is turn all that off. So disable that. Disable that. Disable that. And then I want that and then I want that. And... Okay, so what we're going to do is we're going to turn this rotator off effectively by multiplying frequency shift by zero. So we never rotate this incoming spectrum. This is just doing the averaging internally but we get to see what the output looks like. So remember before we had that green line around zero and we had the blue moving between... Is that the right output? Average and filtered. Let's do... dmod... Okay, there we go. So what's interesting is this is the signal before the filtering step so it actually looks really noisy as you can see. But as it turns out when you average it when you take the long-term running average of the filtered version of the signal you see how the green is actually up here instead of at zero? That's because although once you've actually done the quadrature demodulation although it's worked and it's done it and it's still within our bandwidth here you can see it's still within our bandwidth it's just off center. This effectively moves your one and zero which would nominally be here at negative 300 and positive 300 since we moved it it actually adds a total offset to your output signal which is what the green line is. So because we've moved it in frequency now we've got this DC component that's also moved with it after that long-term averaging. And what's nice is that we can probe this value of this DC and then convert that back into the frequency offset. I mean this is linearly proportional to that frequency offset. So that's why it's going to that probe and then you can do that little calculation and get that DC offset back to hertz. So that's that and it's just a super super easy way to correct your frequency offset but I just thought I'd take you through it so you can sort of visualize what's going on and see how you can put that together. And so that way now we've got one, two, three, four, five six, seven, eight, nine channels there. What happens if you want to do them all at once? We just picked one let's do them all. And again I've got certain members of the audience that probably have far better ways to do it like with a polyphase channelizer that's what all the cool kids are doing but I wanted to use something that didn't require too much too much thought. Let me just show you this while it's still on the screen. Oh, did you see how it sort of found it and there was the sorts of bumps in it? They're the sorts of frequency offsets that you can sometimes encounter larger than you might expect and which is why you need to have this sort of this setup to do that fine frequency correction because remember our two symbol points are only 300 kilohertz in this case normalizes either side of the DC. So if you have some massive frequency offset frequency shift that's even just temporary it's going to end up corrupting your data because you'll have all 1s or all 0s. So let's do them all at once. How to do that? Well, a while back I created this sort of multi-channel decoder idea where you could specify the the sort of singleton instance of a decoder and then you would give that to the multi-channel decoder and it would spin up that many versions of it for each of the channels that you want to actually decode. So this is rather a computationally expensive way to do it. If you're going to do it and I might go back and try using a polyphase channelizer approach that's a computationally far less expensive way to do it. That's right, Tom, right? That's the way to do it. But there are various assumptions and restrictions around that. Yeah, not really. Well, yeah, but I suppose Yeah, but actually being able to set programmatically how to combine them. So, I mean, that would be the Python that I'd need to implement. Yeah, you can do it, but it's just Yeah. the math is pretty tough to actually set those up because the building blocks are there. Yeah, yeah. And it depends on which channel you actually want to pull down whether or not it's going to bring you a point. Yeah. But that's the cool way to do it. Actually, if you look online, Tom and others have Tom Rondeau, by the way, is the former now maintainer of the Gooner Radio project. He spent many years really really adding great documentation and fixing up the framework and making it what it is today. So, big props to Tom. But in this case, just you can consider this approach as well. So, what I've done here is I've created this sort of template. And so, we would have our baseband coming in from our receiver. We translate that to the frequency where our channel is. And then we just plug it into our page channel decoder as we had before in that single instance of it. And then we just send the messages back out. And that's all it is. It's just move it to your channel and then decode it. And then... Yep. AKA TNT has also done some pretty amazing Satcom style hacking and some really advanced Gooner Radio stuff too. So, definitely check out his work. But once we've defined that template, this is then all you need to decode all of the nine channels there. So, I just have a list here that contains the frequency offsets for all of the nine channels there. And then here, you just connect the USURP source into the multi-channel decoder. And we tell it that we want to use the InMarsat Aero P-channel decoder. We give it a frequency list. And then we hook the output port into the user message parser. And so, what this will do is when you press play, this will spin up nine versions of the decoder, hook them up to each of those channels, and then just let it run. So, once we hit play then, we get an error, naturally. Apparently, something's still running. Oh, no, that's old. Hmm. Give me a second. Okay. What's that? No, is it? No, it was here before. No, I'm seeing a trace back. I was running this in one of these terminal windows. Hmm. I'll just try it here. What is this saying? . Oh. That was kind of obvious. . I haven't got a USURP. Right. So, actually, here's something I prepared earlier. I've got that same recording. It was off the screen, which is why I didn't have the visual cue. The reason why I have the USURP is because this is what I want to show you with the internet, but since we don't have it, we might come back to that later if I can set it up, but probably won't, because I don't want to get hacked. My friend Ian Buckley, who set up the dish and everything, he's actually got an Odroid, which is a small embedded eight-core arm with four big cores and four small cores, in an enclosure next to that dish plugged into a USRP, which is hooked up. So, that whole little thing sitting there running all the time, and it's running this, and it's just streaming messages, and I've had it log into a file, and it's just been storing all sorts of stuff there just to, you know, see what turns up. But what's kind of nice is that because of the low bit rate and so on, it can actually do all the nine channels even with this expensive non-USURP. It's a non-polyphase approach on the embedded platform. So, if we run that, there we go. So, you can see that it's saying that it's, you know, created all the decoder instances and all the different options. Each of the decoders is now finding the unique synchronization word, and they're not printing out the generic messages. They're just accumulating user messages. And so, you can see... You plug this into a USRP. Oh, thanks. Well, we very kindly had a USURP brought up. That's great, too. The only thing we're missing is a dish with a circularly polarized antenna feeding an LNA in a bandpass filter, which is why I wanted to log into the box. Oh, yeah? We can make one? You've got, I don't know, what, 40 minutes? Turn that chandelier into a dish. But we still need an LNA and a filter. But thank you very much. Thank you very much. So,こと is... That's come and gone. So, this recording is really short, so actually we don't get a lot of stuff out of that. But, you know, it's just, I guess my goal here was just to do a really clean try to do a cleaner implementation of it. And so... Yeah, I'll put all that up on my GitHub and then people can play with it. And then, you know, if anybody wants to look at using the P channel and synchronizing to it and you can go up the layers and look at the rest of it and maybe get to voice. But that's for another day. So any questions on this InMarsat stuff before I move on to the next topic? So when you're logging all that data, do you have any idea of what you might be able to find in there or what long-term patterns might emerge? Yeah, so a lot of them usually have the rego of the aircraft. So you can actually look at how often and where they pop up. You can also then infer... I've seen messages... Maybe I can connect to it at the end. Maybe I still have part of the log open in my console. Oh, here it is. It was running in screen. But again, you get messages that contain waypoints so that you can derive flight paths. When you have the waypoints, you get the rego and it gives them information about weather and airport state. Then you can determine where they're actually flying to. And there are all the weird sort of human-readable messages that you wouldn't expect to see that identify people or interesting factoids about the aircraft or whatever. So it's just kind of another tool in the plane spotter's arsenal. But it's just cool because usually you get them from a terrestrial network. In this case, you're getting them from a satellite which is actually servicing a huge portion of the Earth. So you're hearing any aircraft in that area potentially. So this is super simple compared to some of the other stuff like Sec came to Cyberspectrum last night. Oh, there he is up the back with the cool radio badge. But he's done some absolutely incredible work with the Iridium constellation with Schneider and some other guys. So definitely check out their talk from the most recent HOPE conference. Really, really stunning stuff, like way beyond this. But I guess I just wanted to show you how you can sort of easily get into SATCOM using this kind of technology. So what else have I got for you today? Oh, we had the RasterSync 2. This is just, this was that little tool that I was telling you that you could use to actually visualize the data, the plots. So here, it's just a UDP socket hooked up to the Time RasterSync. That's all it is. Really basic. But it's a very powerful tool to enable you to look at the bit patterns. So if I run this, maybe not that. Maybe, maybe, maybe, maybe, maybe, maybe, maybe, maybe, maybe. So that's running. Do we have a signal? Yup. And then once we start spitting out data packets, there. You can see that as it's actually decoding an entire payload's worth, you get this data coming out. Now this is, showing you the bits post de-scrambling. So this is sort of the, looking for repeating patterns with the actual raw data. The data on the, over the air, you know, you could equally just hook up your, your UDP sync. Where is it? UDP sync, where are you? Here. So this is just looking at the output of messages. You could easily just take, you know, this new chart of float. And then, or just take the floating point, output of say the, the demod or, or, yeah, the demod. And then we can actually see what that looks like. So this is before any of the decoding has actually happened. See what that looks like. Where's my, did I close it? So again, that's looking at the raw, demodulated symbols. And I probably hooked it at the wrong thing, because that looks like noise. It's purty. It is purty. Demod, filtered. Oh, SIMS. I meant to hook it up to SIMS. I beg your pardon. The symbols coming out of the clock recovery. So let's try that like this. Oh, what's wrong? Port is not connected. Which port is not connected? Scope sync. What have I done? Oh, this is no longer connected. This was connected to this. Okay. Yeah. Um. Oh, no. That's the other monitor. A little bit. Okay. So, so, so, I thought it was 1200. No, no. It was 152. I can't remember. It's one of those. But in one of them, you get exactly that plot that I showed you in the, in the presentation before. So again, that's going there. You can see that it's, you know, making these subtle adjustments every so often. So, yeah. Another, another cool little trick you can do to visualize stuff. All right. Let's, in my set. Let's, um. Yeah. There's some stuff I want to show you remotely, but we might, might leave that for another time. Uh. Okay. Um. So, I'm, I'll, I'll do a, a quick little, sort of, fun, fun tidbit. And then, um, we'll, we'll look at some analog NTSC video decoding. Um. One thing, I wanted to have more of it done for today. Unfortunately, uh, it actually turned out to be a lot harder than I, I thought it would be. Um. But there are some old signals that are still used and, um, are really quite, quite neat. And, and, um, cool. One of them is, um, frequency modulated, um, continuous wave radar. Just trying to find where I put it. Um. Anyway, I'll show you a quick demo, with what you can do with it. So, in this case, uh, in a, a lot of radar systems, what happens is, um, and I've spoken about this before, is that you have, like at the airports, you have the large spinning radar, and that sends out a very powerful pulse of energy, and then it waits for echoes to reflect off and come back from, say, the fuselages of airplanes flying through the sky, and other objects that will present themselves as a significant radar cross section. They have that huge antenna, because it's directional, and thus you get quite a lot of gain, uh, so that you can receive that very weak signal as it, as it bounces back. Uh, in that particular case, they're basically just sending out a very powerful, quick, uh, pulse of energy at a single frequency. But then there's another radar system called FMCW, where, instead of just sending out a one frequency, you can actually, linearly, or, or otherwise, increase the frequency from a low point to a high point, and then jump back. So it ends up being a sawtooth, and then you generate what's called a chirp. So this chirp goes from a low frequency to a high frequency, and then just keeps running, just repeating. And that actually has some very powerful properties that you can exploit, to very effectively create a radar system. Uh, and this is used in all sorts of different environments. Um, but the nice thing is that, firstly, because you're effectively, when you're decoding and demodulating it, that chirp is unique, and so you're effectively, you're creating a match filter for it, so other noise will then disappear. And also, when you run the FFT of that, the frequency shift that you get, uh, is actually, your range information for your targets. So, when you do that convolution, you actually go from the frequency domain into the time domain. It's really pretty powerful. But, you can do something like this. So, um, a little bit too big for the projector. So this is, this is running, and we're all about SDR, but you don't even need an SDR to actually play with this. You can see that there's some stuff happening there, and I've muted the speakers on my laptop, but I'm gonna unmute them. Can somebody give me a piece of paper? Just like, does anybody have a piece of paper? Maybe I've got one. I'll just use my lap, oh, the laptop's alright. Um, check, check, I've got another two in there. Alright, have a look at this. Let's get a good, good setting here. That should be pretty good. Unfortunately, you can't see the, the bottom, but you'll, you'll get the effect. This is good. Install Gen 2. The range, you know, it's not, it's not that, it's not that fantastic. But, anyway, you get the idea. So, what's actually going on here, this is a flow graph that generates an FMCW chirp, and then plays it through the speakers on the laptop, but then it's simultaneously listening on the microphone, and it's doing a transformation then, I mean, this is effectively an FFT here, it's doing a transformation that looks for that pulse, and then plots it out. And the reason why, as I change this distance between the, the laptop speakers and the microphone effectively, uh, you're changing the time delay for that chirp to bounce off another surface and come back. And, because that, uh, can go through that convolution, this is an FFT plot, but, the bin that it falls into is actually directly related to the range information or the, the propagation of that chirp from one point to another one. And, um, you know, these signals that the microphone's picking up are quite noisy, so you get this kind of stuff, but, um, in other sort of systems you can actually process and filter that out pretty effectively. Um, so, one other thing, is that this doesn't work very well because, again, this is just hardware, hardware speakers and a microphone. But, if you listen carefully, there are two speakers in this laptop, right? Which means we can create a phased array and try to get angle information out of the target space above the laptop. So, what happens is if you listen, hopefully you'll be able to hear it, but it sounds pretty uniform right now. So, what I'm going to do is I'm going to click this button here, and then it's going to phase, from the left channel through the right channel. So, it's basically going to sweep. And what that's doing is it's changing the delay between the two wave fronts that come out of the laptop. So, when you modify them, when they come out at the same time, it'll go directly up. But, when you offset one, for one to come out a little bit sooner than the other one, you're basically going to add them together as the wave fronts propagate, and then beam form it in one particular direction. And that will then sweep through. So, you basically change that, that delay there. And, so, you can see, you effectively get a wave front that propagates, basically, like, like this. And, again, it doesn't work very well because, you know, you've got your microphone inside your laptop, right next to the speakers. But, so, have a listen. You might be able to hear what's going on, with the stereo effect. Can you hear that? Yes. So, what that's doing is, it's processing the FFT, and then I've fixed the rate at which it's doing this beam forming, and every time it actually runs one transform, that builds up one scan line, and then for each of those beam formed angles, it produces, you know, each stack scan line. So, one of these pictures is supposed to be a full run through the, through the beam forming range. So, I mean, the idea is that if you were to, you know, you've got to sort of get it right. It's very, very finicky. But, the idea is that you would see, this is from on the horizontal axis here, the X axis, this is still range information. But, your vertical axis is now angle information. So, you would expect to see sort of a hotspot at the angle at which your, your target object is actually sitting at. And, again, maybe the transfer function isn't quite right. But, oh, there we go. Yeah, see there? There's that, is that a fluke? Okay. So, actually, that's kind of working. But, I have to stop talking. You can see there's that line that comes down. I'll just describe it quickly. There's a line that comes down, and it gets a little bit weak at the edges, but it's a little bit stronger at the center point. Well, just offset from center. Let's see. See, it's slightly stronger offset from center, and that's because I'm holding laptop offset from center. Maybe, I don't, I don't know how well this is going to work if I hold it here. Yeah, a little, that one that's quite close on the left-hand side. So, it was around about here, I think. Anyway, you get the idea. But, again, that's just, you know, super simple with this. What's nice is that you can get a USERP, like a, like a B210 or something with two coherent outputs, get some CANs, point them somewhere, and then get this to do exactly the same thing, but in the RF domain. And, you know, you can do FMCW and look at Doppler shifts. So, you can, you can do normal CW and just look at Doppler shifts. But, if you use FMCW, then you can do this phasing and also get range information out of it, too, quite effectively. And, I started doing it very quickly at the end of one cyber spectrum with some CANs, but, I think I was getting overruns and stuff. But, again, maybe for a new radio conference. So, how does that actually work? Well, it's, it's pretty, pretty straightforward. Oh, Let's see. I know what I can show you. Oh, it's not open. What's the document called? Let's see. Here we go. As, as you sort of do research and, and read things, you basically find out that everything cool that has ever been done in, in computer science, or DSP, or, you know, anything, it was all done in the 60s and 70s. I found this paper, I'll show you in a minute why this is interesting, that talks about FMCW radar. And what I want you to, to imagine is, and I'll show you what this actually looks like in board line in, in a second. What I want you to imagine is that this solid black line, this is a paper by Barrick from 1973 about FMCW. This black line is actually what's transmitted by your radar system. So, you've got time running along the horizontal axis, and vertical is your frequency. So, you're effectively making a tone that goes from a low frequency to a high frequency. And then this dotted version is actually what you're receiving. And what you can consider is, if you're transmitting this waveform, and it's bouncing off an object and coming back to you, you will essentially see the same waveform, but delayed in time a little bit. And that's really nice because this waveform, because you can create a match field for it, has really nice correlation properties so that you can ignore noise. Now, what's pretty cool about this chirp waveform is that, on the receiver side, you can create the same chirp, basically take the chirp that you transmitted, and multiply that by your incoming samples from your USRP. And if you end up receiving this signal or a delayed version of it, you'll effectively undo that chirp nature of it, and then get a tone, a single tone. And you can take the FFT of that, and then in the frequency domain, you get a bin that lights up, and that's your range information. I'll show you what that looks like in just a second. But that's the kind of waveform that we're dealing with here. And we can realize that pretty easily. We've got our... I'm going to start up at the top here. So you've got the audio source, which represents the microphone. And then you go through a Hilbert transform and turn it from floating point into the complex domain. And the reason why we do that here is because we're going to multiply it by the chirp that we generate. In this block here. But what we do is we have this signal source, which is the sawtooth waveform, which is exactly the waveform that I just showed you here, sawtooth. And we have this particular frequency here. I'm running it at 50. So that noise that you heard before, that was actually a chirp running at 50 hertz. So you hear 50 chirps per second. And then that's generating a sawtooth. So this is the sawtooth waveform, which is then going into this VCO, voltage control oscillator. And so this is actually producing the chirp signal. So what you can think about is the sawtooth is controlling the frequency of the waveform that we want to generate. And the VCO is actually generating that waveform at the frequency. So this is constantly doing this sawtooth. And so our frequency is constantly going from low to high and then low to high and then low to high. So what we're doing is, once we've generated the chirp, we mix that with our incoming signal and then it goes off down there. Let's see. So that goes down here. So we've got our sawtooth and we're also going into this VCO. And this is the phased array component. So I'll come back to that in a second. So what we've done is, once we've actually multiplied our incoming signal from the microphone by this chirp, then we go and we put it into this multiply block. And I've just done a bit of trickery here. I can't even remember whether this is a restriction anymore because when I do it in Python, I don't worry about it. But I'm trying to do an FFT. They're restricted to powers of two here, right? You can't do arbitrary size FFTs? Yeah, you can, yeah. Really? Yes. All right. So I've overcomplicated things, but what's new? So I was trying to make a power of two FFTs. So what I'm actually doing here is I'm padding out the samples. It turns out that you don't actually need to do that. I mean, you don't need to do that. I've been using NumPy to do some offline stuff and you don't need to do it. So here, I basically have a window. Usually, the window is applied within the FFT block. But here, I window the samples that I've received, which are shorter than 1024. And then I'm padding the rest out with zero. So I'm effectively bringing it up to power two. And then the stream mux is combining the samples that I've brought in and windowed with the padding on the end, and then it's going into the FFT. So that works too. And then I'm running the FFT, and then I'm chopping off half of the FFT, because we're just interested in one side and the magnitude information. So again, I take the magnitude, do the log of it, and then I decimate that stream. So I'm keeping one in every 512 transforms because this sort of modified sink can't accept too much data, otherwise the GUI hangs. It's just a weird OSX thing. And that's how we actually then get that visualization of the range information. So that's essentially what you're doing. You're taking the incoming signal, multiplying it by the chirp that you originally sent out, take the FFT, and then you get range information. And then what about the rest of it? What about the phasing? So I've had that checkbox there. So the checkbox is this run array. It's either a one or a zero. Here I've got the signal source, and this is a sine wave, but it's actually set at a frequency of 0.6 hertz. So that's... If you imagine, don't think about it as a sine wave, think about it on the complex... Unit circle. Yeah, unit circle. Thanks. Think about it on the complex of a unit circle, and what you can imagine then is a phasor that's slowly rotating around. And it's doing that rather slowly because I've set it at this really low frequency. And usually, since we're not running the array, we just take the output of this VCO, which is our CHIRP. But if we want to phase it, then we can do that too. So when we're not running the phasing, we want the same signal to come out the left and right channels of our speakers. So if we go and look at the audio sync here, the audio sync... Oh, for some reason I have this all up there. This is a multiply cons block, so it's basically just getting the signal to a nice level for the audio sync. But here we've got our left and right channels. And once we've created our CHIRP, we go through and just take the real component, put that into the left channel, and then with the array, we essentially have... Oh, that's what I forgot. So in here, in the signal source, the amplitude is actually set to run array. So if run array is on, we're actually going to get samples coming out of this with all sorts of ranges of values. But if the array is not running, then amplitude is zero. So this is going to be producing samples, but they're all going to be zero, which is like as if it was turned off. So if the array is off, this is producing zero samples. We add one to it. So we actually get ones coming out here. Then we multiply that by our CHIRP signal. So then we get the CHIRP signal happening with the same phase offset. Take the real component and put that to the right speaker. So we get the same signal going out left and right. If we click that checkbox, suddenly we get useful samples coming out of here. But when we add, we're actually adding one minus array to it. So that actually swaps what's going on now. So now this is going to be producing valid useful samples, but this is going to be producing zero. So valid samples plus zero is the valid samples. Then you multiply that by the CHIRP signal. And although this is a slow sine wave, this has the effect of changing the phase slowly of our CHIRP signal. And once you then take the real component and put it out to the right speaker, we've got two CHIRP signals that are offset in phase. One is a constant phase and the other one is retarded in phase and then forward in phase as they come out the left and right speakers. And that's why you get that weird stereo effect because you can hear it on either side of your head. And that's all there is to it. Really pretty basic. No complicated processing beyond doing this CHIRP in an FFT. So it's a pretty cool waveform. Now I'm trying to find some photos here. Where did they go? So this radar, in this case, it's used to do a bit of fun stuff. And in other situations, if you actually look at the FM band, let me show you what that looks like. I'm going to open a board line here for you. And we can look at some signals. Let's see. Something not huge. Maybe this one. Oh, geez. I brought it over here and it disappears. Okay. Now that's a flooding point. Let's see what happens. What do we get? Cool. I'm just going to resize this so I can access the whole window. So this is Boardline. Boardline is a really cool piece of software that you can use to do offline analysis of files with. Made by a guy called Eric Olson. And this is part of the HF spectrum that I've recorded. And let's try to get this all on the screen here. And I've just gone out with a long wire and attempted to receive things over HF. And let me see if I can get a photo of that. No, not there. Anyway, what we're actually looking at here now, this is time on the vertical and frequency on the horizontal. This was at what frequency we got here? Is it 13 meg? This should be 3 megs, I think. Oh, yeah. No, I'm using a transverter. So you can get a long wire to loosen the HF and then you can plug it in. Who's got a hammered up? Who's sort of a hammered up converter? Yes, you can get a hammered up or other sorts of up converters. It's essentially a mixer. And then plug it into your normal SDR to actually receive these HF signals. You've got AM radio stations, hams talking on them, PSK 31, all sorts of other interesting analog and digital modes. But then you've also got these chirps that show up. And as it turns out, there's this system called CODAR. There's a company called CODAR that makes this HF radar mapping system. And you can see these characteristic antennas around the place. And they actually set them up to map the ocean currents. So they're set up near the shorelines. And they actually just set up an antenna and they're constantly sending out this chirp. And then the system is specifically tuned so as the wave front travels out over the ocean, it will actually reflect off waves. And those waves will reflect a small amount of energy back here. But also, as the wave is moving either away from the transmitter or toward the transmitter, then that will actually impart a Doppler shift, which you can also pick up after integrating on this chirp for some time. Now, you can do all sorts of interesting experiments with this. If you know the guy that creates aerospace radios and stuff on his blog, he's done some really cool processing of these sorts of signals. Once you start doing this sort of thing, it's really important that your receiver is locked to the transmitter. But because you have no control over the transmitter, usually, if you're lucky, the transmitter is locked to GPS. So if you can get an SDR that accepts an external reference input, you can actually get then a GPS DO, GPS Disciplined Oscillator, that will output 10 MHz that's disciplined by the atomic clocks on the satellites. And then that will bring your sampling rate into alignment with the transmitter, which is what you need to then very accurately process the information and then extract Doppler information as well. But this is what the wave form actually looks like. And you can hear these things. It's kind of running out of time, so I don't know whether we can necessarily listen to them. But what it looks like on the spectrum, as you saw before, was this sawtooth wave. So in this case, this is a down chirp. The frequency is going down. And you can see here that you've got these lines. And if you actually zoom in there, and we can also zoom in in terms of frequency, you can see that you've got these lines. Where is it? Is that it? You've got all these other cool signals there. So there's our chirp. And so what's interesting is that you've got what looks like this main lobe, the central signal, and then you've got all these side lobes there. And the reason why that turns out, Peter, who does RRspace, actually had this on his blog, but really interesting, is that this is actually AMing of the signal due to the fact that the transmitted signal that they're transmitting is actually gated, which means that they're not transmitting continuously. They transmit a little burst, and then they stop the transmitter, switch to receive mode, listen, and then switch back to the transmitter, which is what, you know, for example, a primary surveillance radar does at an airport. And that makes sense because they're using the same antenna to transmit and receive. So that's what's actually producing this AMing effect in the frequency domain. I won't do it now because it can be a bit of a pain, but if you were to actually look at that signal, where are we? Here we go. If you were actually to zoom into that signal even more and adjust your windowing function and all that kind of stuff, each one of these chirps actually looks like this. Can you see that it's actually dotted line now? So that's actually the gating of the signal that's turning on and off. And when you do put that in the frequency domain, you get that AMing effect. But that's okay because we're talking about, well, not quite, but almost the speed of light. So if that reception time, if you take that reception time, multiply it by the speed of light, if that distance is within, the virtual range distance that you want to monitor, like to the actual ocean waves, then that's all you need to do and that's fine. But what's interesting is that these signals are out there and you can actually take these signals and process them and produce these really cool plots, which I'll show you. I wanted to have more done, but didn't quite get there. But in terms of the actual setup, what you actually need to do, here are some photos. So we actually went up, if you're familiar with the area in San Francisco, Skyline Boulevard, there's that road that goes up and it's quite close to the ocean. You need to get away from civilization because everybody's switch mode power supply absolutely destroys the HF spectrum. As it turned out, we had to do this entire operation purely off battery power, no inverters. So I had some DC to DC inverters to power the USERP and when we turned that on, the spectrum just went to junk. We ended up getting these lantern batteries and using those, actually getting parallel to power the USERP. The laptops just ran as long as they could on the internal battery power. Unfortunately, because they're MacBooks, you can't just pop in another battery, but not that you could exchange the battery while you were recording anyway. But I got about an hour's worth of recording on that, which is pretty good. And we've got two setups here. We've got a USERP N210 connected. We've got a basic board plugged in there with a band pass filter. So that's just receiving it straight in there. Here, this is a USERP B210 hooked up to a hammered up. So we had two antennas there. And we were really cold and the mist was coming in. And we had a long wire antenna and a... So that's kind of the setup there. A long wire antenna as well as a dipole that I brought. And, you know, so the... We've got an LNA here and some other things, but everything's powered off batteries. Like the hammered up is powered off. And I think... Well, that's off USB, but there's also nine volts powering and LNA. And, you know, really, really... Basically, any... And then, oh, then we also got a 110 inverter to power off the car battery to actually attempt to charge the laptops with. And as soon as we plug that in, you have to make sure that when you plug it in, you can't just verify and determine what's going on just by plugging it in. You actually have to put load on those switch mode supplies. So you plug it in, nothing happens. And when you actually plug in the laptop to charge, then everything disappears into the noise. Oh, I don't have the photos I need, but I have these two squid fishing poles. You can use them. They're telescopic. Put them up and then basically just... You've got a long wire hanging off there. And you can hook it up and then that's pretty much all you need. And so what can you do? Well, I've generated some Python scripts that you can use to actually transform this data. So I won't demonstrate them to you, but I'll just show you the sort of progression here. Actually, another guy that is pretty much the expert in this field is Yuha... Do you know how to pronounce his last name? Vernon. Vernon. Vernon. And he's done some absolutely amazing experiments. The reason why this is cool is because they're generating a signal that they're using to map the ocean, but it's also very powerful and because it's HF, it can also go up and bounce off the ionosphere. So you can actually use this, especially at nighttime, to look at ionospheric effects of the signal because effectively the ionosphere is becoming a mirror to these HF signals that somebody else is producing. And then you're using essentially passive radar techniques to then visualize the signal and the effect that the natural world and the sun is also having, how that's affecting your thing. So this is a plot... I've got some Python code and I'm going to put it up, but this is essentially an FFT. I wrote this because I wanted to create really, really big FFTs and not have to use a tool and muck around with a tool, just have it spit out a massive image. So this is actually part of that spectrum again. And you can see that there are these various different CODAR signals at different frequencies that you can pick up. And then once you do some clever processing, you can basically find the bandwidth and then you can use some simple DSP tricks and do autocorrelation. And then you can create a matching chirp and then filter that down. So you get a plot like this essentially. Remember how we had the aiming effect and we had those side lobes? Because you have that frequency that's chirping down, going from high frequency to low frequency, if you match that with your own chirp and you mix it down, you then get a straight line. So that main lobe then just becomes this straight line. And then we have the other side lobes that come off there. And the way this is running is this is actually an FFT that's running from left to right. And so this is time here. And each FFT is the length in terms of samples of one chirp. And that's how then you can produce these nice plots. And what we're interested in is what's going on in this band right here. Because if you consider the speed of light and the distance that it would traverse over the length of a chirp, we're talking, you know, multiple times around the world and then some, we're only interested in stuff that's close and effectively up to the ionosphere, which can be a virtual range of a couple of thousand kilometers. So that's just in this very small band. And if you zoom in there, then it ends up looking a little bit like this. I'll show you another plot in a minute. But, um... Excuse me. Time. Oh, time. Are we up or... Is that it? Dad, how long do you need to set up? Um... Not too long. Boss says you've got five minutes. Five minutes is good. So we are effectively looking now at, you know, whatever propagation and wave fronts are coming back and we're receiving them all here. And let me try and find another plot. The cool thing is that you can actually see stuff that's actually moving. Maybe... Not in that one. Let me find another one here. Ah, here we go. Here it is. Have a look at this. Which is a good one. So again, we've got our sort of, um... They can't see them aliasing there, but we've got our sidebands there, AM. And if you actually zoom into one of them, you can see... Where was it? This thing. So this should be straight. And in this case, I wasn't using a GPSDO. And I have to go back and reprocess everything and do some fine frequency offset. I think I calculated that at each step, I was losing like 0.02 Hz. So even in that tiny amount of frequency offset, it ends up actually producing this visible offset over time, which is why I need to lock and integrate and make sure that you round everything up. But, you know, you can see stuff moving there in the middle. There's a better plot and... Unfortunately, I just can't... Oh, that's the one. So here, you get this really interesting fringing effect. And you can kind of see here, there's this discontinuity because I had an overrun. So everything, all the timing got desynchronized. But you can see here that, you know, stuff is actually moving. Because this is a range plot and these intensities are moving in there, there's something out there that's actually changing its virtual range with respect to my receiver and the transmitter. So things are sort of, you know, might be getting close or are moving away and you get, you know, these sorts of effects there. I'm not... I haven't looked into it enough. I don't actually know what's going on here. I have a feeling this is probably more likely the ionosphere than the ocean. But it might be a combination of both or something else completely. So if, you know, if anybody has any ideas, please talk to me afterward. But this is a continuing area of research. And when we went out, we used GPS DOs. I still have to process all that data and optimize my code a little bit because it's like... many, many gigs of samples to convert. But anyway, this is just an experiment. Again, a little feel for what you can do. And in the last minute, I didn't get time to show you, but you can also do analog video decoding. So FPV on drones ends up actually using NTSC over FM. That's the one that I've seen anyway. And so when you... You can read a flow graph. I was mucking around with this a little bit. Still very experimental. Let's see. So my vertical sync needs some improvement there. But I've... Effectively, this is an NTSC waveform coming in. And I've got two match filters that look for the vertical sync and the horizontal sync. And then it tries to line everything up and then give you a picture. I didn't actually see color burst in this one, so I didn't have any color information. And I'm just plotting luminance information anyway. But usually, I've found that if... I just have to tweak the timing on some stuff. But there's some weird blocks that I had to add, like certain things to look for peak detection and... Whoa. But it's kind of getting there. If you take out all the special synchronization stuff, you get a solid image, but then you get a roll in both vertical and horizontal because the timing's not quite right. But anyway. And that's ongoing work, too. So if you've got FPV... I think someone was gonna bring an FPV thing. But anyway. It's an old-school signal. So I'll wrap it up there. Thank you very much for your attention, especially for that amount of time.