An Introduction to Software Defined Radio With LabVIEW and NI...

Preview:

Citation preview

ni.com

An Introduction to Software Defined Radio With

LabVIEW and NI USRP

ni.com

Hands-on Course Objectives

Exercise 1

• Find an FM radio station using the USRP as spectrum analyzer

• Introduction to the LabVIEW environment

• Configuring the USRP software defined radio

• Exploring live radio spectrum

Exercise 2

• Demodulate & listen to live FM radio

• LabVIEW programming fundamentals

• Integrating digital signal processing functions

• Using .m file script inside LabVIEW

Exercise 3

• Explore a digital communications system

• Open and run a digital communications reference design

• Identify the part of a more advanced LabVIEW block diagram

• Overview of the modulation & demodulation process

ni.com

• LabVIEW Communications is an integrated, hardware-aware design environment for prototyping communications systems that streamlines prototyping by offering a single, cohesive environment that enables both the processor and FPGA programming

What is LabVIEW Communications?

ni.com

The National Instruments Vision

“To do for test and measurement

what the spreadsheet did for financial analysis.”

Virtual Instrumentation

ni.com

SDR Algorithm Prototyping Applications

Utilities & Infrastructure

Medical Devices & Internet of Things

Aerospace & Defense

Automotive & Car to Car

Communications & RF Identification

Research Topics

Data rate

Capacity

Power Consumption

Coexistence

Security

Monitoring

Land Mobile & Safety Radio

Satellite Comm & Navigation

Education

ni.com

The Next 30 Years: Expanding LabVIEW into System Design

Research & Modeling

Design & Simulation

Verification & Validation

Manufacturing

Product Verification Design Verification

ni.com

From Concept to Prototype … Rapidly!

Design Simulate Prototype

Graphical System Design Platform

• LabVIEW Graphical System Design offers one tool, integrated flow • Shorter learning curve • Easier system integration • Reduce the time to hardware … rapid prototyping!

ni.com

Software and Hardware Introduction

Find an FM radio station using the USRP as spectrum analyzer

Introduction to the LabVIEW environment

Configuring the USRP software defined radio

Exploring live radio spectrum

ni.com

Getting Started in LabVIEW

ni.com

1 2

2

3 4

Viewing, Creating, and Interacting with Documents

ni.com

1

2

3

4

Storing and Retrieving Data

ni.com

2

1

3

4

Creating a Way to Display Data

ni.com

3

4

1

3

2

Creating Code

ni.com

5

4 3 4

6

1 2

7

Configuring a VI for Use As a SubVI

ni.com

Getting Help

1

2

3

4

ni.com

NI USRP Software Defined Radio

1 Gigabit Ethernet to PC Plug-and-play capability Up to 25 MS/s baseband IQ

streaming

Tunable RF Front Ends Frequency Range

50 MHz – 2.2 GHz (NI-2920) 2.4 GHz & 5.5 GHz (NI-2921) 400 MHz – 4.4 GHz (NI-2922)

Signal Processing and Synthesis Develop and explore

algorithms with NI LabVIEW

Simulate and process live signals with NI Modulation Toolkit

Multi Device Synchronization Easy 2X2 Synchronization Expandable to 8X8 or more

GPS Disciplined Clock Option Increased Frequency

Accuracy

ni.com

NI USRP Software Defined Radio

RF Transceiver

Software Processing

Baseband IQ

ni.com

SDR Components

Tx • Digital to Analog

• RF Upconversion • Modulation

• RF Downconversion

• Analog to Digital Rx

• Demodulation

• Signal Processing

ni.com

NI USRP-2920 Hardware Diagram

Analog RF Transceiver Fixed Function FPGA PC

4. Antenna

5. Gain

2. IQ Rate

6. # Samples/ Buffer

3. Carrier Frequency

1. Device Name

ni.com

1. Device Name – IP address of one or multiple USRP

2. IQ Rate – Quadrature sampling rate, equivalent to bandwidth

3. Carrier Frequency – Frequency of interest

5. Gain – Amplification of signal before digitizing the signal

4. Antenna – Select which antenna port to receive from

6. Fetch size – how many samples to acquire each fetch

USRP Configuration in 6 Parameters

ni.com

USRP Configuration in 6 Parameters

ni.com

NI USRP RF Receive Parameters

Frequency

Pow

er

(dB

)

94.7 MHz

1 MHz

50 MHz

IQ Rate ~ Bandwidth ~

ni.com

NI USRP RF Receive Parameters

Frequency

Pow

er

(dB

)

94.7 MHz

1 MHz

50 MHz

Carrier Frequency

ni.com

NI USRP RF Receive Parameters

Frequency

Pow

er

(dB

)

94.7 MHz

1 MHz

50 MHz

Gain

ni.com

NI USRP RF Receive Parameters

number of samples

