32
THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus M¨ uller Software Defined Radio Academy 2015

GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

Page 1: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

GNU RadioSDR for the masses

Marcus Muller

Software Defined Radio Academy 2015

Page 2: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

IntroductionTHE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

Who am I?

GNU Radio contributor and user

Spent too much time on the [email protected]

mailing list

Got hired by

. . . and who is Ettus?

Producer of the USRP series of SDR frontends

gr-uhd integrates directly in GNU Radio

http://www.ettus.com

Marcus Muller GNU Radio – SDR for the masses 2 / 27

Page 3: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

IntroductionTHE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

Who am I?

GNU Radio contributor and user

Spent too much time on the [email protected]

mailing list

Got hired by

. . . and who is Ettus?

Producer of the USRP series of SDR frontends

gr-uhd integrates directly in GNU Radio

http://www.ettus.com

Marcus Muller GNU Radio – SDR for the masses 2 / 27

Page 4: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

IntroductionTHE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

A short overview

1 Introduction

2 What is GNU Radio

3 Core Concepts

4 Typical Work Flow 1: Flow graphs in GRC

5 The USRP B2x0: A direct mixing SDR architecture

6 Questions and Answers

7 Typical Work Flow 2: How to build a talking clock

8 Useful Resources

Marcus Muller GNU Radio – SDR for the masses 3 / 27

Page 5: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

What is GNU RadioTHE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

What is GNU Radio?

. . . and more importantly: Why would I want that?

Marcus Muller GNU Radio – SDR for the masses 4 / 27

Page 6: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

What is GNU RadioTHE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

A Sample Flow Framework

Radio signal processing often looks like a chain of steps:

Marcus Muller GNU Radio – SDR for the masses 5 / 27

Page 7: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

What is GNU RadioTHE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

A Sample Flow Framework

GNU Radio is a signal flow graph oriented framework:

Marcus Muller GNU Radio – SDR for the masses 6 / 27

Page 8: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

What is GNU RadioTHE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

GNU Radio comes with a toolbox of useful blocks

hardware interface blocks

basic mathematical operations

filters

digital modulators

analog modulators

network tools

example implementations (digital TV, pagers, Sat images. . . )

. . .

. . . But it’s not a receiver/transmitter for any particularstandard.

Marcus Muller GNU Radio – SDR for the masses 7 / 27

Page 9: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

What is GNU RadioTHE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

What people built with GNU Radio

GNU Radio can rely on an active community with many usefulmodules, among those

GQRX

gr-radar

gr-ieee802-11

and much more

Have a look at CGRAN, http://cgran.org

Marcus Muller GNU Radio – SDR for the masses 8 / 27

Page 10: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

What is GNU RadioTHE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

GNU Radio has an application installer!

PyBOMBS: convenient installer for GNU Radio, build dependenciesand out-of-tree modules

Marcus Muller GNU Radio – SDR for the masses 9 / 27

Page 11: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

Core ConceptsTHE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

Core concept: Block

A block represents a signal processing step

can have 0 or more inputs

can have 0 or more outputs

can either

do its own signal processingor contain different blocks in itself

Marcus Muller GNU Radio – SDR for the masses 10 / 27

Page 12: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

Core ConceptsTHE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

Core concept: Item Stream

A stream is the connection between two blocks

data is exchanged between blocks on predefined connections,streams

these streams represent the output buffer of the producingblock, and

the input buffer(s) of the consuming block(s)

Marcus Muller GNU Radio – SDR for the masses 11 / 27

Page 13: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

Core ConceptsTHE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

Core concept: Flow Graph

A Flow graph is the abstract representation of how GNU Radioconnects different blocks

Marcus Muller GNU Radio – SDR for the masses 12 / 27

Page 14: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

Typical Work Flow 1: Flow graphs in GRCTHE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

Let’s build a Demo!

Observing the whole LDP433 spectrum

25 channels, 433.075 MHz to 434.775 MHz

channel spacing: 25 kHz

Modulation: FM

receiving and visualizing the whole spectrum

demodulation and playback of a single channel

Marcus Muller GNU Radio – SDR for the masses 13 / 27

Page 15: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

Typical Work Flow 1: Flow graphs in GRCTHE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

Spectrum Visualizer

Marcus Muller GNU Radio – SDR for the masses 14 / 27

Page 16: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

Typical Work Flow 1: Flow graphs in GRCTHE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

Spectrum Visualizer

Marcus Muller GNU Radio – SDR for the masses 14 / 27

Page 17: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

Typical Work Flow 1: Flow graphs in GRCTHE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

Demo: What’s happening behind the scenes?

GNU Radio Companion (GRC) converts graphically definedflow graph to python file

As python gets executed, blocks get instantiated andconnections defined by calling GNU Radio methods

The flow graph is started: GNU Radio starts calling the blocks’work methods

work methods consume input and produce output

GNU Radio calls the surrounding blocks again, now that there’snew output space / new input

Marcus Muller GNU Radio – SDR for the masses 15 / 27

Page 18: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

Typical Work Flow 1: Flow graphs in GRCTHE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

What’s happening in the individual blocks?

Marcus Muller GNU Radio – SDR for the masses 16 / 27

Page 19: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

The USRP B2x0: A direct mixing SDRarchitecture

THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

What’s happening on the hardware side of things?

