WEBVTT

00:03.400 --> 00:05.000
Is this thing on?

00:06.740 --> 00:07.740
Are you sure?

00:08.500 --> 00:12.120
I don't know why I keep having to give everybody intros, but hi, my name is Zero Chaos.

00:12.120 --> 00:13.840
Welcome very much to the Wireless Village.

00:13.840 --> 00:15.380
I'm so happy to have you here.

00:15.640 --> 00:22.400
This man has designed something that appears to be an EKG or what's that thing in Ghostbusters?

00:22.540 --> 00:24.880
He's got one of those things from Ghostbusters.

00:25.180 --> 00:27.120
Did you just throw a throwing star at me?

00:29.380 --> 00:30.960
I'm keeping this.

00:31.840 --> 00:39.720
Anyway, he designed a Game Boy that I've always wanted, so here he is to talk about the brand new replacement for your iPod, Jared Boone.

00:41.160 --> 00:42.120
Howdy.

00:44.820 --> 00:46.660
So yeah, my name is Jared Boone.

00:46.840 --> 00:54.380
I've been doing open source hardware for a couple of years, three years now, working with Mike Osman on the HackRF design.

00:54.960 --> 00:58.520
And I want to talk today about, you still can't hear me?

00:58.520 --> 00:59.140
Okay.

00:59.140 --> 01:01.700
I don't want to sound like a skinny puppy here.

01:03.040 --> 01:23.700
So, yeah, so you totally blew my, so yeah, I got this kind of crazy idea that being able to work with the HackRF without a computer might be a cool thing to be able to do.

01:23.700 --> 01:26.960
So I set about actually figuring that out.

01:26.960 --> 01:37.560
This is how you normally use a HackRF, you know, plugged into a laptop, either writing code or running GNU radio, creating flow graphs and running them, capturing data.

01:38.060 --> 01:39.260
And that's all cool.

01:39.260 --> 01:43.020
In fact, this is really the right way to do things most of the time.

01:43.020 --> 01:52.660
But sometimes you need to get out and about and look for interesting targets or get close to them if you can't bring them into your lab or into your office or whatever.

01:53.260 --> 01:56.620
And that's pretty much what the PortaPak is all about.

01:57.040 --> 02:01.380
So let me show you quickly what the architecture of the PortaPak is like.

02:01.400 --> 02:06.720
We got the HackRF board, you know, this is a HackRF one.

02:07.120 --> 02:19.540
And on top of it, I created a board that attaches to the headers that Mike was talking about that adds micro SD card, real time clock, battery backup so it can maintain calendar time.

02:19.960 --> 02:27.300
An audio interface so you can plug in like an Android or iOS headset and have headphones and a microphone.

02:28.200 --> 02:30.920
So if you wanted to transmit audio for some reason, you could do that.

02:31.520 --> 02:34.780
A 240 by 320 RGB LCD.

02:34.900 --> 02:39.820
It's only 2.4 inches large but seems to work out pretty well.

02:40.440 --> 02:41.660
Resistive touch screen.

02:41.660 --> 02:49.980
So you'd be able to go and key in information or maybe slide spectrum back and forth when I write the code or when somebody else helps me write the code.

02:50.520 --> 02:53.420
And then a bunch of mechanical controls.

02:53.420 --> 02:56.860
So you've got a four way navigation switch so you can move up, down, left, right.

02:56.860 --> 03:03.340
And then there's a nice ring control which allows you to jog left and right which is great for tuning or turning the volume up and down.

03:03.420 --> 03:06.540
And then a select button that I still haven't figured out what to do with yet.

03:06.540 --> 03:09.040
But, you know, the user interface is still evolving.

03:09.680 --> 03:15.600
There's a CPLD, a really small one, a Max 5 from Altera which ties all this stuff together.

03:15.640 --> 03:19.620
So don't get your hopes up that you might be able to do some signal processing inside the CPLD.

03:19.620 --> 03:20.760
There's not much there.

03:20.760 --> 03:22.860
Just basically glue logic.

03:23.900 --> 03:30.780
So let's step back for a second and think about what we have to deal with if we're not going to work with a PC.

03:31.520 --> 03:36.840
Here are your typical specs for a laptop or desktop PC nowadays.

03:37.040 --> 03:42.060
And here is the performance characteristics of the processor in the HackRF.