timefetchsamplesnumberrateIQ

__*_

1

bandwidthresolutionsamplesnumber

rateIQ_

_

_

Frequency Domain

Time Domain

ni.com

Exercise 1 Find a Radio Station using Captured Data

ni.com

• What is the center frequency of the radio station you found?

• What is the bandwidth of the radio station?

• How do you set the receive bandwidth of the USRP?

• How can you receive a weak signal better ?

Exercise 1: Quiz

ni.com

Demodulating Live FM

Demodulate & listen to live FM radio

LabVIEW programming fundamentals

Integrating digital signal processing functions

Using .m file script inside LabVIEW

ni.com

• Block diagram execution

– Dependent on the flow of data

– Does NOT execute left to right

• Nodes execute when data is available to ALL input terminals

• Nodes supply data to all output terminals when done

Dataflow Programming

ni.com

NI-USRP Driver Software

Initialize Configure Start Read IQ Stop Close

ni.com

Common Data Types Found in LabVIEW

ni.com

Reviewing the Block Diagram

Wire: Complex Cluster

Wire: Error Cluster

ni.com

• The complex cluster data type is used to display and store periodic signal measurements.

Complex Cluster Data Type

t0 – Initial time of waveform

dt – Sample period

Y – Array of data samples

Baseband IQ : Y is an array of complex numbers representing I and Q samples

ni.com

• An array consists of elements and dimensions

• Elements: data that make up the array

• Dimension: the length, height, or depth of an array

• Consider using arrays when you work with a collection of similar data and when you perform repetitive computations

Arrays

ni.com

Loops

• While Loop • Terminal counts iterations

• Runs at least once

• Runs until stop condition is met

• For Loop • Terminal counts iterations

• Runs according to input of count terminal

While Loop

For Loop

ni.com

FM radio can be demodulated in 3 steps:

1. Calculate carrier phase (Arc tan of baseband IQ data)

2. Unwrap the phase (remove discontinuities)

3. Compute the derivative (change in phase ≈ frequency)

Demodulating Broadcast FM Radio

Baseband IQ

Calculate phase

Unwrap phase

Differentiate phase

Demodulated FM

ni.com

Exercise 2A Demodulate and Listen to FM Radio

ni.com

• Why did we unwrap the phase?

• How many samples per second are coming from the USRP?

• Why is there a spike near 20 KHz?

Exercise 2A: Quiz

ni.com

Demodulated Broadcast FM

30 Hz

15 kHz

38 kHz

67.65 kHz

92 kHz

100 kHz

0

19 kHz Stereo Pilot

Stereo Audio Left - Right

Direct Band

RBDS

Mono Audio Left + Right

Audos Subcarrier

57 kHz

FM broadcasting. (n.d.). In Wikipedia, Retrieved from http://en.wikipedia.org/wiki/FM_broadcasting

ni.com

• Implement equations and algorithms textually

• Input and output variables created at the border

• Generally compatible with popular .m file script language

• Terminate statements with a semicolon to disable

immediate output

MathScript Node

ni.com

Detect phase

Unwrap phase

Differentiate phase

Frequency Demodulation Algorithm

ni.com

Exercise 2B Use a MathScript RT node

ni.com

• Why did we use the Get Waveform Components function?

• Are there any differences in using the MathScript node vs LabVIEW functions?

• If we deleted the graphs, would the music still play?

Exercise 2B: Quiz

ni.com

Exercise 2C Use LabVIEW Communications IP

ni.com

• Are there any differences in the graph when using the Modulation Toolkit function vs MathScript or LabVIEW?

• What happens if we specify an FM deviation of 75,000 Hz?

Exercise 2C: Quiz

ni.com

Digital Communications

Explore a digital communications system

Open and run a digital communications reference design

Identify the part of a more advanced LabVIEW block diagram

Overview of the modulation & demodulation process

ni.com

So

urc

e C

od

ing

Ch

an

ne

l Co

din

g

Mo

dula

tion

Up

co

nve

rsio

n

Dow

nconve

rsio

n

De

mo

dula

tion

Ch

an

nel D

eco

din

g

So

urc

e D

eco

din

g

Communications Channel

Digital Communication System

ni.com

NI Modulation Toolkit

NI Modulation Toolkit

Digital Communication System

ni.com

NI Modulation Toolkit

NI Modulation Toolkit

NI USRP

NI USRP

Digital Communication System

ni.com

Packet-based Communication Link System Setup

• USRP control (Tx & Rx) • Modulate Tx signal • Demodulate Rx signal • Reconstruct message

NI USRP-2920

Receiver NI USRP-2920

Transmitter

RF Signal

Center Frequency: 915MHz Modulation Format: PSK packets Bit Rate: 100kbps

ni.com

Packet-based Communication with LabVIEW

ni.com

Packet Structure

GUARD

BAND SYNC

