Top Banner
Communication Systems Modelling and Simulation Using MATLAB® and Simulink® К С Raveendranathan Professor and Head Department of Electronics & Communication Engineering Government Engineering College Barton Hill Thiruvananthapuram 695 035 Universities Press CRC Press Taylor & Francis Croup Boca Raton London New York CRC is an imprint of the Taylor St Francis Croup, an informa business
11

Communication Systems Modelling and Simulation

May 08, 2022

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Communication Systems Modelling and Simulation

Communication Systems

Modelling and Simulation

Using MATLAB® and Simulink®

К С Raveendranathan Professor and Head

Department of Electronics & Communication Engineering Government Engineering College Barton Hill

Thiruvananthapuram 695 035

Universities Press

<® CRC Press Taylor & Francis C r o u p Boca Raton London New York

CRC is an imprint of the Taylor St Francis Croup, an informa business

Page 2: Communication Systems Modelling and Simulation

Contents

Preface

1 Introduction to Systems, Models and Simulations 1.1 Systems Simulation: The Shortest Route to Applications

1.1.1 Introduction 1.1.2 Computer Simulation

1.2 Modelling and Simulation 1.3 Types of Simulations

1.3.1 Discrete Event Simulation 1.3.2 Continuous Simulation 1.3.3 Steady State Simulation 1.3.4 Random Event simulation 1.3.5 Social Simulation 1.3.6 Web Enabled Simulation 1.3.7 Parallel and Distributed Simulation

1.4 Discrete Event Systems (DES) 1.5 Determination of Time to Reach Steady State 1.6 Determination of the Desirable Number of Trials 1.7 Selection of Simulation Software 1.8 High Performance Simulation Tools 1.9 Conclusion Further Reading

2 Introduction to Programming in MATLAB 2.1 Introduction to MATLAB 2.2 Basic Features of MATLAB

2.2.1 Starting MATLAB 2.3 Notation, Syntax, and Operations

2.3.1 Variable names in MATLAB 2.3.2 Numerical Conventions

vi i

Page 3: Communication Systems Modelling and Simulation

viii Contents

2.4 Importing and Exporting Information 23 2.4.1 Command Line Import 23 2.4.2 The Import Wizard 23 2.4.3 Other Import Functions 24 2.4.4 Export Functions 25

2.5 Elements of MATLAB Programming 26

2.5.1 Special Built-in Constants 26 2.5.2 Linear Algebra 27 2.5.3 Trigonometric Functions 29

2.5.4 Hyperbolic Functions 30 2.5.5 Logical Functions 30 2.5.6 Exponential and Logarithmic Functions 31 2.5.7 Complex Functions 31 2.5.8 Round-off Functions 31 2.5.9 Matrix Functions 32 2.5.10 Polynomial Functions 32 2.5.11 String Functions 32

2.6 Plotting with MATLAB 33 2.6.1 Specialised Plotting 35 2.6.2 Plot Enhancement Commands 37 2.6.3 Exporting of MATLAB Figures to Files 38 2.6.4 Exporting of MATLAB Figures to Clipboard 38

2.7 Specific Features of MATLAB 40 2.7.1 M-files 40 2.7.2 P-Code 40 2.7.3 M-Book 41 2.7.4 Control Flow 41 2.7.5 Interactive Input 41

2.8 Special MATLAB Functions 42 2.8.1 Statistical Functions 42 2.8.2 Signal Processing Functions 43 2.8.3 Control System Functions 46 2.8.4 Numerical Computations in MATLAB 46 2.8.5 MATLAB Symbolic Math Toolbox 47

2.9 Getting MATLAB Help Online 51 2.10 Generating Executable Files in MATLAB 51 2.11 Compiling and Calling External files from MATLAB 52 2.12 Calling MATLAB Objects from External Programs 54

2.13 Using Java Classes in MATLAB 54 2.14 The MATLAB GUIDE 55

