OFDM Packet Receivers in GNU Radio - archive.fosdem.org · Part I – OFDM PHY Development 1 What...
Transcript of OFDM Packet Receivers in GNU Radio - archive.fosdem.org · Part I – OFDM PHY Development 1 What...
OFDM Packet Receivers in GNU Radio
Martin Braun (Ettus Research / GNU Radio)
FOSDEM 2014
Introduction
I Who is this guy:I mbr0wnI GNU Radio contributor since 2008I KIT graduateI Now full-time SDR developer for Ettus Resarch LLC
Part I – OFDM PHY Development
1 What is OFDM?
2 Tagged Stream Blocks
3 GNU Radio OFDM Codes
4 The OFDM Transmitter
5 The OFDM Receiver
6 Going over the air
Part I – OFDM PHYs
I What is OFDM?I How can we build OFDM-based PHY layers in GNU
Radio?
Outline
1 What is OFDM?
2 Tagged Stream Blocks
3 GNU Radio OFDM Codes
4 The OFDM Transmitter
5 The OFDM Receiver
6 Going over the air
What is OFDM?
I Orthogonal Frequency DivisionMultiplexing: Transmit many narrow-bandsignals in parallel on orthogonalfrequencies
I “Good way to transport lots of digital dataover the air”
I Used in many standards (LTE, Wifi, DVB,DAB, . . . )
Anatomy of an OFDM signal
I Complex modulations symbols(BPSK, QPSK, . . . )
I OFDM symbols: Set ofcomplex modulation symbolstransmitted at once
I Subcarriers: Discretefrequencies on which data aretransmitted
I Frame: Set of OFDM symbolsI Header: Carries info on frame,
helps synchronization. . .I Pilot symbols: Special
symbols, known a-priori...
...
...
...
...
...
...
t
f
cN −1,0 cN −1,M −1
c1,M −1
c0,0
c0,1
c0,1 c0,M −1
fN −1
∆f f1
f0
T TG
TO
An OFDM transmitter
Discrete-time
domain
Analogdomain
Complexsymbols D/A
Converter
Lowpassfilter
Cyclicprefixadder...
0
00
IFFT
Centre frequency
I Efficient sub-carrier modulation via IFFT (createsbaseband signal)
I Cyclic prefix: Creates space between OFDM symbolsI . . . so how do we make on of these in GNU Radio?I No states!
Outline
1 What is OFDM?
2 Tagged Stream Blocks
3 GNU Radio OFDM Codes
4 The OFDM Transmitter
5 The OFDM Receiver
6 Going over the air
gr tagged stream blocks
I Handle stream boundariesI Input-drivenI Uses tagsI Not really the same category
as sync, decimator,interpolator
I Tag on the first item definespacket length
I Examples:I CRC32I OFDM-Frame operationsI More to follow
Outline
1 What is OFDM?
2 Tagged Stream Blocks
3 GNU Radio OFDM Codes
4 The OFDM Transmitter
5 The OFDM Receiver
6 Going over the air
GNU Radio OFDM Codes
I Disclaimer: There are two versions of OFDM codes inGNU Radio
I All of this depends on the new codes!I Where to start:
I gr-digital/examples/ofdm/*.grcI “OFDM Transmitter” and “OFDM Receiver” hierarchical
blocksI In Python: digital.ofdm rx and digital.ofdm tx
I Many recent developments have gone into this (tags,message passing, tagged stream blocks. . . )
OFDM – Wishlist
I Fully configurable frame configuration (pilot tones,occupied carriers. . . )
I Can we reconfigure the whole thing to do 802.11a andDAB?
I Any part of the flow graph should be exchangeableI . . . and individually useful
Outline
1 What is OFDM?
2 Tagged Stream Blocks
3 GNU Radio OFDM Codes
4 The OFDM Transmitter
5 The OFDM Receiver
6 Going over the air
The OFDM Transmitter
I CRC block: Output is always 4 bytes longer than input
I Packet header generator: Evaluates payload and metadatato generate custom payload
I Bit repacker: Prepare for modulation, handles oddnumbers of bits
The OFDM Transmitter
I CRC block: Output is always 4 bytes longer than inputI Packet header generator: Evaluates payload and metadata
to generate custom payload
I Bit repacker: Prepare for modulation, handles oddnumbers of bits
The OFDM Transmitter
I CRC block: Output is always 4 bytes longer than inputI Packet header generator: Evaluates payload and metadata
to generate custom payloadI Bit repacker: Prepare for modulation, handles odd
numbers of bits
The OFDM Transmitter
I Symbol mappers: Regular blocksI None of the code after the mappers cares about the actual
complex values (enforce boundaries!)
I Multiplexer: Respects tag positions and boundaries
The OFDM Transmitter
I Symbol mappers: Regular blocksI None of the code after the mappers cares about the actual
complex values (enforce boundaries!)I Multiplexer: Respects tag positions and boundaries
The OFDM Transmitter
I Carrier allocator: Distributes symbols in time andfrequency, adds pilot symbols and headers
I Cyclic prefixer: Includes rolloff
The OFDM Transmitter
I Carrier allocator: Distributes symbols in time andfrequency, adds pilot symbols and headers
I Cyclic prefixer: Includes rolloff
Pilot allocation
I Pilot symbols: Known symbols to aid the receiver
I Pilot symbols can be allocated in any mannerI “Wifi-style:” ( (1, 5), )
I “DRM-style:” ( (1, 5), (), (2, 6), (), ...)
I Constant header can be injected
Outline
1 What is OFDM?
2 Tagged Stream Blocks
3 GNU Radio OFDM Codes
4 The OFDM Transmitter
5 The OFDM Receiver
6 Going over the air
The OFDM Receiver
I How can we find a packet, decode its header and then actdepending on the configuration?
I Waits for packet detectionI “High” signal at the trigger input denotes start of packetI Tags can also denote start of packet
I Pipe header to first sub-flow graphI Wait for decoding, use header info to determine length of
payloadI Pipe payload to second sub-flowgraph
The OFDM Receiver
I Channel estimator / equalizer: Reverse the effects of theradio channel
I Header parser: Uses the same object as the headergenerator
I Passes information to the HPD as an asynchronousmessage (“feedback”)
The OFDM Receiver
I Channel estimator / equalizer: Reverse the effects of theradio channel
I Header parser: Uses the same object as the headergenerator
I Passes information to the HPD as an asynchronousmessage (“feedback”)
The OFDM Receiver
I Waits for packet detectionI “High” signal at the trigger input denotes start of packetI Tags can also denote start of packet
I Pipe header to first sub-flow graphI Wait for decoding, use header info to determine length of
payloadI Pipe payload to second sub-flowgraph
Outline
1 What is OFDM?
2 Tagged Stream Blocks
3 GNU Radio OFDM Codes
4 The OFDM Transmitter
5 The OFDM Receiver
6 Going over the air
Over the air
I My setup:I RTLSDR Dongle (gr-osmocom)I USRP B210I GNU Radio (current version)I gr-osmosdr + dependenciesI That’s it – no magic extra libraries
Getting it running
I Use hierarchical blocks (“OFDM Transmitter”, “OFDMReceiver” in GRC)
I Let’s try that!
I Make sure signal amplitude is in valid range (PAPR!)I Play around with gainsI Add rolloffI Avoid DC spursI This is what you want at the receiver:
Getting it running
I Use hierarchical blocks (“OFDM Transmitter”, “OFDMReceiver” in GRC)
I Let’s try that!I Make sure signal amplitude is in valid range (PAPR!)I Play around with gainsI Add rolloffI Avoid DC spurs
I This is what you want at the receiver:
Getting it running
I Use hierarchical blocks (“OFDM Transmitter”, “OFDMReceiver” in GRC)
I Let’s try that!I Make sure signal amplitude is in valid range (PAPR!)I Play around with gainsI Add rolloffI Avoid DC spursI This is what you want at the receiver:
Demo
I 250 kHz bandwidthI QPSKI max. 375 kbpsI Downsides:
I Heavy CPU usageI No FEC
How do I build my own OFDM transceivers?
I Fastest dev path: Change as little as possibleI Critical components:
I Synchronization / DetectionI Find begin of packetsI Correct fine frequency offset
I Header formatterI Generate and parse headers (let’s have a look at them. . . )
I (Equalizer)I Stock equalizers might be enough
I See also Bastian’s talk!
Packet Header Object
gr-digital/include/gnuradio/digital/packet header default.h
Part II – MAC Development
7 Asynchronous operation: Messages
Synchronous vs. asynchronous operation
I PHY layer: streaming-oriented (samples)I MAC layer: packet-oriented, timing constraintsI How do we traverse this boundary?
Outline
7 Asynchronous operation: Messages
Message passing interface
I Remember the header/payload demultiplexer?I Dotted lines mean asynchronous data passingI We can switch between domains!I Both domains support metadata transport (tags)
What metadata are understood?
I Looking at gr-uhd documentation:I rx freq, rx time, tx time
I Header/payload demuxer can be told about these items!I Seems like it’s all there to start implementing!
Transceivers
I If you have a device that supports it, you can set uphalf-duplex transceivers without any additional efforts
Simplest Possible MAC
That’s all, folks!
I Check us out on www.gnuradio.org!