SEQ PCKT

NUM PAD DATA

Field Length [bits]

Description

Guard Band 30 Allow initialization of Rx PLL, filters, etc

Sync Sequence 20 Frame and Symbol Synchronization

Packet Number 32 Range: 0-255 Used for reordering of packets and detection of missing packets

Data 128 Variable length data field. Length detected dynamically at Rx end

Pad 20 Allows for filter edge effects.

ni.com

Transmitter Block Diagram

ni.com

The Received Signal

ni.com

Receiver Block Diagram

ni.com

Exercise 3 Packet Based Transceiver

ni.com

Receiver: Pipelined Shift Register Architecture

Acquire

Detect & Slice Packets

Resample and Demodulate

Synchronize & Decode

Reconstruct Data

Accumulate & Display Packets

ni.com

Receiver: Pipelined Shift Register Architecture

Acquire

Detect & Slice Packets

Resample and Demodulate

Synchronize & Decode

Reconstruct Data

Accumulate & Display Packets

ni.com

• How many packets do you send out using the default message?

• Why doesn’t the receiver stop if you change the message?

• What happens if you change the modulation scheme on the transmitter but not the receiver?

• Why do we need the packet slicer on the receiver?

Exercise 3: Quiz

ni.com

NI SDR User Solutions Wireless Comms Education

Record and Playback

Cognitive Radio

Physical Layer Prototyping

Compensating for RF nonlinearities with DSP

8x8 MIMO

Direction Finding

ni.com

RF Record & Playback

• Record and play back up to 20 MHz of bandwidth

• Repeatable testing of algorithms / devices on realistic dataset

• Supplement a PXI lab with low-cost playback at your desk

Re

co

rd

Pla

yb

ack

ni.com

NI USRP Research Case Study:

Cognitive Radio & Whitespace

Large Scale Cognitive Radio Testbed • Prototyping cognitive radio in LabVIEW

• Spectral sensing with blind detection

• Database driven geo-location with GPS

• Deployed in Munich, Germany

“LabVIEW software and the NI USRP hardware are key components of this research project, allowing the team to rapidly prototype and successfully deploy the first cognitive radio test bed of this kind.” Dr. Paulo Marques, COGEU

Aveiro, Portugal

ni.com

WiFi Physical Layer Prototyping

• Continuously monitoring multiple wifi channels

• Demodulation and descrambling of 802.11b beacon signals

• Identification of hotspots, tracking relative power levels

Carrier Detection

Frequency Offset

Estimation & Correction

Demodulation &

Descrambling

Interpret the frame for

SSID

Demodulate Descramble

Dr. Murat Torlak

802.11b SSID Decoding

ni.com

NI USRP Research Case Study:

NI USRP 8x8 MIMO Testbed • Adaptable from 2x2 to 8x8

• Algorithm design in MathScript RT

• 128 subcarrier OFDM, 4 QAM, spatial diversity

• Independently clocked, phase coherent Tx & Rx

Dr. Robert Heath Director WNCG University of Texas at Austin

MIMO

Cable

USRP

Rx 1 USRP

Rx 2

MIMO Cable

USRP

Rx 3 USRP

Rx 4

MIMO

Cable

USRP

Rx 5

USRP

Rx 6

MIMO

Cable

USRP

Rx 7

USRP

Rx 8

PPS in

Ref in External

Clock

Network

Cable

Network

Cable

Network

Cable

Host

Compute

r

Transmit

Receive

MIMO

Cable

USRP

TX 1 USRP

TX 2

MIMO Cable

USRP

TX 3 USRP

TX 4

MIMO

Cable

USRP

TX 5

USRP

TX 6

MIMO

Cable

USRP

TX 7

USRP

TX 8

Gigabit

Ethernet

Switch

External

Clock

ni.com

6x6 MIMO Testbed

ni.com

Position Detection & Localization

• Testing MUSIC direction finding algorithm

• Rapid prototyping in LabVIEW with MathScript RT

• Synchronized up to12 USRP devices

• Reference provides continuous phase alignment compensation

Calibration Signal

USRP RX 1

PPS in Ref in

External Clock

Network Cable

Network Cable

Host Computer

Gigabit Ethernet Switch

USRP RX 2

USRP RX 3

USRP RX 4

USRP TX

Direction Finding (uniform linear array)

Prof. Athanassios Manikas

ni.com

LabVIEW Communications Community

8x8 MIMO-OFDM GPS Simulation

RF Record & Playback RF Direction Finding &

Localization

Tx

ni.com/sdr

ni.com

Summary

• LabVIEW offers a graphical approach, shortening the design process, and tight hardware/software integration that allows for seamless transition from design to test • NI provides a full spectrum of RF / Communications solutions: RF Test, Research and Education • LabVIEW and NI USRP is an accessible, easy-to-use software defined radio platform

Recommended