Page 4: Communication Systems Modelling and Simulation

Contents •

2.14.1 Editing a GUI 2.14.2 Code Attachment Process 2.14.3 Executing the GUI

2.15 Writing Efficient MATLAB Code 2.15.1 The MATLAB Profiler 2.15.2 Array Pre-allocation 2.15.3 JIT Acceleration 2.15.4 Vectorisation 2.15.5 Mining Simple Functions 2.15.6 Referencing Operations

2.15.7 Numerical Integration 2.15.8 Speeding Up Signal Processing 2.15.9 Miscellaneous Tricks

2.16 MATLAB Clones 2.17 Parallel MATLAB

2.17.1 Embarrassingly Parallel System 2.17.2 Message Passing System 2.17.3 Back-End Support System 2.17.4 MATLAB Compilers 2.17.5 Shared Memory System

2.18 Conclusion Further Reading Problems

Simulink 3.1 Simulink as a Tool for Model-Based Design 3.2 Invoking Simulink 3.3 Concept of Signal and Logic Flow

3.3.1 Connecting Blocks 3.3.2 Sources and Sinks 3.3.3 Continuous and Discrete Systems 3.3.4 Discontinuities in Simulink 3.3.5 Using Functions (written as .m, .c, .cpp, etc) 3.3.6 Modelling a First Order System in Simulink 3.3.7 Modelling a Second Order System 3.3.8 Simulating the Response of a Transfer Function 3.3.9 Modelling an Amplitude Modulator in Simulink 3.3.10 Modelling a Zero-Crossing Detector in Simulink

3.4 Creating Sub-systems in Simulink 3.4.1 Creating a Sub-system by Adding the Sub-system Block

Page 5: Communication Systems Modelling and Simulation

X Contents

3.4.2 Creating a Sub-system by Grouping Existing Blocks 104 3.4.3 Undoing a Sub-system 105

3.5 Conclusion 105 Further Reading 106 Problems 106

Simulation of Signals and Systems 110 4.1 Continuous Time and Discrete Time Signals 110

4.1.1 Basic Operations on Signals 112 4.2 Periodic Signals and Sequences 115 4.3 Even and Odd Signals 116

4.3.1 Signal Decomposition 117 4.4 Elementary Signals 119

4.4.1 Continuous Time Complex Exponential Signal 119 4.4.2 Discrete Time Complex Exponential Sequences 126 4.4.3 Periodicity of Discrete Time Complex Exponential Sequences 131

4.4.4 Unit Impulse and Unit Step Functions and Sequences 132 4.4.5 Continuous Time and Discrete Time Systems 137

4.5 Basic Properties of Systems 137 4.5.1 Memory 137 4.5.2 Invertibility of Systems 138 4.5.3 Causality of Systems 138 4.5.4 Stability of Systems 139 4.5.5 Time Invariance 140 4.5.6 Linearity of Systems 140

4.6 Linear Time Invariant Systems 140 4.6.1 Discrete Time LTI Systems and the Convolution Sum 140 4.6.2 LTI Systems and the Convolution Integral 141 4.6.3 Properties of LTI Systems 142

4.6.4 Unit Step Response of an LTI System 145 4.6.5 Linear Differential/Difference Equations 146

4.7 The Fourier Series Representation 147 4.7.1 A History of the Fourier Series and Transform 147 4.7.2 Response of LTI Systems to Complex Exponentials 150 4.7.3 Fourier Series Representation of Continuous Time Periodic Signals 152 4.7.4 Properties of Continuous Time Fourier Series 155 4.7.5 Fourier Series Representation of Discrete Time Periodic Sequences 158

4.7.6 Properties of Discrete Time Fourier Series 159 4.8 Fourier Transform of Aperiodic Signals 159

4.8.1 Convergence of Fourier Transforms 160

Page 6: Communication Systems Modelling and Simulation

Contents \\