03:42.120 --> 03:46.660
You can see we're talking, you know, a couple orders of magnitude difference in a lot of cases.

03:47.100 --> 03:57.860
So, but, you know, the reason why is you can buy this ARM processor for 5 bucks and, you know, produce a really inexpensive software defined radio.

03:57.860 --> 04:02.620
And you can also power it off of USB because it doesn't suck 50 watts.

04:03.580 --> 04:07.040
So in essence we're going back to 1996.

04:09.200 --> 04:13.700
Although actually a Pentium Pro I think is even faster than this ARM by just a little bit.

04:14.040 --> 04:29.040
So I was going to try and delve into some of the signal processing tricks that I did with the PortaPak in order to get it to demodulate AM and FM radio and tire pressure monitors, my personal favorite thing to mess with.

04:30.000 --> 04:33.220
But I realized there's no way I'm going to be able to do it in 20 or 30 minutes.

04:33.220 --> 04:44.940
So I'm just going to brush over some stuff really quickly and talk about how when developing code for this thing you've got a lot of interesting constraints you haven't had to deal with before in a desktop platform.

04:44.940 --> 04:53.380
To start with, the processor's got two cores, which is actually kind of cool, but they're not both really fast Cortex M4 processors.

04:53.380 --> 04:54.600
One's an M0.

04:54.620 --> 04:57.220
It doesn't have any DSP capability to speak of.

04:57.360 --> 05:02.360
It's just not very well suited for doing all the signal processing you might want to do for software radio.

05:02.980 --> 05:06.140
And then we've got four different very small chunks of RAM.

05:06.140 --> 05:13.480
I think the top one's maybe 64K and then there's like a 20K block and 16K here.

05:13.480 --> 05:14.500
Not very much RAM.

05:14.500 --> 05:20.300
But the nice thing is they're completely distinct and they're all hooked together through a bus matrix.

05:20.300 --> 05:28.220
So if the M4 wants to run code out of this RAM block, it does not interfere with the M0 running code out of another RAM block.

05:28.220 --> 05:38.460
Most importantly, it also doesn't interfere with the baseband data coming from the radio portion of the design getting into or coming out of another block of RAM.

05:38.460 --> 05:44.700
So you can have all this stuff going on simultaneously and not have to worry much about contention for RAM resources.

05:45.720 --> 05:47.880
So this is how it wound up working out.

05:50.380 --> 06:02.180
The Cortex M4 on the HackerRef does have hardware floating point, but it turns out it isn't much of an advantage when you're doing signal processing.

06:02.280 --> 06:09.500
The HackerRef works with 8-bit samples, so we're talking pretty low signal-to-noise ratio compared to floating point.

06:09.500 --> 06:14.660
Floating point is overkill from a numerical representation standpoint.

06:14.660 --> 06:28.600
It just makes life a lot easier when you're doing signal processing to not have to worry about overflowing your number space or winding up not having enough signal dynamic range to retain a signal as you're processing it.

06:28.600 --> 06:41.260
So floating point is great, it's just that in this case, doing integer arithmetic on these small samples we're dealing with is quite a bit faster because the M4 has vector integer instructions.

06:41.600 --> 06:45.140
And so I wound up writing a lot of integer code.

06:45.540 --> 06:58.560
And to do that, basically you have to use fixed point arithmetic where instead of letting the floating point hardware manage where the decimal point is when you multiply two numbers together, you have to keep track of it yourself.

06:58.760 --> 07:03.100
So you can see here if we're just multiplying integers, the obvious thing happens.

07:04.320 --> 07:19.200
If you're using fixed point arithmetic, you just sort of mentally decide in your code where you want that decimal point to exist, and you create fractions out of the number of bits that wind up being to the right of the decimal point.

07:21.000 --> 07:25.560
Here are some of the typical signal processing tasks you might do in a radio receiver.

07:26.100 --> 07:29.580
And I'm going to brush through this really quickly so that I can get on to the demo.

07:30.620 --> 07:38.820
Basically, as you receive a signal, you want to be able to go and shift the signal of interest down to around zero hertz.

07:39.420 --> 07:52.120
Long story short, you can have negative frequencies if you use complex number system, and being able to translate things around zero allows you to simplify later steps in the process, including filtering.

07:53.260 --> 07:55.100
So it looks kind of like this.

07:55.100 --> 08:03.000
You know, you've got a spectrum of some signal you're after, and then you perform a translation operation and shift it down to the center frequency.

