 Brilliant, thank very much and thank everyone for coming. I can only apologise for being late and on the wrong stage, that was entirely my fault. You must not hold the organizers responsible for that at all. What I could talk to you about today is hacking the spectrum. What I mean by that is how radios being a hardware thing is transitioning into radios being a software thing. I'll talk a bit about the hardware changes that that involves. What that means. I'm going to talk about how to write the software for radios. And scarily, for me, I'm actually going to code a radio live on stage in front of you this afternoon. So what could go wrong? I think nothing could possibly go wrong. And finally, I'm going to talk a little bit. I haven't done it yet. Perhaps clap afterwards. Finally, I'm going to talk about what you can do with it. yma tyn nhw'n ei wneud? Dw i ddweud, dyfodol. Rwy'n gweithio i'r ddweud y dyfodol. Mae'r word yn cyfrifiad penderfyn. Penthaf y gallwn gweithio i'w ddweud y byd, ac mae'n gweithio i'r ddweud y byd. Dyfodol yw y Llatyn Rwt, sy'n gweithio ten. Mae'r Llatyn Rwt er mwyn i'r ddweud. Mae'n gweithio i'r ddweud. Mae'r ddweud ychydig ddwych yn rhoi'r ddweud. Yn y gweithio geniwyr ein lleion, Dydw i'r ddechrau 10 o'r ffordd o'r llawd ac y pethau'r llawd llefydd yn y rhan o'r 9 ymddiol. Felly mae'n hyn yn cael ei ddefnyddio, mae'n hynny yn ymwysig oherwydd eu llawd. Felly mae'n hyn o'n ffwrdd, mae'n hynny'n eich llawd fel William Hogarth, mae'n hynny'n eich llawd. Mae'n 1725 ymddir i'r llawd Romaniol Fyrwyr, ..ygwedd, ond ond yn gwleid i'r gael gydeithas ac yn rhan oedd mae'n gwneud lotת. Ond oedd yn ddefnyddio'r cyntaf, mae'r cyntaf eistedd o'r cyfnod gydaf, bydd y bydd yn oed fel bod yn gweithio a'r propoesion, felly o'r wnaeth eich cymryd yn y gweithio. Rhyw g processed, oherwydd教odd o bobl yma o defnyddio Rhaim Paenigol. O'r rhaim, mae'n gweithio'r grwpio heb, ac e'w gweithio'rnyn gweithio hyn, ceisio eich grwpio. Mae'r rhai gafodd mwneud o'r hollig, mae rhai erioedden nhw erioedd yn 1970, mae rheoli'r hollig yn ei uloedd yn fwylau. Mae rhai gafodd mwneudio'n bywys iawn, mae'r hollig yn ei ddweud gyda'r ysgrifedd. Mae'r hollig o'r awr o'r 100 ym ten, sy'n swyddiadau eraill yn 1895. Mae'n flio'n dyn nhw. Mae'r hollig o'r oedden nhw. Mae geniwhaeth o ffordd o gweithio argynod a ymddangodau a leotronu codesol. Mae'r gweithio bryddoedd, yn ydych chi'n mynd i gweithio. Rydyn ni'n fawr i'r ffordd o gweithio a hynny'n dweud i'r ffordd o'r gweithio. Mae'r dweud i'r gweithio ar gyfer o bryd agnoddol. Mae'r ddweud i'r leotronu, a gweithio ar gyfer, yn ymddangoddol i'r ddiweddau, yn ymddangoddol i'r ddwyf, ac yn ddwyllwch ar y cyfnod, a fyddwch yn cyd-dwyllwch ar y ddwyllwch arall. Felly, mae'n ddwyllwch amgylchedd. Felly, mae'n ddwyllwch ar hyn o gwyllwch ar hyn o'r cyfnod. Felly, mae'n ddwyllwch ar ddwyllwch ar hyn o'r cyfnod, ac mae'n ffrif erbyn sy'n gwneud. Mae'n byw i ddweud eich bod yn ei ddwyllwch yn cyfnod. Felly, mae'n grwyngwch rydyn ni'n gynhyrchol i wneud â'r cyfnod. Rwyf yn ddechrau, mae'n rhaid i ddaeth ei ddweudio radio ganoedd yr acronym SDR. Mae'r rhaid i gynnwys i ddweudio bod yn ddod o'r ddwyliadau'n gwybod gyda'r ymlaen, ac mae'n ddweudio bod yn dda! Rhyw hwn. Yn ymlaen i ddweudio'r gweithio'r cyfrifoedd gyda'r cyfrifioedd ymlaen i ddweudio'r cyfrifioedd, maen nhw'n ddweudio'r gweithio'r pŵs yma i'r llymau sydd gyda'r ysgrifennu. Yn ymwneud, ychydig i eich 80 MHz, Mae yna gwahanol iawn yn ystod ar y antena. Mae'n ddigitwadau eu bod yn ysgol fyddeithas cyfnodol yn cyd-cyflwynt a'r bydd ymwneud yn ymwneud mae'r ddweud yn rhan o'r ddweud o ddweud. Ond mae'n ddweud a'r ddweud dda i'r FPGA. Mae'n ddweud i gwaith bach That pairs it down to a smaller amount, the amount we're actually interested in. That all happens under the control of a microprocessor. Then it's simply fed out of a USB socket. All of the signal processing is done in software by a host computer. Hence software defined radio rather than the hardware doing the defining of what the radio is all about. Felly, rydyn ni'n ddweud, ac rydyn ni'n ddweud i chi, yng Nghymru o Miles Davis. Felly, rydyn ni'n ddweud i chi, rydyn ni'n ddweud i chi, yng Nghymru. Felly, mae'r storid yn dda'r hyn, ffortunatel. Rydyn ni'n ddweud i chi'n ddweud i 2008. Fy hoffi'r TV digital wedi bod yn rhan. Fyddai'n gweithio i chi, rydyn ni'n ddweud i chi'n gweithio. Rydyn ni'n ddweud i chi'n ddweud i chi'n ddweud. Mae'r hyn sy'n ddweud i'r cyffreithion gweithio i gweithio i gael ei gweithio i gael eich cyffreith digital i gael sefydliadau tejfnodol. Mae'r deudydd gwrs rydyn ni'n gweld crys'n ddweud i gael sefydliadau Twitter i gael ei sefydliadau. Roedd hyn wedi'n gweithio i'r tŷ, i gael eich ddweud i chi ar y cyflogau neu i chi, i gael eich cyflogau cyflogau. Rydyn ni'n gweithio i chi, prawnol, i'r cyflogau. The RTL 2932U, it's an all-in-one digital TV tuner, it's actually a brilliant piece of design years ahead of it's time, combines tons and tons of functionality on a relatively small piece of silicon. Needs very few other components in order to function, it's basically a system on a chip and it also has a USB port on it, so you can pretty much plug your satellite dish in one side, the USB socket in the other and learn behold, with the correct driver, all of your TV pictures would appear inside your computer. As you can imagine, given how far ahead of it's time it was in 2008, they were hugely popular and launched a rash of laptop TV dongles that you may well remember. The chips sold in there, millions and millions, the cost fell virtually to zero and it was integrated in all kinds of TV equipment, but as I say, it launched a flood of £10 or so USB TV dongles that you can still buy to this day. The next player in the story, Osmocom, I don't know if that's a name you've heard of, Osmocom are a very very interesting group of people. Their USP is to develop open source versions of the conspicuously closed source, suspiciously closed source, mobile phone network infrastructure, so they've written a suite of software that replaces all this dodgy stuff with back doors to foreign governments and allegedly and there is really no need now for governments to buy this kind of equipment manufactured by foreign governments. There's absolutely no need to take a risk. The Osmocom stuff has all been verified and is available for inspection to whoever cares. However, that's a political point. Having cracked, so GSM is what mobile phones, the protocol that mobile phones use, having cracked GSM, which they have, they then moved on to DECT. DECT is the digital system that digital cordless phones run on, a proprietary closed system for no real reason. They reverse engineered it and produced a suite of software to work interactively so your equipment could work with the digital mobile phones. Having conquered DECT, they moved on to Tetra. Tetra is one of the systems that digital walkie talkies use, especially those used by the police, the fire service, those kind of things. They produced a suite of software, they reverse engineered Tetra, produced a suite of software to interact so you could join in the Tetra revolution for your armchair. Having done that, they moved on to Iridium and that's where they are now. They are reverse engineering the Iridium satellite network and aim to produce a suite of software so you can join in the satellite revolution and use the Iridium network from the comfort of your armchair. Osbycom, as I say, is a very interesting group of people, you should get them to give a talk here. These three people in particular looked at the 2932 as part of their deliberations doing something or other and wondering if they could use it somehow because it was so cheap and so powerful they could use it in one of their systems. By a really extraordinary piece of reverse engineering, which is really what they're good at, they discovered that you could stick the 2932 into an undocumented test mode. Isn't that great when they bury these undocumented test modes in things? You could switch off all the digital TV stuff and just leave on the software defined radio bit and the USB bit and beam the digital radio signals straight into your computer. Steve Markraff wrote a driver to do exactly this and it has to be said, it turned the world of radio upside down. Now the world of radio is a small world so you may not have noticed it turning upside down but to turn upside down it absolutely did and because the technology that previously cost thousands of pounds could now be yours for a tenor. And just to say I've got a couple here to give away at the end if anybody fancies having a go at this, come and see me afterwards and I'll give you one of these dongles. So there are now literally thousands of these kind of dongles on the market. This is typical, it's one I found on eBay that I bought and I'm going to give to a lucky recipient. As you can see it's got the black USB stick, it's got a little antenna that comes with it. It's got a CD rather charmingly, which has got the software on CD, I remember CDs and it's also got a little keypad. God knows what that is and I've absolutely no intention of installing the software to find out. It has to be said for a tenor you get a device with some limitations, fine for tinkering but doing anything serious you'll bump up against those limitations. So the next generation up is this kind of thing, this is from a very trusted company called RTLSDR.com. They have redesigned it using a later generation of chips, many of the limitations of the ten pound device are missing. This is £30, so you get pretty much a pro device for £30. A word of warning, on the internet, on the eBay especially there are tons of counterfeit versions of this. Don't buy this from eBay, if you're going to buy it, buy it direct from their website or buy it from a shop, Mouser or something like that. And the top of the range for £200 you could get something like this. This is completely redesigned, if you want to do a PhD in software-defined radio you should buy this as well as having none of the limitations of the other two devices it also has a transmitter in. Though you'll need a licence to use the transmitter or off-con will come and drag you out of your door and lock you up. But that's an absolutely superb device, as I say, PhD level, £200 for a PhD, in America they pay £500 for a PhD class. So there we are. So you're wondering now, now that you know all about the hardware, what on earth can it do? Well if you just want to tinker, there's a ton of free and open source software out there to enable you to do exactly that. The best I think is this, SDR Sharp, as in SDR Hash, by a company called Air Spy, they give it away and they'll sell you a dongle that it runs very well on but it'll run on any dongles. And this is a pro grey piece of gear, this used to cost you £10,000 and you can have it for nothing and it's absolutely brilliant. If you just want to explore the radio spectrum and find out what's going on, I'd suggest you download this. If however like me you want to interact with your hardware a bit more, you will need this, new radio. For hackers it's far more interesting as you may or may not know, depending on how old you are, the GNU stuff is written by the Free Software Foundation, originally set up to write an open source version of Unix, which at the time was incredibly expensive and proprietary, it's still proprietary but not very expensive. And the Linux kernel started up at opportune time because their own kernel, GNU Herd, was dying the death. So they kind of unofficially joined forces with Linux. And in the early days of Linux it was called GNU Linux, but we seem to have dropped the GNU part now, but pretty much anything that isn't the kernel is GNU. And GNU Radio is effectively a software development kit for any kind of radio project you can imagine. Anything you can dream up, they've probably got some software to help you with. Now, Ocavia, we're saying that writing radio software is a difficult thing to do, even with GNU Radio, writing software, radio software from scratch is a difficult thing to do. But luckily part of GNU Radio is the GNU, charmingly called GNU Radio Companion, which is not GNU Radio in you having a fireside chat and a cold wintry night. But I shall show you exactly what it is, if you'll just allow me to come out of here. So GNU Radio installs best on Windows or Linux. Don't try and install it on Mac because you'll end up with no hair and you still won't have a working GNU Radio installation. So I've installed it here on Windows. When it's all installed, it's relatively easy to do though it takes quite a long time. You end up with a GNU Radio command prompt with all the correct environment variables set and that kind of thing. You run GNU Radio Companion like this. It's in Python. Yep, like that. This isn't going very well. GNU Radio Companion. No, we got there in the end. There's a bit of scrolling at the start. There's always a bit of scrolling with open source stuff. You can't get away from it. And this is the basic GNU Radio screen. This is the program area. And you write programs by connecting these blocks together. On the right hand side of the screen you can see a menu of all the various kinds of blocks you can get. These are in folders by function. Bottom left hand corner is the message area where GNU Radio tells you what it's doing. And then here is about setting debug breakpoints and all that kind of stuff. But we won't be doing anything complicated enough to require that. Any box that has a red title means there's some kind of error. What it's trying to tell me at the moment is that I haven't saved it yet. So I'm going to go and save it. Let's call it. Now, anybody who knows anything at all about programming languages will know the first thing you write in any program language is a Hello World application, which normally prints Hello World on the screen. Hello World of Radio is a FM radio, which is the easiest kind of radio to make. So I'm going to, in front of your very eyes, ladies and gentlemen, make an FM radio. I'm going to call it Hello World. There we are. It already exists. Well, not now it doesn't. So you set the parameters in these blocks by double-clicking on the blocks. There we are. We'll just right-click and select properties. It's set the ID to the name of the program. All of this other stuff I won't need to set here. The thing to note is that when you've got your working program... Oh, my God. Hang on, let's start again. I think it's actually run it. When you've got your working program, you can export it in either a Python or a C++ program, which you can then compile or do whatever you want and distribute. So you end up with something that you can then hack and rewrite your interface to. OK, save it again. I know we're fine. OK. So the first thing I'm going to do is this aid to a variable in GNU radio. You have a block. It's called a variable. The sample rate is the sample rate of samples coming in from the USB stick to the computer. I'm going to change that to 2 MHz. So that's 2 E6. We use scientific notation in this program. Then you can see the variable is set to 2 MHz. This is the complicated bit, so I'm going to refer to my notes, ladies and gentlemen. So the first thing I'm going to do is show you how to... We need a tuning slider in order to tune this radio. So they are in GUI widgets. QT is the library-touture, and it's called a QT range. A range is what they call a slider. The ID is the variable name. That's a bit of a mouthful, so I'm going to call it freak for frequency. Default value is what it's going to start up at. I'm going to pick a random number, 93.3 E6 MHz. We're going to look for a radio station in the FM broadcast band. That broadcast band goes from 87 MHz to 107 MHz. This is the slider step. 100 KHz seems to work quite well, and that's it. So there's my tuning slider. Next I need to get some information into the computer from the... What's that? Oh, it is. Thank God you spotted that. 103. Thank you. So getting some information into the computer. We use this block here. RTLSDR source. Things to set here are the frequency. We've got a variable for that, and I'm going to type in freak. And I'm going to add a little bit of amplification just so as we can hear it. So that's the RF gain to 100 rather than 10. It's red because there's an error. There's an error because it's not connected to anything. So I'm going to connect it to a display, which is going to show us that everything's working correctly. Please God. This is the display we use. Phosphor sync. I connect the two. I have to change the frequency to freak. And now if I run it, I sincerely hope that what we shall see is a display showing us the frequency spectrum reassuring this that I've connected everything correctly. There's a little bit of compilation going on here. There's the slider. Right. And there is the display. So if I move this along, you can see various bits of the frequency spectrum. So that gives me some confidence that we're in the right place, we're in the right ballpark. OK. I'll put this to one side. I need three blocks now to make a radio. The first block is I need something to demodulate the FM signal. Demodulators are in modulators because nothing's ever not confusing. The one I want is wideband FM receive. I'm going to connect the input to that. Sample rate is called quadrature rate in demodulators. Come and ask me why if you care. So I'm going to change that to sample rate. Here is decimation. It's asking me if I want to reduce the sample rate. I do, but not yet. So I'm going to put that to one. Again, there's an error because that output isn't connected to anything. That output is orange which is telling me it's now a float output. Oh, my God. Five minutes. Right, a bit of up the pace. So now I need to change the sample rate. I'm going to do that by putting a resample block on. Rational resampler, not because I'm going to invite it around for lunch, but because it's a ratio. So to get from 20 megahertz to 48 kilohertz, which is what I want, I need to multiply by three and divide by 125. So interpolation three, decimation 125. So I'm throwing away 125 out of 126. Finally, I need to squirt it out of the sound card in the computer. I'm going to use an audio sync for that. I'm simply going to connect this to that. I'm going to change the sample rate. It's helpfully given me sample rate, but that's an insane suggestion. It's 48 kilohertz. Right, all the red is gone. You and I both know that there's actually nothing could go wrong here, so I'm simply going to save it and I'm going to run and let's see what happens. It's compiling. Can you bear the suspense? I know I'm struggling. Now, why am I getting no audio out? It may be because the HDMI might not be configured on this board. If I see audio coming from you, I will gladly turn up that channel. OK, sound settings. Choose where to play sound. I'll tell you what. It's coming out of here. It's coming out of the speaker here now. I'll simply point. This might be fine. Let's tune something in. Thank God for that. The soothing power of music. OK, so to wrap up a blistering pace. What can you do with all of this stuff? Well, here are several ideas, and if I had more time, I would demonstrate them to you. You can listen to the arches anywhere in the world, and that's because the BBC transmitted this broadcast on, which is on 198 kilohertz. The long wave broadcast is a whopping 500 megawatts. No, sorry, 500 kilowatts, nearly a megawatt, 500 megawatts, that would be quite something. Having that reach is quite useful as the government noticed something you can hear everywhere in the world as other uses than listening to the arches on, so the government have buried inside that signal, a data signal. It's not secret, but people don't really talk about it. It's encoded using an encoding technique called PSK. There are blocks in GNU radio to decode it. Why not have a listen, have a look, find out what that is and what it's for. Weather satellites, there are a ton of weather satellites either in geostationary orbit or in low earth orbit, and we have blocks in GNU radio to decode the images, and in fact GNU radio runs on a Raspberry Pi and those kind of embedded devices, you could make a little embedded device running GNU radio to download satellite images and beep them to your telly when you're watching anything else. For this, this is a radio antenna for a radio astronomy antenna. You can go to opensource telescopes.org, get the plans to build something like this, plug it into your computer, and GNU radio contains all the software you need to run it and actively contribute to finding out the origins of the universe using radio astronomy. I said in the beginning of my talk, it's surprising what you can do. I think it's surprising because pretty much everything's got a radio in these days, and all the information is simply floating around in the air ready to be plucked and limited only by your imagination, and as you only need to be a software person now, not a hardware person to make radios, there's no excuse for any of us not doing that. That is the end of my talk. Does anybody have any questions? Questions outside. If you do, or if you want a dongle, come and see me outside. I'll be standing over there.