start	end	text
3400	10900	Is this thing on? Are you sure? I don't know why I keep having to give everybody intros,
10900	14520	but hi, my name is Zero Chaos. Welcome very much to the Wireless Village. I'm so happy
14520	21400	to have you here. This man has designed something that appears to be an EKG or what's that thing
21400	26160	in Ghostbusters? He's got one of those things from Ghostbusters. Did you just throw a throwing
26160	34960	star at me? I'm keeping this. Anyway, he designed a Game Boy that I've always wanted,
34960	39720	so here he is to talk about the brand new replacement for your iPod, Jared Boone.
41160	49460	Howdy. So yeah, my name is Jared Boone. I've been doing open source hardware for a couple
49460	55600	of years, three years now, working with Mike Osman on the HackRF design. And I want to
55600	60540	talk today about, you still can't hear me? Okay. I don't want to sound like a skinny
60540	76760	puppy here. So, yeah, so you totally blew my, so yeah, I got this kind of crazy idea
76760	83100	that being able to work with the HackRF without a computer might be a cool thing to be able
83100	88900	to do. So I set about actually figuring that out. This is how you normally use a HackRF,
88900	95420	you know, plugged into a laptop, either writing code or running GNU radio, creating flow graphs
95420	100740	and running them, capturing data. And that's all cool. In fact, this is really the right
100740	106520	way to do things most of the time. But sometimes you need to get out and about and look for
106520	110860	interesting targets or get close to them if you can't bring them into your lab or into
110860	117840	your office or whatever. And that's pretty much what the PortaPak is all about. So let
117840	122500	me show you quickly what the architecture of the PortaPak is like. We got the HackRF
123680	130140	board, you know, this is a HackRF one. And on top of it, I created a board that attaches
130140	136180	to the headers that Mike was talking about that adds micro SD card, real time clock,
136180	142080	battery backup so it can maintain calendar time. An audio interface so you can plug in
142080	149100	like an Android or iOS headset and have headphones and a microphone. So if you wanted to transmit
149100	156160	audio for some reason, you could do that. A 240 by 320 RGB LCD. It's only 2.4 inches
156160	163040	large but seems to work out pretty well. Resistive touch screen. So you'd be able to go and key
163040	168600	in information or maybe slide spectrum back and forth when I write the code or when somebody
168600	174220	else helps me write the code. And then a bunch of mechanical controls. So you've got a four
174220	178000	way navigation switch so you can move up, down, left, right. And then there's a nice
178000	181920	ring control which allows you to jog left and right which is great for tuning or turning
181920	185540	the volume up and down. And then a select button that I still haven't figured out what
185540	191100	to do with yet. But, you know, the user interface is still evolving. There's a CPLD, a really
191100	196500	small one, a Max 5 from Altera which ties all this stuff together. So don't get your
196500	199700	hopes up that you might be able to do some signal processing inside the CPLD. There's
199700	206940	not much there. Just basically glue logic. So let's step back for a second and think
206940	212640	about what we have to deal with if we're not going to work with a PC. Here are your typical
212640	219380	specs for a laptop or desktop PC nowadays. And here is the performance characteristics
219380	224320	of the processor in the HackRF. You can see we're talking, you know, a couple orders of
224320	230820	magnitude difference in a lot of cases. So, but, you know, the reason why is you can buy
231420	237060	this ARM processor for 5 bucks and, you know, produce a really inexpensive software defined
237060	244800	radio. And you can also power it off of USB because it doesn't suck 50 watts. So in essence
244800	251480	we're going back to 1996. Although actually a Pentium Pro I think is even faster than
251480	258800	this ARM by just a little bit. So I was going to try and delve into some of the signal processing
258800	265560	tricks that I did with the PortaPak in order to get it to demodulate AM and FM radio and
265560	271180	tire pressure monitors, my personal favorite thing to mess with. But I realized there's
271180	274480	no way I'm going to be able to do it in 20 or 30 minutes. So I'm just going to brush
274480	279840	over some stuff really quickly and talk about how when developing code for this thing you've
279840	284940	got a lot of interesting constraints you haven't had to deal with before in a desktop platform.
284940	289580	To start with, the processor's got two cores, which is actually kind of cool, but they're
289580	296520	not both really fast Cortex M4 processors. One's an M0. It doesn't have any DSP capability
296520	300560	to speak of. It's just not very well suited for doing all the signal processing you might
300560	306140	want to do for software radio. And then we've got four different very small chunks of RAM.
306140	314180	I think the top one's maybe 64K and then there's like a 20K block and 16K here. Not very much
314180	319340	RAM. But the nice thing is they're completely distinct and they're all hooked together through
319480	324880	a bus matrix. So if the M4 wants to run code out of this RAM block, it does not interfere
324880	330540	with the M0 running code out of another RAM block. Most importantly, it also doesn't interfere
330540	336500	with the baseband data coming from the radio portion of the design getting into or coming
336500	340760	out of another block of RAM. So you can have all this stuff going on simultaneously and
340760	346880	not have to worry much about contention for RAM resources. So this is how it wound up
346880	356740	working out. The Cortex M4 on the HackerRef does have hardware floating point, but it
356740	363060	turns out it isn't much of an advantage when you're doing signal processing. The HackerRef
363060	368720	works with 8-bit samples, so we're talking pretty low signal-to-noise ratio compared
368720	374660	to floating point. Floating point is overkill from a numerical representation standpoint.
374660	378280	It just makes life a lot easier when you're doing signal processing to not have to worry
378280	386000	about overflowing your number space or winding up not having enough signal dynamic range
386000	390860	to retain a signal as you're processing it. So floating point is great, it's just that
390860	395940	in this case, doing integer arithmetic on these small samples we're dealing with is
395940	402580	quite a bit faster because the M4 has vector integer instructions. And so I wound up writing
402740	409860	a lot of integer code. And to do that, basically you have to use fixed point arithmetic where
409860	415200	instead of letting the floating point hardware manage where the decimal point is when you
415200	419500	multiply two numbers together, you have to keep track of it yourself. So you can see
419500	425580	here if we're just multiplying integers, the obvious thing happens. If you're using fixed
425580	430920	point arithmetic, you just sort of mentally decide in your code where you want that decimal
430920	437040	point to exist, and you create fractions out of the number of bits that wind up being to
437040	443800	the right of the decimal point. Here are some of the typical signal processing tasks you
443800	448280	might do in a radio receiver. And I'm going to brush through this really quickly so that
448280	453880	I can get on to the demo. Basically, as you receive a signal, you want to be able to go
453880	461480	and shift the signal of interest down to around zero hertz. Long story short, you can have
461480	466820	negative frequencies if you use complex number system, and being able to translate things
466820	472120	around zero allows you to simplify later steps in the process, including filtering.
473260	477260	So it looks kind of like this. You know, you've got a spectrum of some signal you're after,
477260	483000	and then you perform a translation operation and shift it down to the center frequency.
483680	487560	And ordinarily, you would create some sort of an oscillator, a complex oscillator that
487560	492760	would generate outputs in the form of a cosine and sine wave, and you would multiply it with
492760	497060	your input signal, and you would get an output signal. But as I mentioned, the hardware floating
497060	504140	point on this processor is okay, and doing cosine and sine, not okay. There is no hardware
504140	509240	sine and cosine function, so you'd have to do a lookup table or something else. But it
509240	515820	turns out, if you want to translate by a very specific amount, typically one quarter of
515820	520340	your sampling frequency, you can pull a very simple trick, turning all those multiplications
520340	527100	of complex numbers into simple additions and subtractions. And I won't go too deep
527100	531260	into this, but there are a lot of interesting signal processing techniques you can bring
531260	537520	to bear when you're doing signal processing in a very constrained manner. Filtering is
537520	542840	the same way. If you want to filter a signal so you remove all of the noise that is not
542840	549140	your intended signal, you use an FIR filter. And that basically involves taking data and
549140	553380	shifting it through an array, while you multiply all of the elements of the array by coefficients
553380	558860	that represent the filter characteristic that you intend, and then adding up the results.
559160	563060	But if you combine that with a decimation step, which I certainly need to do because
563060	569960	I can't deal with 20 megasamples a second on an ARM processor, you can combine steps
569960	576380	of filtering and decimation, and in the process, cut your work in half or even a quarter by
576380	583920	eliminating certain steps in the FIR filter. And then I was going to explain a few other
583920	595900	things, and it's nine minutes until the end, so I'm going to demo stuff. Post-it note.
596820	605400	Hey! All right. I don't know how closely this thing focuses, but hopefully you can see here.
605400	616200	Terrible. Oh, okay. Not great. Yeah, or something. I'm mostly getting glare off the screen, so
616200	628900	that may just be solved by turning it down. Okay. Anyone getting sick yet? Okay. This
628900	636940	is not great. Okay. So if you can look really carefully on the display, on the screen, you
636960	641100	can see on the display, we've got the real-time clock showing up, we've got a tuning frequency
641100	647260	which we can control by turning the knob here left and right, navigate around to different
647260	652180	fields by just clicking, you know, the arrow keys, and right now it's doing a spectrum
652180	659000	analysis of about 8 megahertz worth of bandwidth in the cellular region. 850 megahertz roughly.
659460	663400	I can switch it over, and this will also be an interesting demo if I can actually get
663400	672700	it to work. I'm going to shift down to just say FM radio band. And we'll maybe listen
672700	693060	to some good tunes. Let's see. Wide band FM. I don't think I'm tuned on frequency yet here.
694480	721340	It could be. Yeah, so at this point it will do narrow band AM, so like aviation radio.
722280	728880	Actually that's about the only people who use AM anymore, right? Well, yeah, aviation
728880	734260	radio, that's like everything else they've got with the frequency modulation bandwagon.
734360	738600	So narrow band FM, so you could listen to all of the various walkie-talkies running
738600	747220	around here. You can FM demodulate pager signals. Then you have to actually go and decode the
747220	753280	baseband data, the modulation of the data. It will do wide band FM as we just heard,
753280	757560	and then I, just as a proof of concept that you can do digital modes as well, I coded
757560	765160	up some tire pressure monitor decoding. So I was out with Skyler, the 14-year-old kid,
765160	770980	out on the main drag here last night with the Portapak, and we were watching packets
770980	777940	coming off of people's wheels. That was a lot of fun. If anyone wants to hang out, play
777940	783380	in the street, I'm happy to walk out there and do it. So yeah, that's pretty much it.
783380	788160	I think maybe I've even managed to get us back on time here. And any questions?
792520	799920	Oh, yeah, that's not a very good sight. Where's my post-it note? Oh, I've lost it. My security
799920	808500	device. That solves it. All right. Any questions? Yes, go ahead.
809840	816800	Can you buy one and how much will it cost? I am working with a gentleman I know in my
816800	823640	city who is an assembler who wants to help me build the first round of these. And if
823640	830120	all goes well, these should be out in a month. I am a little concerned that with the amount
830120	836240	of interest I've seen so far, that they may not be around for long. But I do have, my
836240	840740	intent is to sell through retailers. So I've talked with a couple of the retailers that
840740	846720	you would find out in the main vendor area. And they should be carrying them and maybe
846720	855100	even pre-ordering them. We still have to work out the details. I'm trying to keep the price
855100	859180	in like the 100, 120 range, but we'll see how it actually works out once my assembler
859180	872260	sends me a quote. In my experience, the compiler does not help all that much with vectorization.
872260	877060	And it may just be that I'm not writing code that it sees as being vectorizable. I know
877060	884060	that there are some C tricks around trying to tell the compiler that there are no potential
884920	890100	overlaps in pointers, so that it can make some assumptions about the pointers not having
890100	896300	any overlap. But I just drop straight to assembly because I know exactly what instructions
896300	901360	I want to use. And moreover, there's no way to express in C like the ability to go and
901360	905080	say, I want to do saturating arithmetic. Where when you multiply these two numbers together
905080	909560	and they're too big for the resulting data type, that they saturate to a positive and
909560	915920	negative extreme. So it is kind of nice to just drop into assembly at that point. Other
915920	928420	questions? Yes? Oh yeah. So, silly me. If you don't mind me roodling in my bag for five
928420	942880	seconds. This book made the port-a-pack possible. There is a chapter 13, which is about a third
942880	948240	of the book, which describes practically all the signal processing tricks I use to get
948240	953400	speed out of the ARM processor. It's called, Understanding Digital Signal Processing and
953400	960260	it's by Richard Lyons. It's now in its third edition and I think it's $90 retail, obviously
960260	966940	cheaper at Amazon. So if any of you guys are looking to do some tight SDR coding, get the
966940	980740	book. Yes? It's pretty high. I did have a bug where I had my CPU clock rate set wrong
980760	985200	and so the statistics I recall off the top of my head are probably incorrect because
985620	989340	I only noticed the stats before I fixed the clock issue. But I feel like it's probably
989340	995020	in the 70 or 80 range, 80% range. Now that said, I haven't spent a lot of time optimizing
995020	999800	that stuff. So I've got like an arc tangent function which does the FMD mod and I think
999800	1006360	it could be significantly faster. And that's where a lot of the cycles are going. Anyone
1006360	1006780	else?
