Digital Communication Systems Engineering with Software-Defined Radio Di Pu Alexander M. Wyglinski ARTECH HOUSE BOSTON LONDON artechhouse.com
Contents Preface xiii What Is an SDR? 1 1.1 Historical Perspective 1 1.2 Microelectronics Evolution and its Impact on Communications Technology 2 1.2.1 SDR Definition 3 1.3 Anatomy of an SDR 5 1.3.1 Design Considerations 6 1.4 Build it and they Will Come 7 1.4.1 Hardware Platforms 8 1.4.2 SDR Software Architecture 10 1.5 Chapter Summary 13 1.6 Additional Readings 13 References 13 Signals and Systems Overview 15 2.1 Signals and Systems 15 2.1.1 Introduction to Signals 15 2.1.2 Introduction to Systems 16 2.2 Fourier Transform 18 2.2.1 Introduction and Historical Perspective 19 2.2.2 Definition 20 2.2.3 Properties 20 2.3 Sampling Theory 23 2.3.1 Uniform Sampling 24 2.3.2 Frequency Domain Representation of Uniform Sampling 24 2.3.3 Nyquist Sampling Theorem 26 2.3.4 Sampling Rate Conversion 27 2.4 Pulse Shaping 30 2.4.1 Eye Diagrams 32 2.4.2 Nyquist Pulse Shaping Theory 32 2.4.3 Two Nyquist Pulses 34 2.5 Filtering 2.5.1 Ideal Filter 39 39 vii
viii Contents 2.5.2 Z-Transform 39 2.5.3 Digital Filtering 42 2.6 Chapter Summary 47 2.7 Problems 47 References 50 Probability Review 53 3.1 Fundamental Concepts 53 3.1.1 Set Theory 53 3.1.2 Partitions 54 3.1.3 Functions 56 3.1.4 Axioms and Properties of Probability 57 3.1.5 Conditional Probability 57 3.1.6 Law of Total Probability and Bayes' Rule 58 3.1.7 Independence 59 3.2 Random Variables 59 3.2.1 Discrete Random Variables 60 3.2.2 Continuous Random Variables 65 3.2.3 Cumulative Distribution Functions 69 3.2.4 Central Limit Theorem 70 3.2.5 The Bivariate Normal 71 3.3 Random Processes 72 3.3.1 Statistical Characteristics of Random Processes 74 3.3.2 Stationarity 76 3.3.3 Gaussian Processes 77 3.3.4 Power Spectral Density and LTI Systems 78 3.4 Chapter Summary 79 3.5 Additional Readings 80 3.6 Problems 80 References 88 Digital Transmission Fundamentals 89 4.1 What is Digital Transmission? 89 4.1.1 Source Encoding 91 4.1.2 Channel Encoding 92 4.2 Digital Modulation 94 4.2.1 Power Efficiency 94 4.2.2 Pulse Amplitude Modulation 95 4.2.3 Quadrature Amplitude Modulation 98 4.2.4 Phase Shift Keying 99 4.2.5 Power Efficiency Summary 104 4.3 Probability of Bit Error 105 4.3.1 Error Bounding 107
Contents ix 4.4 Signal Space Concept 108 4.5 Gram-Schmidt Orthogonalization 110 4.6 Optimal Detection 113 4.6.1 Signal Vector Framework 114 4.6.2 Decision Rules 116 4.6.3 Maximum Likelihood Detection in an AWGN Channel 117 4.7 Basic Receiver Realizations 119 4.7.1 Matched Filter Realization 120 4.7.2 Correlator Realization 122 4.8 Chapter Summary 124 4.9 Additional Readings 125 4.10 Problems 125 References 130 Basic SDR Implementation of a Transmitter and a Receiver 131 5.1 Software Implementation 131 5.1.1 Repetition Coding 132 5.1.2 Interleaving 134 5.1.3 BER Calculator 135 5.1.4 Receiver Implementation over an Ideal Channel 136 5.2 USRP Hardware Implementation 137 5.2.1 Frequency Offset Compensation 138 5.2.2 Finding Wireless Signals: Observing IEEE 802.11 WiFi Networks 140 5.2.3 USRP In-phase/Quadrature Representation 141 5.3 Open-Ended Design Project: Automatic Frequency Offset Compensator 145 5.3.1 Introduction 145 5.3.2 Objective 146 5.3.3 Theoretical Background 147 5.4 Chapter Summary 149 5.5 Problems 149 References 152 CHAPTER 6 Receiver Structure and Waveform Synthesis of a Transmitter and a Receiver 6.1 Software Implementation 6.1.1 Observation Vector Construction 6.1.2 Maximum-Likelihood Decoder Implementation 6.1.3 Correlator Realization of a Receiver in Simulink 6.2 USRP Hardware Implementation 6.2.1 Differential Binary Phase-Shift Keying 6.2.2 Differential Quadrature Phase-Shift Keying 6.2.3 Accelerate the Simulink Model that Uses USRP Blocks 6.3 Open-Ended Design Project: Frame Synchronization 6.3.1 Frame Synchronization 153 153 153 157 159 162 163 166 166 167 167
X Contents 6.3.2 Barker Code 168 6.3.3 Simulink Models 168 6.3.4 Hints for Implementation 172 6.3.5 Hints for Debugging 172 6.4 Chapter Summary 172 6.5 Problems 173 Reference 175 Multicarrier Modulation and Duplex Communications 177 7.1 Theoretical Preparation 177 7.1.1 Single Carrier Transmission 177 7.1.2 Multicarrier Transmission 181 7.1.3 Dispersive Channel Environment 183 7.1.4 OFDM with Cyclic Prefix 18 5 7.1.5 Frequency Domain Equalization 186 7.1.6 Bit and Power Allocation 187 7.2 Software Implementation 189 7.2.1 MATLAB Design of Multicarrier Transmission 189 7.2.2 Simulink Design of OFDM 192 7.3 USRP Hardware Implementation 194 7.3.1 Eye Diagram 194 7.3.2 Matched Filter Observation 195 7.4 Open-Ended Design Project: Duplex Communication 197 7.4.1 Duplex Communication 197 7.4.2 Half-Duplex 198 7.4.3 Time-Division Duplexing 198 7.4.4 Useful Suggestions 199 7.4.5 Evaluation and Expected Outcomes 200 7.5 Chapter Summary 201 7.6 Problems 201 References 204 Spectrum Sensing Techniques 207 8.1 Theoretical Preparation 207 8.1.1 Power Spectral Density 207 8.1.2 Practical Issues of Collecting Spectral Data 209 8.1.3 Hypothesis Testing 214 8.1.4 Spectral Detectors and Classifiers 218 8.2 Software Implementation 222 8.2.1 Constructing Energy Detector 222 8.2.2 Observing Cyclostationary Detector 226 8.3 USRP Hardware Experimentation 227 8.4 Open-Ended Design Project: CSMA/CA 230 8.4.1 Carrier Sense Multiple Access 230
Contents xi 8.4.2 Collision Avoidance 231 8.4.3 Implementation Approach 231 8.4.4 Useful Suggestions 232 8.4.5 Evaluation and Expected Outcomes 233 8.5 Chapter Summary 234 8.6 Problems 234 References 236 Applications of Software-Defined Radio 239 9.1 Cognitive Radio and Intelligent Wireless Adaptation 239 9.1.1 Wireless Device Parameters 241 9.2 Vehicular Communication Networks 242 9.2.1 VDSA Overview 243 9.2.2 Transmitter Design 244 9.2.3 Receiver Design 245 9.2.4 VDSA Test-Bed Implementation 245 9.3 Satellite Communications 246 9.4 Chapter Summary 250 References 250 Getting Started with MATLAB and Simulink 253 A.l MATLAB Introduction 253 A.2 Edit and Run a Program in MATLAB 253 A.3 Useful MATLAB Tools 254 A.3.1 Code Analysis and M-Lint Messages 254 A.3.2 Debugger 255 A.3.3 Profiler 256 A.4 Simulink Introduction 257 A. 5 Getting Started in Simulink 257 A.5.1 Start a Simulink Session 257 A.5.2 Start a Simulink Model 257 A.5.3 Simulink Model Settings 258 A.6 Build a Simulink Model 259 A.6.1 Obtain the Blocks 260 A.6.2 Set the Parameters 260 A.6.3 Connect the Blocks 262 A. 7 Run Simulink Simulations 264 References 266 Universal Hardware Driver (UHD) 267 B. l Setting Up Your Hardware 267 B.2 Installing UHD-Based USRP I/O Blocks 267 B.3 Burning the Firmware to an SD Card 268
xii Contents B.4 Configure the Ethernet Card 268 B.5 Modify the Iptables 269 B.6 Each Time You Use 269 B.7 Problems with Unicode 269 References 270 Data Flow on USRP 271 C. l Receive Path 271 C.l.l Situation 1 272 C. l.2 Situation 2 274 C.2 Transmit Path 274 References 276 Quick Reference Sheet 277 D. l LINUX 277 D. l.l Helpful Commands 277 D.l.2 Modify the Iptables 277 D.2 MATLAB 278 D.2.1 How to Start MATLAB 278 D.2.2 The MATLAB Environment 278 D.2.3 Obtaining Help 278 D.2.4 Variables in MATLAB 278 D.2.5 Vectors and Matrices in MATLAB 279 D.3 USRP2 Hardware 279 D.3.1 XCVR2450 Daughtercard 279 D.3.2 Sampling 280 D.3.3 Clocking 281 D.3.4 DDCandDUC 281 D.4 Differential Phase-Shift Keying (DPSK) 282 Reference 282 Trigonometric Identities 283 About the Author 285 Index 287