08:03.680 --> 08:15.000
And ordinarily, you would create some sort of an oscillator, a complex oscillator that would generate outputs in the form of a cosine and sine wave, and you would multiply it with your input signal, and you would get an output signal.

08:15.260 --> 08:23.080
But as I mentioned, the hardware floating point on this processor is okay, and doing cosine and sine, not okay.

08:23.080 --> 08:28.980
There is no hardware sine and cosine function, so you'd have to do a lookup table or something else.

08:28.980 --> 08:44.700
But it turns out, if you want to translate by a very specific amount, typically one quarter of your sampling frequency, you can pull a very simple trick, turning all those multiplications of complex numbers into simple additions and subtractions.

08:45.360 --> 08:56.760
And I won't go too deep into this, but there are a lot of interesting signal processing techniques you can bring to bear when you're doing signal processing in a very constrained manner.

08:56.860 --> 08:58.420
Filtering is the same way.

08:58.420 --> 09:05.980
If you want to filter a signal so you remove all of the noise that is not your intended signal, you use an FIR filter.

09:05.980 --> 09:18.860
And that basically involves taking data and shifting it through an array, while you multiply all of the elements of the array by coefficients that represent the filter characteristic that you intend, and then adding up the results.

09:19.160 --> 09:40.520
But if you combine that with a decimation step, which I certainly need to do because I can't deal with 20 megasamples a second on an ARM processor, you can combine steps of filtering and decimation, and in the process, cut your work in half or even a quarter by eliminating certain steps in the FIR filter.

09:42.020 --> 09:49.020
And then I was going to explain a few other things, and it's nine minutes until the end, so I'm going to demo stuff.

09:54.540 --> 09:55.900
Post-it note.

09:56.820 --> 09:57.860
Hey!

09:58.000 --> 09:58.840
All right.

09:58.860 --> 10:05.400
I don't know how closely this thing focuses, but hopefully you can see here.

10:05.400 --> 10:06.200
Terrible.

10:06.200 --> 10:06.960
Oh, okay.

10:06.960 --> 10:07.900
Not great.

10:11.320 --> 10:13.100
Yeah, or something.

10:14.360 --> 10:18.700
I'm mostly getting glare off the screen, so that may just be solved by turning it down.

10:20.340 --> 10:20.960
Okay.

10:20.960 --> 10:22.240
Anyone getting sick yet?

10:26.920 --> 10:27.880
Okay.

10:28.600 --> 10:29.820
This is not great.

10:30.120 --> 10:30.520
Okay.

10:30.520 --> 10:49.040
So if you can look really carefully on the display, on the screen, you can see on the display, we've got the real-time clock showing up, we've got a tuning frequency which we can control by turning the knob here left and right, navigate around to different fields by just clicking,

10:49.040 --> 10:57.060
you know, the arrow keys, and right now it's doing a spectrum analysis of about 8 megahertz worth of bandwidth in the cellular region.

10:57.340 --> 10:59.000
850 megahertz roughly.

10:59.460 --> 11:04.560
I can switch it over, and this will also be an interesting demo if I can actually get it to work.

11:04.580 --> 11:09.400
I'm going to shift down to just say FM radio band.

11:10.340 --> 11:14.180
And we'll maybe listen to some good tunes.

11:19.680 --> 11:21.440
Let's see.

11:21.500 --> 11:23.220
Wide band FM.

11:29.980 --> 11:33.060
I don't think I'm tuned on frequency yet here.

11:34.480 --> 11:35.980
It could be.

11:53.400 --> 12:01.340
Yeah, so at this point it will do narrow band AM, so like aviation radio.

12:02.280 --> 12:06.600
Actually that's about the only people who use AM anymore, right?

12:08.020 --> 12:14.260
Well, yeah, aviation radio, that's like everything else they've got with the frequency modulation bandwagon.

12:14.360 --> 12:19.740
So narrow band FM, so you could listen to all of the various walkie-talkies running around here.

12:20.380 --> 12:25.320
You can FM demodulate pager signals.

12:25.320 --> 12:30.280
Then you have to actually go and decode the baseband data, the modulation of the data.

12:30.920 --> 12:39.840
It will do wide band FM as we just heard, and then I, just as a proof of concept that you can do digital modes as well, I coded up some tire pressure monitor decoding.