4.8.2 Properties of Fourier Transforms 161 4.8.3 Systems Characterised by Differential Equations 165 4.8.4 The Fourier Transform of Periodic Signals 166

4.9 The Discrete Time Fourier Transform (DTFT) 167 4.9.1 Properties of Di screte Time Fourier Transform 168 4.9.2 Systems Characterised by Difference Equations 171

4.10 Nyquist-Shannon Sampling Theorem 171 4.10.1 Mathematical Proof of Sampling Theorem 177 4.10.2 Aliasing 177 4.10.3 Effects of Aliasing 177 4.10.4 Avoidance of Aliasing 179

4.11 Signal Reconstruction 179 4.11.1 The Exact Reconstruction Procedure 180

4.12 The Bilateral Laplace Transform 180 4.12.1 Region of Convergence (ROC) 182 4.12.2 Unilateral Laplace Transform 182 4.12.3 Properties of Laplace Transform 183

4.13 Analysis of LTI Systems Using Laplace Transforms 185 4.13.1 Causality of LTI Systems 186 4.13.2 Stability of an LTI System 188

4.14 The Z-Transform 189 4.14.1 Region of Convergence 190 4.14.2 Inverse Z-Transform 192 4.14.3 Properties of Z-Transform 193

4.15 Analysis of LTI Systems Using Z-Transforms 195 4.15.1 Causality 196 4.15.2 Stability 196 4.15.3 Unilateral Z-Transforms 197

4.16 The Discrete Fourier Transform (DFT) 198 4.17 Conclusion 200 Further Reading 201 Problems 201

5 Simulation of Analog Modulation Systems 205 5.1 Introduction 205

5.1.1 Amplitude Modulation (AM) 206 5.1.2 Amplitude Generation and Demodulation 206

5.2 Mathematical Model of AM 206 5.2.1 Amplitude Modulation with Multiple Sinusoidal Signals 207

5.2.2 Power Contained in AM Components 208

Page 7: Communication Systems Modelling and Simulation

xii Contents

5.3 Simulation of Amplitude Modulation 209 5.3.1 AM Generation—User Defined M-file 210 5.3.2 AM Generation—Using Library Functions 211

5.4 Simulation of Other Variants of AM 212 5.4.1 Simulation of DSBSC 213 5.4.2 Simulation of SSB Modulation 214

5.5 Frequency Spectra 217 5.6 Demodulation of Amplitude Modulation 218

5.6.1 Demodulation of an SSB Modulation 220 5.7 Noise Performance 221

5.7.1 Normalised Transmission Bandwidth 222 5.7.2 Noise in Baseband Systems 222 5.7.3 Noise in AM Receivers 223 5.7.4 Noise in Coherent DSBSC Receivers 226 5.7.5 Noise in SSB Receivers 227 5.7.6 Vestigial Sideband (VSB) System 228

5.8 Measurement of Noise Performance 228 5.8.1 Methods of Measuring Receiver Sensitivity 228 5.8.2 Points to Note while Measuring SNR 229

5.9 Conclusion 230 Further Reading 231 Problems 231

Simulation of Angle Modulation Systems 235 6.1 Frequency Modulation (FM) 235

6.1.1 The Frequency Spectrum of FM 236 6.2 Simulation of Frequency Modulation Using MATLAB 241

6.2.1 Use of m o d u l a t e (. ) Function to Generate FM 242 6.2.2 Frequency Modulation and Demodulation Using Communications Toolbox 243

6.2.3 The FM Radio Frequency Band 244 6.2.4 Bandwidth Requirements for FM 245 6.2.5 Carson's Rule on FM Bandwidth 245 6.2.6 Average Power Contained in a Sinusoidal FM 246

6.3 Phase Modulation (PM) 246 6.3.1 Comparison of FM and PM Waveforms 247 6.3.2 Simulation of Phase Modulation and Demodulation Using Communications

Toolbox 250 6.3.3 Comparison Between Angle Modulations 251 6.3.4 Bandwidth Requirements for PM 253 6.3.5 Comparison Between FM and AM 254

