Sei sulla pagina 1di 69

An Introduction to Software Defined Radio With

LabVIEW and NI USRP

ni.com
Hands-on Course Objectives
• Find an FM radio station using the USRP as spectrum analyzer
• Introduction to the LabVIEW environment
Exercise • Configuring the USRP software defined radio
1 • Exploring live radio spectrum

• Demodulate & listen to live FM radio


• LabVIEW programming fundamentals
Exercise • Integrating digital signal processing functions
2 • Using .m file script inside LabVIEW

• Explore a digital communications system


• Open and run a digital communications reference design
Exercise • Identify the part of a more advanced LabVIEW block diagram
3 • Overview of the modulation & demodulation process

ni.com
What is LabVIEW Communications?

• 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

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
Communications & RF
Identification

Utilities & Medical Devices &


Infrastructure Internet of Things

Research Topics
Aerospace & Automotive &
Defense
Data rate Car to Car
Capacity
Power Consumption
Coexistence
Security
Monitoring
Land Mobile & Satellite Comm &
Safety Radio Navigation

ni.com Education
The Next 30 Years:
Expanding LabVIEW into System Design

Design Verification Product Verification

Research & Design & Verification & Manufacturing


Modeling Simulation Validation

ni.com
From Concept to Prototype … Rapidly!

Graphical System Design Platform

Design Simulate Prototype

• 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
Viewing, Creating, and Interacting with Documents

1 4 2 3

ni.com
Storing and Retrieving Data

ni.com
Creating a Way to Display Data
4

1
3

ni.com
Creating Code
4

1
3

2
3

ni.com
Configuring a VI for Use As a SubVI

2 1
5
7 6

4
4 3

ni.com
Getting Help
4

1 3

ni.com
What is a Software Defined Radio?

Software-Defined Radio (SDR) refers to the


technology wherein software modules running on
a generic hardware platform are used to
implement radio functions …..1

ni.com [1] http://www.sdrforum.org/pages/documentLibrary/documents/SDRF-06-R-0011-V1_0_0.pdf


NI USRP Software Defined Radio Signal Processing
and Synthesis
Tunable RF Front Ends  Develop and explore
 Frequency Range algorithms with NI
50 MHz – 2.2 GHz (NI-2920) LabVIEW
2.4 GHz & 5.5 GHz (NI-2921)  Simulate and process
400 MHz – 4.4 GHz (NI-2922) live signals with NI
Modulation Toolkit

GPS Disciplined Clock Option


 Increased Frequency
Accuracy

Multi Device Synchronization 1 Gigabit Ethernet to PC


 Easy 2X2 Synchronization  Plug-and-play capability
 Expandable to 8X8 or more  Up to 25 MS/s baseband IQ
streaming
ni.com
NI USRP Software Defined Radio

RF Baseband IQ
Software
Transceiver Processing

ni.com
SDR Components

• Digital to Analog
Tx • RF Upconversion • Modulation

• RF Downconversion • Demodulation
Rx
• Analog to Digital • Signal Processing

ni.com
NI USRP-2920 Hardware Diagram 1. Device
Name
5. Gain

6. # Samples/
4. Antenna Buffer

2. IQ Rate
3. Carrier
Frequency Analog RF Transceiver Fixed Function FPGA PC

ni.com
USRP Configuration in 6 Parameters

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

ni.com
USRP Configuration in 6 Parameters

ni.com
NI USRP RF Receive Parameters

IQ Rate ~ Bandwidth

1 MHz
Power (dB)

50 MHz 94.7 MHz Frequency

ni.com
NI USRP RF Receive Parameters

Carrier Frequency

1 MHz
Power (dB)

50 MHz 94.7 MHz Frequency

ni.com
NI USRP RF Receive Parameters

Gain
1 MHz
Power (dB)

50 MHz 94.7 MHz Frequency

ni.com
NI USRP RF Receive Parameters

number of samples
Time Domain
1
* number _ samples  fetch _ time
IQ _ rate

Frequency Domain
IQ _ rate
 resolution _ bandwidth
number _ samples

ni.com
Exercise 1 Find a Radio Station using Captured Data

ni.com
Exercise 1: Quiz

• 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 ?

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
Dataflow Programming

• 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

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
Complex Cluster Data Type

• The complex cluster data type is used to display


and store periodic signal measurements.

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
Arrays

• 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

ni.com
Loops
While Loop

• While Loop
• Terminal counts iterations
• Runs at least once
• Runs until stop condition is
met

For Loop
• For Loop
• Terminal counts iterations
• Runs according to input of
count terminal