The Ettus USRP B210 is the interface between software and RF:

Marcus Muller GNU Radio – SDR for the masses 17 / 27

Page 20: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

The USRP B2x0: A direct mixing SDRarchitecture

THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

Features of the B200/B210

Channels B200: 1 TX & 1 RX, B210: 2 TX & 2 RX

Coverage Seamless 70 MHz to 6 GHz

fADC flexible, up to 56 MHz

user fsample flexible, fADCN ,N ∈ 1, . . . , 512

Duplex Full duplex

Analog Filters Adjustable, up to fsample

Digital Filters Automatically chosen to optimize signal

Connectivity USB3

Host Driver Open Source,https://github.com/EttusResearch/uhd/

Firmware Open Source

FPGA Open Source

Schematics Online,http://files.ettus.com/schematics/b200/

Marcus Muller GNU Radio – SDR for the masses 18 / 27

Page 21: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

The USRP B2x0: A direct mixing SDRarchitecture

THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

structure of the B2x0 direct receiver

Marcus Muller GNU Radio – SDR for the masses 19 / 27

Page 22: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

Questions and AnswersTHE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

Questions? Answers!

Now is the time for some questions and some answers, before wemove on.

Marcus Muller GNU Radio – SDR for the masses 20 / 27

Page 23: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

Typical Work Flow 2: How to build a talkingclock

THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

Demo: A talking clock

What? A clock that, every N seconds, says the current time.

How? Using an existing text-to-speech program and pythonblocks.

Why? Yes.

Marcus Muller GNU Radio – SDR for the masses 21 / 27

Page 24: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

Typical Work Flow 2: How to build a talkingclock

THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

Demo: A talking clock

What? A clock that, every N seconds, says the current time.

How? Using an existing text-to-speech program and pythonblocks.

Why? Yes.

Marcus Muller GNU Radio – SDR for the masses 21 / 27

Page 25: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

Typical Work Flow 2: How to build a talkingclock

THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

Demo: A talking clock

What? A clock that, every N seconds, says the current time.

How? Using an existing text-to-speech program and pythonblocks.

Why? Yes.

Marcus Muller GNU Radio – SDR for the masses 21 / 27

Page 26: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

Typical Work Flow 2: How to build a talkingclock

THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

Design Approach

Using existing blocks, we can

Have an interface to the USRPGenerate FM out of audio samplesHave control over volume

What we still need is a block that generates the voice samples

itemize is an established Text-to-Speak programwe need to prepend the message with a “ping”

Marcus Muller GNU Radio – SDR for the masses 22 / 27

Page 27: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

Typical Work Flow 2: How to build a talkingclock

THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

Step I: Constructing a flow graph with missingcomponents

Marcus Muller GNU Radio – SDR for the masses 23 / 27

Page 28: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

Typical Work Flow 2: How to build a talkingclock

THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

Step II: Adding a python block stub

gr modtool allows us to create a module, and add a block stub:

gr modtool newmod talkingclock

Creating out-of-tree module in

./gr-speakingclock...Done.

>Use ’gr modtool add’ to add a new block to this

currently empty module.

cd gr-talkingclock

gr modtool add

GNU Radio module name identified: speakingclock

Enter block type: source

Language (python/cpp): python

...

Marcus Muller GNU Radio – SDR for the masses 24 / 27

Page 29: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

Typical Work Flow 2: How to build a talkingclock

THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

Step II: Adding a python block stub

gr modtool allows us to create a module, and add a block stub:

gr modtool newmod talkingclock

Creating out-of-tree module in

./gr-speakingclock...Done.

>Use ’gr modtool add’ to add a new block to this

currently empty module.

cd gr-talkingclock

gr modtool add

GNU Radio module name identified: speakingclock

Enter block type: source

Language (python/cpp): python

...

Marcus Muller GNU Radio – SDR for the masses 24 / 27

Page 30: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

Typical Work Flow 2: How to build a talkingclock

THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

Step III: Adding functionality

Most important about our block is the work method:

gets called repeatedlyhas the job of filling the output buffer, and returning how manyoutput items were produced

We add tx time and start-of-burst stream tags so that theUSRP knows when to transmit

in the constructor, we make sure everything is set up correctly

Marcus Muller GNU Radio – SDR for the masses 25 / 27

Page 31: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

Typical Work Flow 2: How to build a talkingclock

THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

Step IV: Putting it all together

Marcus Muller GNU Radio – SDR for the masses 26 / 27

Page 32: GNU Radio - SDR for the massesmarcus.hostalia.de/sdra/pres.pdf · THE FREE & OPEN SOFTWARE RADIO ECOSYSTEM GNU Radio SDR for the masses Marcus Muller Software De ned Radio Academy

Useful ResourcesTHE FREE & OPEN SOFTWARE RADIO ECOSYSTEM

Useful Links

GNU Radio project http://gnuradio.org

Guided Tutorials https://gnuradio.org/redmine/projects/

gnuradio/wiki/Guided_Tutorials

CGRAN http://cgran.org

PyBOMBS http://pybombs.info

GNU Radio mailing list [email protected] & Archive: https://lists.gnu.org/

mailman/listinfo/discuss-gnuradio

Ettus http://www.ettus.com

UHD Manual http://files.ettus.com/manual/

Marcus Muller GNU Radio – SDR for the masses 27 / 27