A little late. Technical difficulties and all that. HackRF, you guys hopefully have seen a little bit of. And if you haven't seen the fancy new enclosure, here's one. So, you know, there it is. And there are a few people around here who have some. And if you back HackRF on Kickstarter, it's in the mail to you already. And there's one that people can win. Wireless CTF, right? Wireless CTF, HackRF. Somebody can win one, right? Yeah, do that. So go out, go forth and win a HackRF. So this is SDR Tricks with HackRF. I've given this talk once before at Recon. It's just a short talk. And the second half of the hour is going to be Jared Boone talking about the HackRF Portapak, which is super cool. It was Tau Day at the time that I gave this talk at Recon. You know, June 28th. Everybody should know the number Tau. 6.2831853, etc. Right? Woo! Yeah, old school people call it 2 Pi. But Tau is the new hotness. Pi is old and busted. So I actually received for the first time in my life a happy Tau Day card from Dominic here. So that was pretty awesome. So this is HackRF1 without the swank case. It's an SDR peripheral that operates from 10 megahertz to 6 gigahertz officially. Unofficially is part of what I'm going to talk about today. 20 megahertz bandwidth and that's a function of the 20 mega sample per second ADC. And it's a half duplex software defined radio transceiver. It can transmit and receive but it can't do both at the same time. And so I'm talking about kind of the top level capabilities. Like the high level overview of what the capabilities are. And in this talk I'm going to talk primarily about getting around these capabilities in various ways. Sorry, getting around the limitations of these capabilities in various ways. So just a little bit of an overview of the hardware design so you can understand what I'm talking about. The architecture of HackRF. At the antenna on the left we have signals that are in the range of 10 megahertz to 6 gigahertz. Actually this slide is really old. Back when we thought we would only go down to 100 megahertz. But we keep lowering that lower spec. And there's a wideband front end that has a mixer in it that converts the frequency so it shifts the frequency from anywhere in that range that wide range into the intermediate frequency range which is the 2.3 to 2.7 gigahertz actually now it's about 2.15 to 2.75 gigahertz. But it's right in that 2 gigahertz band right around 2.5 gigahertz we have an intermediate frequency and then there's an intermediate frequency transceiver that converts between the intermediate frequency and baseband where baseband is the vicinity of 0 hertz. So we have dual conversion. We convert the frequency once between RF and IF and then we convert the frequency a second time between IF and baseband and then we have an analog to digital converter and everything is digital from there on out. On the transmit side it's the exact reverse. Same thing we go digital to analog baseband around 0 hertz and then it gets converted to the intermediate frequency and then it gets converted to the RF which is at whatever you configure it to between 10 megahertz and 6 gigahertz. So now that you're a little bit familiar with the architecture the first thing I want to show you is tapping into the baseband directly. Tapping into the analog baseband signals. So going back here what we're doing is bypassing all this radio stuff and just talking to the ADC or DAC on this analog baseband connection directly. So we put a header there. HackRF Jawbreaker if you have one of the beta units didn't have this little baseband header but HackRF1 we thought well it would be nice to add some expansion capabilities and this is one cool way to do that. So in this example I'm just plugging in two wires into the analog to digital converter so that I can use the HackRF to directly sample some external electrical signal. And for example I might use something well I might use something like a Hot Wheels radar gun. Which is one of my favorite toys. The Hot Wheels radar gun has multiple components in it and if you buy one from eBay it might be broken. But most likely the part that's broken is that board you see there with the two red controls on it. It's the control board and LCD and that's completely separate from the actual radio part. The actual radar that's within the Hot Wheels radar gun. So if you want to just use this thing for your own project you just rip that part off and connect it directly to the radar with these three leads. All you have to do is get a power supply and you get an analog baseband radar return signal that you can plug into your oscilloscope or you can plug it into your HackRF. And what we get is two channels. We have two ADCs and each one is a differential signaling with one volt peak to peak and the common mode voltage needs to be like around the middle of the supply voltage. So it's around 1.5 volts and there's no anti-aliasing filter on there so you have to kind of provide that on your own if you want. So it's a little bit tricky to interface with if you don't have much experience with electronics. It's not as easy to use as say an oscilloscope. But in this particular example I was able to directly plug in the Hot Wheels radar gun with nothing other than just some wire going from the radar gun to the HackRF baseband header. And I was able to just like wave my hand around in front of the Hot Wheels radar gun and I could see like in canoe radio exactly what I expected to see and I could measure distances or I could measure speed very easily. In addition, there's a direct to digital to analog converter so you could use the HackRF kind of as a general purpose function generator similar to how you could use it as a general purpose oscilloscope. It's again a little bit tricky to interface with because it's differential signaling and it puts out a maximum of about 800 millivolts peak to peak. And again there's no anti-aliasing filter so you would need to provide that yourself if you were going to design a circuit to connect to this. In the future it would be really cool to have, and I kind of started working on this but it's a ways off probably, it would be really cool to have a little add-on board for HackRF that kind of takes care of some of these details for you, adds the filtering adds like a differential amplifier so that you could just say for example plug in an off-the-shelf oscilloscope probe or plug in or use this thing just like you would use a bench oscilloscope or function generator kind of all in one. It wouldn't take very much circuitry. All the complicated stuff is already on HackRF on the main board. Which is what this slide is about. It would just make it a little bit easier to use. And oh, and one thing the reason I put this slide here is to remind me that you could interface with an external RF front end this way. And this is one of the most exciting possibilities for this kind of expansion whether you use this baseband expansion board that may exist in the future or whether you design your own circuit yourself to plug into the analog baseband header. One of the best uses for that maybe would be to experiment with a separate RF section. A separate radio other than the RF section of HackRF. If you just want to use HackRF to be the computer interface to your radio, this would be an excellent solution. Full duplex. Now HackRF is half duplex and but the everything actually from the USB connector through the microcontroller into the analog to digital converters and digital to analog converters is actually full duplex. So from that analog baseband header to the host computer, all of that bi-directionally, you could operate in full duplex mode in theory at reduced sample rates. And so this is an interesting option if you were to connect your own radio front end to it that you could actually use it in full duplex mode or maybe you'll just put, maybe we'd just add a second RF section like a transmit only RF section that we'd plug into the baseband header and then you could use the onboard RF section for receive or vice versa. The operating frequency of HackRF the design, at first we decided that we wanted something to work from 100MHz to 6GHz and we weren't sure if we would really meet that goal. But once we kind of got the design on the drawing board, we thought, hey, we should probably be able to do 30MHz to 6GHz. And then when we actually started testing things, it was clear that it was working pretty well down to about 10MHz. And at that point, I started experimenting with different components to see if I could enhance that low frequency behavior without affecting the high frequency performance adversely. And I've had quite a bit of success. And I haven't talked about this much yet, and I haven't figured out what I can guarantee. But a little bit of a review before we start before I show you the results. Remember that we have two different mixers that are shifting the frequency. And so the local oscillator that goes to each mixer is the amount that the frequency gets shifted. So if we wanted to tune to 6GHz in the RF, and our intermediate frequency is 2.5GHz. Well, 6GHz minus 2.5GHz, that's 3.5GHz. So we have a 3.5GHz local oscillator right there. And then we'll have a 2.5GHz local oscillator right here. Because that's shifting between 2.5GHz and 0GHz. So what affects the primary limitation on what frequencies we can tune to, is the range of frequencies that we can tune these two local oscillators. The range that we can tune this one to is only in that 2GHz band. But the range that we can tune that front-end oscillator, it's a range from like 85MHz up to, I think the data sheet, or the advertisement for the part is something like 4.somethingGHz, but it turns out you can actually configure it up to 5.4GHz. So, theoretically, we can tune this up to 2.7GHz, and we can tune that up to 5.4GHz, add those two together, and what's that, 8.1GHz? So we can configure it to tune anywhere from 0Hz to 8.1GHz. It's a really wide range. It doesn't perform well over that whole range, of course, but that's the range that it can be configured to. Now, I went ahead and tried this, and this is a plot showing the maximum, absolute maximum transmit power on the antenna port from 0 to 10MHz. So 10MHz, it's putting out about 15dBm, and that's our advertised minimum frequency. But as you can see, it works quite well way below 10MHz. More like 1MHz is kind of where it starts taking a dive. And I've used this, for example, to tune to AM radio stations, shortwave radio stations. I've literally put a long piece of wire and just stuffed the end of it into the SMA connector on a hack RF and listened to radio Havana, Cuba, shortwave radio station at 5MHz at my house in Colorado. I do live on a mountain, that's true. Although my lab is in a valley. So here's an extreme example. I wanted to see what the lowest frequency thing was that I could pick up with hack RF through the RF port. So I got a spool of wire and I just clipped to the leads and plugged that into the RF port. And... oh, shoot, I don't have a good screen shot of this. And what I did was I held it up to a low frequency RFID reader. And I was able to sniff low frequency RFID packets. So I know a lot of people were excited when I first announced that hack RF could go down to 10MHz because they said, oh, that's now 13.5MHz is in our range. We can do high frequency RFID. Well, two orders of magnitude lower in frequency is low frequency RFID tags operating at 125kHz. And that is way down by this, the bottom of the valley on the left, right? And I was actually able to pick up those RFID tags very easily. I can't show you the little demo of it because I'm short on time and my laptop isn't working. So you'll just have to take my word for it. What's that? Oh, I won't worry too much about time, but still, my laptop isn't working. So if anybody wants to see later one-on-one, I do have on my laptop like a saved waveform that I can show you a little replay of this. I just can't put it up on screen. But I was totally able to do this just by clipping in a loop of wire to my RF port, holding the loop of wire up to an RFID reader and then holding an RFID tag next to it. I got a very clean signal that I could decode in software with no problem. Now this is a receive only solution. I can't spoof a tag. I can't transmit to the reader because the way low frequency RFID works is that I would have to be able to modulate the power of the signal, the 125 kHz signal going through the coil of wire that's within the reader. And I don't have enough output power to do anything like that. If I were going to do that, I would need some kind of small external active circuit like a one transistor circuit for example to actually be able to modulate and spoof a tag. It could literally be as simple as a one transistor circuit or a one diode circuit. But I would need some kind of external circuit to actually spoof a tag. Sniffing tags though, no problem with just a loop of wire. And even though it's way down at the edge of well below the good operating range, the amount of power that I get coming in on that direct coupling with this big loop of wire held right against the reader, it's so much power that it overcomes the losses that are in the hack RF receive chain in the analog section at those very low frequencies. So I thought that was pretty exciting that I could actually do something way below 1 MHz. Now I want to show you something about operating way above 6 GHz. So the highest frequency test equipment I have in my lab is this spectrum analyzer that goes up to 7 GHz. I don't have anything that goes up to 8.1 GHz which is the highest frequency that I can tune a hack RF to or I can configure it to, but I can at least show you things up to 7 GHz. So the yellow line, just look at the yellow trace for a little bit, that's showing the maximum output power that I'm getting directly out of the RF port from hack RF tuned to 4 GHz to 7 GHz. So 4 at the left side to 7 on the right. And this is the maximum output power in DBM. Now this little marker here, right there, that's 6 GHz. So that's the edge of the advertised operating frequency range. As you can see, as you go up in frequency, overall the performance declines. There's a little bit of a hump around 5.5 GHz, like it gets a little better in the 5 GHz band and then a little worse. And then just a little bit above 6 GHz, it starts dropping precipitously. And our output power up at 7 GHz is barely measurable with the way I have this spectrum analyzer configured. So it's not really useful up here. But it certainly could be useful in the low 6 GHz band, above 6 GHz. Now, then I did this again configuring the HackRF in a completely different way. And that's how I got this blue trace. What I did was I configured, I basically bypassed the entire front end mixer. And I sent the intermediate frequency right out directly through the front end amplifier to the antenna. And this is a normal configuration. This is how we tune to things like around 2.4 GHz, 2.5 GHz. That's how we normally tune to things in that 2 GHz band. The intermediate frequency band is by bypassing the front end mixer. So I bypass the front end mixer and then I look at the output power maximum output power. I'm really maxing it out as much as I can. But I'm looking at the output power as I sweep the intermediate frequency from 2.15 to 2.75 GHz. I sweep that frequency and then I got this blue line in the 4 to 7 GHz band. So why do we have these big peaks in this region from here to here and then from this region from here off beyond my measured frequency range? It's because they are harmonics of the intermediate frequency. So this range right here is twice the intermediate frequency. 2.15 times 2 is 4.25 GHz and that's where this blue region starts here. And then three times that starts here. So this is the second harmonic and the third harmonic. Now notice that especially way up here around 6.5 to 7 GHz, this actually allows us to get much more output power than we are able to by properly using the wideband front end and configuring it to operate like the way you would expect up here. The question is am I still dumping tons of power out at 2.4 GHz? Absolutely, I certainly am. But by exploiting the harmonics, and if you were going to do this in real life, you would use a filter. You can take an off-the-shelf external filter that you can plug in between the hack RF and antenna. You could actually operate at 7 GHz by filtering out everything below that would include all that power you are putting out in the 2 GHz band. It's a pretty dirty trick, but it's something that can be done. And it's actually not too uncommon a trick for people who typically build equipment or use equipment in the many GHz. So, one thing to note is that the frequency response is extremely non-flat of this blue curve, especially note that gigantic peak around 4.9 GHz. The reason that it is so non-flat is because I am actually over-driving the front-end amplifier. And so, it's just like over-driving a guitar amplifier and getting that distortion. That distortion increases the harmonics that you get. So that when we look at the harmonics, if we are over-driving that front-end amplifier, we are able to get some extra peaks in those harmonics at certain frequencies where things just over-drive the amplifier a little bit more. So that's why we get a really good peak around 4.9 or 5 GHz. And that's probably why this is increasing and not decreasing in this region below 7 GHz. So what this does from 7 to 8.1, I don't know, but what I would expect is that the yellow curve drops off and becomes totally unusable if it's not already. And that the blue curve probably goes up and down a little bit and eventually maybe traces something similar to this curve, but less so. So that's kind of a dirty trick you can use to do some fun things at very high frequencies. And one other thing I wanted to note, I talked a little bit about kind of overcoming the limitations of the operating frequency range. I talked about overcoming the limitations of half-duplex if you use that baseband header. But another thing I want to note is that theoretically you could overcome limitations of the sample rate. We have a sampler that is specced to run up to 22 MS per second, but we always figured it was wishful thinking that we'd just barely get up to 20 MHz or 20 MS per second on our USB interface. So as it turns out, at least on some USB host controllers we can actually exceed that. Like on my laptop I can reliably run at a maximum sample rate of 21.5 MS per second. So just a little bit higher than 20 million samples per second. Which is 43 MB per second going over USB. That's a lot to go over high speed USB. I've actually never seen any other USB device go that fast. Except for super speed USB devices of course. And additionally if you were to do processing on the ARM instead of on the host computer and not worry about the limitation of USB, you might even be able to go a little bit faster. And if you want to learn about running code on the ARM, stick around for the next half hour to listen to Jared. And there is a little, there is some header there's an extra header that you can install on HackRF1 that gives you direct access to pins on the CPLD which is just some little logic glue between the ARM and the ADCDAC. So you could completely bypass the ARM and stream your samples in and out of those CPLD pins like if you had an external FPGA board or something like that. And you might even be able to get a little bit more sample rate out that way. The ADCDAC chip is spec to run at 22 million samples per second. But I believe it can be overclocked in many cases. And it can also be replaced with a pin compatible replacement chip that runs up to I think 40 mega samples or 60 mega samples. I'm pretty sure it's just the same chip that they just bin. And so the ones that they sell as 22 mega samples maybe didn't test as very well at 40. But they probably operate somewhat faster than 22 in most cases or can. And additionally there's an analog baseband filter in the intermediate frequency transceiver that can be configured to a maximum of about 30 megahertz. So that's kind of the limiting factor at that point if you kind of use those tricks to bypass USB and bypass the arm and at the extreme actually replace that ADCDAC chip with a faster one. Your limiting factor would be that baseband filter that gets you up to about 30 megahertz instead of 20 megahertz. And that's SDR tricks with HackRF. Thanks for listening. And I hope you'll stick around to hear Jared talk about the HackRF PortaPak. Thank you.