12:39.840 --> 12:52.660
So I was out with Skyler, the 14-year-old kid, out on the main drag here last night with the Portapak, and we were watching packets coming off of people's wheels.

12:53.740 --> 12:55.240
That was a lot of fun.

12:55.560 --> 13:01.600
If anyone wants to hang out, play in the street, I'm happy to walk out there and do it.

13:01.860 --> 13:03.380
So yeah, that's pretty much it.

13:03.380 --> 13:06.500
I think maybe I've even managed to get us back on time here.

13:06.860 --> 13:08.160
And any questions?

13:12.520 --> 13:15.140
Oh, yeah, that's not a very good sight.

13:16.240 --> 13:17.760
Where's my post-it note?

13:18.540 --> 13:19.400
Oh, I've lost it.

13:19.400 --> 13:20.760
My security device.

13:22.500 --> 13:23.600
That solves it.

13:24.800 --> 13:25.460
All right.

13:25.460 --> 13:26.440
Any questions?

13:27.700 --> 13:28.500
Yes, go ahead.

13:29.840 --> 13:32.500
Can you buy one and how much will it cost?

13:32.520 --> 13:42.560
I am working with a gentleman I know in my city who is an assembler who wants to help me build the first round of these.

13:42.820 --> 13:46.920
And if all goes well, these should be out in a month.

13:46.920 --> 13:53.400
I am a little concerned that with the amount of interest I've seen so far, that they may not be around for long.

13:53.500 --> 13:58.480
But I do have, my intent is to sell through retailers.

13:58.500 --> 14:04.000
So I've talked with a couple of the retailers that you would find out in the main vendor area.

14:04.160 --> 14:08.380
And they should be carrying them and maybe even pre-ordering them.

14:08.520 --> 14:10.400
We still have to work out the details.

14:13.220 --> 14:20.860
I'm trying to keep the price in like the 100, 120 range, but we'll see how it actually works out once my assembler sends me a quote.

14:26.540 --> 14:32.260
In my experience, the compiler does not help all that much with vectorization.

14:32.260 --> 14:36.700
And it may just be that I'm not writing code that it sees as being vectorizable.

14:36.700 --> 14:51.080
I know that there are some C tricks around trying to tell the compiler that there are no potential overlaps in pointers, so that it can make some assumptions about the pointers not having any overlap.

14:51.580 --> 14:57.520
But I just drop straight to assembly because I know exactly what instructions I want to use.

14:57.520 --> 15:03.260
And moreover, there's no way to express in C like the ability to go and say, I want to do saturating arithmetic.

15:03.260 --> 15:10.760
Where when you multiply these two numbers together and they're too big for the resulting data type, that they saturate to a positive and negative extreme.

15:11.000 --> 15:14.060
So it is kind of nice to just drop into assembly at that point.

15:15.480 --> 15:16.800
Other questions?

15:18.640 --> 15:19.460
Yes?

15:22.160 --> 15:23.440
Oh yeah.

15:23.440 --> 15:25.180
So, silly me.

15:25.700 --> 15:29.280
If you don't mind me roodling in my bag for five seconds.

15:36.640 --> 15:39.540
This book made the port-a-pack possible.

15:39.900 --> 15:50.140
There is a chapter 13, which is about a third of the book, which describes practically all the signal processing tricks I use to get speed out of the ARM processor.

15:50.140 --> 15:54.880
It's called, Understanding Digital Signal Processing and it's by Richard Lyons.

15:54.880 --> 16:01.740
It's now in its third edition and I think it's $90 retail, obviously cheaper at Amazon.

16:02.740 --> 16:07.740
So if any of you guys are looking to do some tight SDR coding, get the book.

16:08.540 --> 16:09.360
Yes?

16:13.860 --> 16:15.540
It's pretty high.

16:15.540 --> 16:28.320
I did have a bug where I had my CPU clock rate set wrong and so the statistics I recall off the top of my head are probably incorrect because I only noticed the stats before I fixed the clock issue.

16:28.320 --> 16:32.000
But I feel like it's probably in the 70 or 80 range, 80% range.

16:32.060 --> 16:35.580
Now that said, I haven't spent a lot of time optimizing that stuff.

16:35.580 --> 16:41.380
So I've got like an arc tangent function which does the FMD mod and I think it could be significantly faster.

16:41.380 --> 16:43.140
And that's where a lot of the cycles are going.

16:45.960 --> 16:46.780
Anyone else?