Page 8: Communication Systems Modelling and Simulation

Contents xiii

6.4 FM Transmission and Noise 255 6.5 Noise in FM Receivers 255

6.5.1 Carrier-to-Noise Ratio 257 6.5.2 Processing Gain 257

6.6 Threshold Effect in FM Systems 258 6.6.1 FM Threshold Reduction 258 6.6.2 Comparison of Noise Performance in Continuous Wave Systems 258 6.6.3 Pre-emphasis and De-emphasis 258

6.7 Conclusion 260 Further Reading 260 Problems 261

7 Simulation of Digital Modulation Systems 265 7.1 Introduction to Digital Modulation 265

7.1.1 Trading-off Simplicity and Bandwidth 266 7.1.2 Comparison of Analog Modulation Schemes with Digital Modulation 267

7.2 Quadrature Signals 267 7.2.1 Representing Real Signals Using Complex Phasors 268

7.2.2 Representing Quadrature Signals in the Frequency Domain 268 7.2.3 The I/Q Formats in Digital Communication 269 7.2.4 The I and Q Components in a Radio Transmitter 270 7.2.5 The I and Q Components in a Radio Receiver 270 7.2.6 The Need for I/Q Components 271

7.3 Digital Modulation of a Carrier Wave 271 7.3.1 Introduction to Digital Basebands 271 7.3.2 Amplitude Shift Keying (ASK) 272 7.3.3 Frequency Shift Keying (FSK) 275 7.3.4 Binary Phase Shift Keying (PSK) 279 7.3.5 Differential Phase Shift Keying (DPSK) 281 7.3.6 M-ary Phase Shift Keying (MPSK) 284 7.3.7 Quadrature Amplitude Modulation (QAM) 290 7.3.8 Minimum Shift Keying (MSK) 293

7.3.9 Simulation of MSK Waveforms 294 7.3.10 Gaussian Minimum Shift Keying (GMSK) 298 7.3.11 Theoretical Bandwidth Efficiency Limits 300 7.3.12 Performance Comparison and Applications 301 7.3.13 The Competing Goals of Spectral Efficiency and Power Consumption 303 7.3.14 Square-Root-Raised-Cosine Filter (SRRC) 304 7.3.15 The Raised-Cosine Filter (RCF) 305 7.3.16 Eye Diagrams 306

Page 9: Communication Systems Modelling and Simulation

xiv Contents

7.3.17 Probability of Bit Error 309 7.4 Pulse Modulation Schemes 310

7.4.1 Pulse Amplitude Modulation (РАМ) 310 7.4.2 Pulse Width Modulation (PWM) 312 7.4.3 Pulse Position Modulation (PPM) 314

7.5 Pulse Code Modulation (PCM) 316 7.5.1 Sampling 317 7.5.2 Linear/Uniform Quantisation 318 7.5.3 Non-Linear/Non-Uniform Quantisation 321 7.5.4 Companding 321 7.5.5 Differential Pulse Code Modulation (DPCM) 323 7.5.6 Adaptive Differential PCM (ADPCM) 324 7.5.7 Delta Modulation (DM) 325 7.5.8 Adaptive Delta Modulation (ADM) 328 7.5.9 Sigma Delta Modulation (SDM) 328 7.5.10 Continuously Variable Slope Delta Modulation (CVSD) 330 7.5.11 Performance Comparison and Applications 332

7.6 Conclusion 332 Further Reading 334 Problems 335

8 Probability and Random Processes 337 8.1 Introduction 337 8.2 Axioms of Probability 338

8.2.1 Mutually Exclusive Events 339 8.2.2 Definitions of Probability 340 8.2.3 Simulation of Random Experiments in MATLAB 341

8.3 Probability Space 345 8.3.1 Joint Probability 346 8.3.2 Equality of Events 346 8.3.3 Conditional Probability 346

