Mounzer saleh Applications engineer Email: mounzer.saleh@ Tel: +961 1 33 28 28
An Introduction to Software Defined Radio With LabVIEW and NI USRP
Hands-on Course Objectives Exercise 1 Acquire an RF signal using USRP Introduction to the LabVIEW environment Configuring the USRP software defined radio Acquiring an RF signal using NI USRP Exercise 2 Demodulate & listen to live FM radio LabVIEW programming fundamentals Integrating digital signal processing functions Exercise 3 Using Mathscript code and pre-built IP
What is LabVIEW? LabVIEW is a graphical programming environment used by millions of engineers and scientists to develop sophisticated measurement, test, and control systems LabVIEW can integrate with wide variety of hardware devices, including the NI USRP
NI RF Test Platform Optimized APIs Cellular, Wireless, & GPS Test Toolkits (802.11 a/b/g/n, GSM, EDGE, WCDMA, RFID, WiMAX, GPS, etc.) Soft Front Panels Reference Architectures Multicore Processing VSAs & VSGs FPGA I/O & Co-processing Amplifiers & Attenuators Switching Power Meters
The Next 30 Years: Expanding LabVIEW into System Design Design Verification Product Verification Research/Mod eling Design/Simul ation Verification/Va lidation Manufacturing
Introduction to SDR Acquire a spectrum using NI-USRP API Introduction to the LabVIEW environment Configuring the USRP software defined radio Acquiring an RF signal using NI-USRP
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!
Getting Started in LabVIEW
LabVIEW Programs are Called Virtual Instruments (VIs) LabVIEW VIs contain three main components: 1. Front Panel 2. Block Diagram 3. Icon/Connector Pane
Front Panel & Controls Palette Numeric Control Controls Palette - contains the controls and indicators you use to create the front panel
Block Diagram & Functions Palette Math Function Front panel objects appear as terminals on the block diagram Contains the VIs, functions, and constants you use to create the block diagram
Dataflow Programming Block diagram execution Dependent on the flow of data Block diagram does NOT execute left to right Node executes when data is available to ALL input terminals Nodes supply data to all output terminals when done
LabVIEW Help Utilities Context Help Hover over function blocks for just-in-time help Help»Show Context Help Shortcut Keys: <Ctrl-H>
LabVIEW Help Utilities LabVIEW Help Select Help»LabVIEW Help Use the Detailed help link or button in the Context Help window Right-click an object and select Help from the shortcut menu
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..
NI USRP Software Defined Radio Tunable RF Transceiver 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 NI LabVIEW to develop and explore algorithms NI Modulation Toolkit and LabVIEW add-ons to simulate or process live signals Applications FM Radio TV GPS GSM ZigBee Safety Radio OFDM Passive Radar Dynamic Spectrum Access 1 Gigabit Ethernet to PC Plug-and-play capability Up to 25 MS/s baseband IQ streaming
NI USRP Software Defined Radio RF Transceiver Baseband IQ Software Processing
SDR Components Tx Digital to Analog RF Upconversion Modulation RX RF Downconversion Analog to Digital Demodulation Signal Processing
NI-USRP Driver Software RX Settings
Signal Processing (PC) Receiver Path Software Radio Example TX SMA RX? SMA BUS
Signal Processing (PC) Receiver Path Software Radio Example TX SMA Amp DA C How fast? How many bits? BUS RX SMA Amp AD C 5GS/s for Wifi!?
Example: Sampling at 5 GS/s 2.5 GHz 50 MHz 0 Hz 2.4 GHz Signal of interest has 50 MHz bandwidth When we sample at 5 GS/s, we get all the data between 0-2.5 GHz Only interested in 2.4 GHz +/- 25 MHz At this sampling rate, we collect much more data than we need How do we get around this?
Mixing
Signal After Mixing 50 MHz 0 Hz After mixing, signal of interest has 50 MHz bandwidth, but now it is a much lower frequency At this lower frequency, an ADC can capture the signal
Introduction to I and Q Acos( 2 f ct ) Acos( )cos(2 fct) I Acos( ) Q Asin( ) Acos( 2 f ct ) Asin( )sin(2 fct) I cos(2 fct) Qsin(2 fct) Note: I and Q capture Amplitude and Phase information
IQ Modulator An IQ modulator multiplies I and Q by the carrier and carrier - 90 degrees, respectively. By summing two orthogonal data streams and a carrier, we get a phase modulator (any angle in the phase plane). If we add amplitude control, we get a vector modulator (any point in the phase plane). LO
Signal Processing (PC) Software Radio Receiver I( t)cos(2 f t) Q( t)sin(2 f t) c c RX Mixe r I(t) AD C BUS SMA Amp 0 o 90 o Tunable Oscillator f c Mixe r Q(t) RF Signal IQ Mixing Baseband f c = center frequency of interest AD C 100 MS/s ADC
Signal Processing (PC) Receiver Path Software Radio Example RF Signal IQ Mixing Baseband RX 1 SMA Switc h BUS RX 2 SMA Amp Tunable Oscillator Mixe r 0 o 90 o Mixe r LPF LPF 20 MHz LPF Low pass filters chosen to be below 50MHz Nyquist criteria Act as anti-aliasing filters Switch added to handle multiple different antennas 2 sampling chains effectively samples the signal twice AD C AD C 100 MS/s ADC 2 Sampling chains
Signal Processing (PC) Receiver Path USRP Example RF Signal IQ Mixing Baseband RX 1 SMA Switc h BUS RX 2 SMA Amp 900 MHz Tunable Oscillator Mixe r 0 o 90 o Mixe r LPF LPF 20 MHz LPF AD C AD C 100 MS/s ADC 3.2 Gb/s 1 Gb Etherne t Data Rate Calculation: 100 Million Samples/sec x 16 bits/sample x 2 = 3.2 Gigibits/second BUS = 1 Gb Ethernet down-conversion is needed to ~ 25 MS/s or less.
RX Control Signal Processing (PC) Receiver Path: USRP Example RF Signal IQ Mixing Baseband RX 1 SMA Switc h FPGA BUS RX 2 SMA Amp 900 MHz Tunable Oscillator Mixe r 0 o 90 o Mixe r LPF LPF 20 MHz LPF AD C AD C 100 MS/s ADC Onboard Signal Processing Onboard Signal Processing 1 Gb Etherne t Data Rate Calculation: 100 Million Samples/sec x 16 bits/sample x 2 = 3.2 Gigibits/second BUS = 1 Gb Ethernet down-conversion is needed to ~ 25 MS/s or less.
RX Control TX Control Signal Processing (PC) Radio NI USRP System Diagram RX 1 TX SMA 1 Amp Mixe r 0 o 90 o LPF DA C Onboard Signal Processing Mixe r LPF DA C Onboard Signal Processing Switc h Tunable Oscillator FPGA BUS RX 2 SMA Amp Mixe r 0 o 90 o LPF AD C Onboard Signal Processing Mixe r LPF AD C Onboard Signal Processing Tunable Oscillator NI USRP-2920 System Diagram
NI USRP-2920 Hardware Diagram 5. Gain 1. Device Name 4. Antenna 6. # Samples/ Buffer 2. IQ Rate 3. Carrier Frequenc y Analog RF Transceiver Fixed Function FPGA PC
USRP Configuring 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 4. Antenna Select which antenna port to receive from 5. Gain Amplification of signal before digitizing the signal 6. Fetch size how many samples to acquire each fetch
Power (db) NI USRP RF Receive Parameters IQ Rate ~ Bandwidth 1 MHz 50 MHz 94.7 MHz Frequency
Power (db) NI USRP RF Receive Parameters Carrier Frequency 1 MHz 50 MHz 94.7 MHz Frequency
Power (db) NI USRP RF Receive Parameters Gain 1 MHz 50 MHz 94.7 MHz Frequency
NI USRP RF Receive Parameters number of samples IQ 1 _ rate Time Domain * number _ samples fetch _ time
NI-USRP Driver Software Initialize Configur e Start Read IQ Stop Close
Exercise 1 buffered finite Acquisition
Demodulating Live FM Demodulate & listen to live FM radio LabVIEW programming fundamentals Integrating digital signal processing functions Using.m file script inside LabVIEW
Common Data Types Found in LabVIEW
Reviewing the Block Diagram Wire: Waveform Datatype Wire: Error Cluster
Waveform Data Type The waveform data type is used by LabVIEW 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
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 49
Introduction to Clusters Data structure that groups data together Data may be of different types Analogous to struct in ANSI C Elements must be either all controls or all indicators Thought of as wires bundled into a cable Uses: Grouping variables Error handling Modulation toolkit
Loops While Loop Terminal counts iterations Always runs at least once Runs until stop condition is met For Loop Terminal counts iterations Runs according to input N of count terminal While Loop For Loop
Demodulating Broadcast FM Radio FM radio can be demodulated in 3 steps: 1. Detect carrier phase 2. Unwrap the phase (remove discontinuities) 3. Compute the derivative (change in phase frequency) Baseband IQ Demodulated FM Detect phase Unwrap phase Differentiate phase
Unwrapping Phase Polar numbers consist of magnitude and phase Phase values from -180º to 180º Discontinuities exist as phase wraps back around Unwrap phase to eliminate discontinuities 180-180
Exercise 2A Demodulate and Listen to FM Radio
Demodulated Broadcast FM Mono Audio Left + Right 19 khz Stereo Pilot Stereo Audio Left - Right RBDS Direct Band Audos Subcarrier 0 30 Hz 15 khz 23 khz 38 khz 53 khz 57 khz 58.35 khz 67.65 khz 76.65 khz 92 khz 99 khz
LabVIEW Models of Computation Dataflow C HDL Code Textual Math Multi-Rate DSP Simulation Statechart LabVIEW LabVIEW LabVIEW LabVIEW `` Desktop Real-Time FPGA MPU/MCU Personal Computers PXI Systems CompactRIO Single-Board RIO Custom Design
Math with the LabVIEW 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 (Functions»Programming» Structures»MathScript) Prototype your equations in the interactive LabVIEW MathScript Window.
Frequency Demodulation Algorithm Detect phase Unwrap phase Differentiate phase
Exercise 3A Use a MathScript RT node
Communications Design in LabVIEW Modulation Toolkit Analog and Digital modulation formats AM, FM, PM ASK, FSK, MSK, GMSK, PAM, PSK, QAM Custom Visualization 2D and 3D Eye, Trellis, Constellation Modulation Analysis BER, MER, EVM, burst timing, frequency deviation, ρ (rho) Impairments Additive White Gaussian Noise (AWGN) DC offset, Quadrature skew, IQ gain imbalance, phase noise Equalization, Channel Coding, Channel Models
Exercise 3B Use Use Prebuilt IP
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
Downconversion Demodulation Channel Decoding Source Decoding Source Coding Channel Coding Modulation Upconversion Digital Communication System Communications Channel
Digital Communication System NI Modulation Toolkit NI Modulation Toolkit
Digital Communication System NI Modulation Toolkit NI USRP NI Modulation Toolkit NI USRP
Communications Design in LabVIEW Modulation Toolkit Analog and Digital modulation formats AM, FM, PM ASK, FSK, MSK, GMSK, PAM, PSK, QAM Custom Visualization 2D and 3D Eye, Trellis, Constellation Modulation Analysis BER, MER, EVM, burst timing, frequency deviation, ρ (rho) Impairments Additive White Gaussian Noise (AWGN) DC offset, Quadrature skew, IQ gain imbalance, phase noise Equalization, Channel Coding, Channel Models
Advanced Digital Communications Topics
Packet-based Communication Link System Setup RF Signal Center Frequency: 915MHz Modulation Format: PSK packets Bit Rate: 400kbps NI USRP-2920 Transmitter NI USRP-2920 Receiver USRP control (Tx & Rx) Modulate Tx signal Demodulate Rx signal Reconstruct message
Packet-based Communication with LabVIEW
Packet Structure GUARD BAND SYNC SEQ PCKT NUM DATA PAD Field Length [bits] Description Guard Band 30 Allow initialization of Rx PLL, filters, etc Sync Sequence 20 Frame and Symbol Synchronization Packet Number 8 Range: 0-255 Used for reordering of packets and detection of missing packets Data 64-256 Variable length data field. Length detected dynamically at Rx end Pad 20 Allows for filter edge effects.
Transmitter Block Diagram
The Received Signal
Receiver Block Diagram
Demonstration : Packet Based Transceiver
Digital Communications Bundle Bundle Contents Two NI USRP-2920 + Toolkits MIMO Cable Digital Comm Lab Manual Target Courses Communication Systems Digital & Wireless Communications Software Defined Radio (SDR) Key Benefits Affordable Accessible NI Supported TX & RX Real RF Signals Scales to Research
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 USRP Research Case Study: Physical Layer Prototyping Dr. Murat Torlak Continuously monitoring multiple wifi channels Demodulation and descrambling of 802.11b beacon signals Identification of hotspots, tracking relative power levels Demodulate Descramble 802.11b SSID Decoding Carrier Detection Frequency Offset Estimation & Correction Demodulation & Descrambling Interpret the frame for SSID
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
Next Steps Learn more about NI SDR and RF platforms Visit /sdr Download references from the Code sharing community Learn more about LabVIEW
NI LabVIEW Certifications Certified LabVIEW Architect Certified LabVIEW Developer On May 16 th, FREE Certified LabVIEW Associate Developer!! Certified LabVIEW Associate Developer
Thank you Questions