ni.com
Demodulating Broadcast FM Radio

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)

Demodulated
Baseband IQ
FM

Calculate Unwrap Differentiate


phase phase phase

ni.com
Exercise 2A Demodulate and Listen to FM Radio

ni.com
Exercise 2A: Quiz

• Why did we unwrap the phase?

• How many samples per second are coming from the


USRP?

• Why is there a spike near 20 KHz?

ni.com
Demodulated Broadcast FM

Mono Audio
Left + Right

Stereo Audio
Left - Right
19 kHz
Stereo
Pilot Direct Band Audos Subcarrier
RBDS

0
30 15 38 57 67.65 92 100
Hz kHz kHz kHz kHz kHz kHz
FM broadcasting. (n.d.). In Wikipedia, Retrieved from http://en.wikipedia.org/wiki/FM_broadcasting
ni.com
MathScript Node
• 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

ni.com
Frequency Demodulation Algorithm

Detect Unwrap Differentiate


phase phase phase

ni.com
Exercise 2B Use a MathScript RT node

ni.com
Exercise 2B: Quiz

• 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?

ni.com
Exercise 2C Use LabVIEW Communications IP

ni.com
Exercise 2C: Quiz

• 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?

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
ni.com
Source Coding

Downconversion

Channel Coding

Demodulation

Modulation

Channel Decoding
Communications Channel
Digital Communication System

Upconversion
Source Decoding
Digital Communication System
NI Modulation Toolkit

NI Modulation Toolkit

ni.com
Digital Communication System
NI Modulation Toolkit

NI USRP

NI Modulation Toolkit

NI USRP

ni.com
Packet-based Communication Link System Setup
RF Signal
Center Frequency: 915MHz
Modulation Format: PSK packets
Bit Rate: 100kbps

• USRP control (Tx & Rx)


NI USRP-2920 • Modulate Tx signal NI USRP-2920
Transmitter • Demodulate Rx signal Receiver
• Reconstruct message

ni.com
Packet-based Communication with LabVIEW

ni.com
Packet Structure

GUARD SYNC PCKT


BAND SEQ NUM DATA PAD

Field Length Description


[bits]
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
Exercise 3: Quiz

• 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?

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
Record
Playback

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
Dr. Murat Torlak

• Continuously monitoring Demodulate Descramble


multiple wifi channels

• Demodulation and descrambling


of 802.11b beacon signals

• Identification of hotspots,
tracking relative power levels

802.11b SSID Decoding

Frequency
Demodulation Interpret the
Carrier Offset
& frame for
Detection Estimation &
Descrambling SSID
Correction

ni.com
NI USRP Research Case Study: Dr. Robert Heath
Director WNCG
NI USRP 8x8 MIMO Testbed Ref in
University of Texas at Austin

External
• Adaptable from 2x2 to 8x8 Clock PPS in Transmit
USRP USRP
• Algorithm design in MathScript RT TX 1 MIMO
Cable
TX 2

• 128 subcarrier OFDM, 4 QAM, spatial USRP


TX 3 MIMO Cable
USRP
TX 4
Network
diversity Cable
USRP USRP
• Independently clocked, phase TX 5 MIMO
Cable
TX 6

coherent Tx & Rx Host


Compute
USRP USRP
TX 7 MIMO TX 8
r Cable
Gigabit
Ethernet
Network Switch
Cable
Receive
USRP USRP
Rx 1 MIMO Rx 2
Cable

USRP USRP
Rx 3 MIMO Cable Rx 4
Network
Cable
USRP USRP
Rx 5 MIMO Rx 6
Cable

USRP USRP
Rx 7 MIMO Rx 8
Cable
External
Clock
ni.com
6x6 MIMO Testbed

ni.com
Position Detection & Localization Prof. Athanassios Manikas

• Testing MUSIC direction finding algorithm


• Rapid prototyping in LabVIEW with
MathScript RT
• Synchronized up to12 USRP devices External
Clock
USRP
RX 1
• Reference provides continuous phase Ref in PPS in

alignment compensation USRP


RX 2

Network
Cable
Direction Finding (uniform linear array)
USRP
RX 3

Host USRP
Computer RX 4

Network Gigabit
Cable USRP
Ethernet
TX
Switch Calibration
Signal

ni.com
LabVIEW Communications Community

8x8 MIMO-OFDM GPS Simulation


ni.com/sdr
Tx

RF Direction Finding &


RF Record & Playback Localization

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

ni.com

Potrebbero piacerti anche