8.4 Statistical Independence of Events 348 8.5 Random Variables 349 8.6 The Discrete Random Variable 349

8.6.1 The Probability Mass Function (PMF) 349 8.6.2 The Cumulative Distribution Function (CDF) 350 8.6.3 The cdf ( . ) Function in Statistics Toolbox 351

8.7 The Continuous Random Variable 352 8.7.1 The Probability Density Function (PDF) 352 8.7.2 The pdf (. ) Function in Statistics Toolbox 353

Page 10: Communication Systems Modelling and Simulation

Contents XV

8.8 Some Discrete Random Variables 353 8.8.1 The Bernoulli Random Variable 353 8.8.2 The Binomial Random Variable 354 8.8.3 The Poisson Random Variable 355 8.8.4 The Geometric Random Variable 356 8.8.5 The Pascal Random Variable 358

8.9 Some Continuous Random Variables 358 8.9.1 The Gaussian Random Variable 358 8.9.2 The normcdf ( . ) and normpdf ( . ) Functions 360 8.9.3 The Log-normal Random Variable 362 8.9.4 The Uniform Random Variable 364 8.9.5 The Exponential Random Variable 365 8.9.6 The Laplace Random Variable 366

8.9.7 The Gamma Random Variable 367 8.9.8 The Erlang Random Variable 369 8.9.9 The x2 Random Variable 371 8.9.10 The Rayleigh Random Variable 372 8.9.11 The Rician Random Variable 374 8.9.12 The Cauchy Random Variable 375 8.9.13 The Weibull Random Variable 377 8.9.14 The Nakagami-m Random Variable 379 8.9.15 The Nakagami-q Random Variable 381 8.9.16 The Logistic Random Variable 384 8.9.17 The Log-logistic Random Variable 386 8.9.18 The Hyperbolic Secant Random Variable 387

8.10 Random Number Generators 389 8.10.1 Pseudo Random Number Generators (PRNGs) 389 8.10.2 True Random Number Generators (TRNGs) 390 8.10.3 Algorithms for Pseudo Random Number Generation 390 8.10.4 Random Number Generation in MATLAB 395

8.11 The Expected Value (Mean) of a Random Variable 395 8.11.1 Expected Values of Functions of Random Variables 397

8.12 Conditional Distribution and Density Functions 397

8.13 Conditional Expected Values 398 8.13.1 Computing Expectations by Conditioning 398

8.14 The Variance and Standard Deviation 399 8.14.1 Computing Variances by Conditioning 400

8.15 Operations on a Random Variable 400

8.15.1 Moments 400 8.15.2 Central Moments 401

Page 11: Communication Systems Modelling and Simulation

xvi Contents

8.16 Transformations of Random Variables 402 8.16.1 Monotonically Increasing Functions 402 8.16.2 Monotonically Decreasing Functions 403 8.16.3 Non-monotonic Functions 403

8.17 Characteristic Functions 404 8.18 Probability Generating Functions (PGF) 405 8.19 Moment Generating Functions 406

8.19.1 Markov's Inequality 407 8.19.2 Chebyshev's Inequality 407 8.19.3 Chernoff Bound 408

8.20 Joint Probability Distribution Functions 408 8.21 Joint Probability Density Functions 409 8.22 Joint Probability Mass Functions 410 8.23 Independent Random Variables 410

8.23.1 The Correlation Between Two Random Variables 411 8.23.2 The Covariance 411 8.23.3 The Correlation Coefficient 411 8.23.4 The Joint Moment 411 8.23.5 The Joint Central Moment 412

8.24 Jointly Gaussian Random Variables 412 8.24.1 Properties of Jointly Gaussian Random Variables 413

8.25 The Central Limit Theorem 414 8.26 Random Processes 414

8.26.1 Strict Sense Stationary Random Process 414 8.26.2 Wide Sense Stationary Random Process 415

8.27 Conclusion 416 Further Readi ng 417 Problems 417

Index 419