Practical Signals Theory with MATLAB® Applications
Transcript of Practical Signals Theory with MATLAB® Applications
Practical Signals Theory with
MATLAB® Applications
RICHARD J. TERVO
WILEY
Preface
Acknowledgments
1 Introduction to Signals and Systems 1.1 Introduction
1.1.1 What Is a Signal? 1.1.2 What Is a System?
1.2 Introduction to Signal Manipulation 1.2.1 Linear Combination 1.2.2 Addition and Multiplication of Signals 1.2.3 Visualizing Signals—An Important Skill 1.2.4 Introduction to Signal Manipulation Using MATLAB
Defining Signals Basic Plotting Commands Multiple Plots on One Figure
1.3 A Few Useful Signals 1.3.1 The Unit Rectangle rect(t) 1.3.2 The Unit Step M(i) 1.3.3 Reflection about t = 0 1.3.4 The Exponential ext
1.3.5 The Unit Impulse 6{t) Sketching the Unit Impulse The Sifting Property of 6{t) Sampling Function
1.4 The Sinusoidal Signal 1.4.1 The One-Sided Cosine Graph 1.4.2 Phase Change—Ф
1.5 Phase Change vs. Time Shift 1.5.1 Sine vs. Cosine 1.5.2 Combining Signals: The Gated Sine Wave 1.5.3 Combining Signals: A Dial Tone Generator
1.6 Useful Hints and Help with MATLAB 1.6.1 Annotat ing Graphs
1.7 Conclusions
2 Classification of Signals 2.1 Introduction 2.2 Periodic Signals
2.2.1 Sinusoid 2.2.2 Half-Wave Rectified Sinusoid 2.2.3 Full-WTave Rectified Sinusoid 2.2.4 Square Wave
Contents
2.2.5 Sawtooth Wave 35 2.2.6 Pulse Train 35 2.2.7 Rectangular Wave 36 2.2.8 Triangle Wave 37 2.2.9 Impulse Train 37
DC Component in Periodic Signals 38 2.3 Odd and Even Signals 38
2.3.1 Combining Odd and Even signals 40 2.3.2 The Constant Value s(t) = A 42 2.3.3 Trigonometric Identities 42 2.3.4 The Modulation Property 43
A Television Tuner Box 43 Squaring the Sinusoid 45
2.4 Energy and Power Signals 47 2.4.1 Periodic Signals = Power Signals 49
Vms Does not Equal А/ л/2 for All Periodic Signals 49 MATLAB Exercise 1: Computation of V ^ 50
2.4.2 Comparing Signal Power: The Decibel (dB) 51 2.5 Complex Signals 52
MATLAB Exercise 2: Complex Signals 54 2.6 Discrete Time Signals 56 2.7 Digital Signals 58 2.8 © Random Signals 58 2.9 Useful Hints and Help with MATLAB 60 2.10 Conclusions 61
Linear Systems 66 3.1 Introduction 66 3.2 Definition of a Linear System 67
3.2.1 Superposition 67 3.2.2 Linear System Exercise 1: Zero State Response 68
Zero Input -» Zero Output 68 3.2.3 Linear System Exercise 2: Operating in a Linear Region 69
Nonlinear Components 70 3.2.4 Linear System Exercise 3: Mixer 70
A System Is Defined by Its Response Function 70 3.2.5 Linear TimeJnvariant (LTI) Systems 71 3.2.6 Bounded Input, Bounded Output 72 3.2.7 System Behavior as a Black Box 72
3.3 Linear System Response Function h(t) 73 3.4 Convolution 73
3.4.1 The Convolution Integral 74 3.4.2 Convolution Is Commutative 76 3.4.3 Convolution Is Associative 77 3.4.4 Convolution Is Distributive over Addition 78 3.4.5 Evaluation of the Convolution Integral 78
Graphical Exercise 1: Convolution of a Rectangle with Itself 79 3.4.6 Convolution Properties 80
Graphical Exercise 2: Convolution of Two Rectangles 81 Graphical Exercise 3: Convolution of a Rectangle and an Exponential Decay 82 A Pulse Input Signal 82
Contents xi
3.4.7 Convolution with MATLAB 84 MATLAB Exercise l: Convolution of a Rectangle with Itself 84 MATLAB Exercise 2: Convolution of Two Rectangles 85 MATLAB Exercise 3: Convolution of a Rectangle with an Exponential Decay 86
3.5 Determining h(t) in an Unknown System 88 3.5.1 The Unit Impulse 6(0 Test Signal 88 3.5.2 Convolution and Signal Decomposition 89
Convolution and Periodic Signals 90 3.5.3 An Ideal Distortionless System 90
Deconvolution 90 3.6 Causality 91
3.6.1 Causality and Zero Input Response 92 3.7 Combined Systems 92
MATLAB Exercise 4. Systems in Series 93 3.8 © Convolution and Random Numbers 94 3.9 Useful Hints and Help with MATLAB 96 3.10 Chapter Summary 97 3.11 Conclusions 97
4 The Fourier Series 101 Chapter Overview 101
4.1 Introduction 101 4.2 Expressing Signals by Components 102
The Spectrum Analyzer 103 4.2.1 Approximating a Signal s(t) by Another: The Signal
Inner Product 104 4.2.2 Estimating One Signal by Another 105
4.3 Part One—Orthogonal Signals 106 4.4 Orthogonality 107
4.4.1 An Orthogonal Signal Space 107 Interpreting the Inner Product 109
4.4.2 The Signal Inner Product Formulation 109 4.4.3 Complete Set of Orthogonal Signals 110 4.4.4 What If a Complete Set Is Not Present? I l l 4.4.5 An Orthogonal Set of Signals 111
Defining Orthogonal Basis Signals 111 Confirming Orthogonal Basis Signals 112 Finding Orthogonal Components 113
4.4.6 Orthogonal Signals and Linearly Independent Equations 115 MATLAB Exercise 1: Evaluating an Inner Product 117
4.5 Part Two—The Fourier Series 118 4.5.1 A Special Set of Orthogonal Functions 118 4.5.2 The Fourier Series—An Orthogonal Set? 119
4.6 Computing Fourier Series Components 121 4.6.1 Fourier Series Approximation to an Odd Square Wave 121 4.6.2 Zero-Frequency (DC) Component 122
4.7 Fundamental Frequency Component 123 4.7.1 Higher-Order Components 124 4.7.2 Frequency Spectrum of the Square Wave s(t) 125
4.8 Practical Harmonics 126 4.8.1 The 60 Hz Power Line 126
xii Contents
4.8.2 Audio Amplifier Specs—Total Harmonic Distortion 127 4.8.3 The CB Radio Booster 127
4.9 O d d and Even Square Waves 128 4.9.1 The Fourier Series Components of an Even Square Wave 128
4.10 Gibb's P h e n o m e n o n 131 4.11 Setting Up the Fourier Series Calculation 132
4.11.1 Appearance of Pulse Train Frequency Components 134 Pulse Train with 10 Percent Duty Cycle 134 Pulse Train with 20 Percent Duty Cycle 134 Pulse Train with 50 Percent Duty Cycle (Square Wave) 136
4.12 Some Common Fourier Series 136 4.13 Part Three—The Complex Fourier Series 137
4.13.1 Not All Signals Are Even or Odd 137 4.14 The Complex Fourier Series 138
4.14.1 Complex Fourier Series—The Frequency Domain 139 4.14.2 Comparing the Real and Complex Fourier Series 142 4.14.3 Magnitude and Phase 142
4.15 Complex Fourier Series Components 143 4.15.1 Real Signals and the Complex Fourier Series 144 4.15.2 Stretching and Squeezing: Time vs. Frequency 144 4.15.3 Shift in Time 145 4.15.4 Change in Amplitude 146 4.15.5 Power in Periodic Signals 146
Find the Total Power in s(t) = A cos(t) + В sin(t) 147 4.15.6 Parseval's Theorem for Periodic Signals 147
4.16 Properties of the Complex Fourier Series 151 4.17 Analysis of a DC Power Supply 152
4.17.1 The DC Componen t 152 4.17.2 An AC-DC Converter 153 4.17.3 V-rms Is Always Greater Than or Equal to VdC 153 4.17.4 Fourier Series: The Full-Wave Rectifier 154 4.17.5 Complex Fourier Series Components Cn 155
MATLAB Exercise 2: Plotting Fourier Series Components 157 4.18 The Fourier Series with MATLAB 158
4.18.1 Essential Features of the fft() in MATLAB 158 1. Periodic Signals Are Defined on a Period of 2N Points 158 2. The Fourier Series Is Defined on 2 ~ —1
Frequency Components 159 4.18.2 Full-Wave Rectified Cosine (60 Hz) 160 4.18.3 Useful Hints and Help with MATLAB 162
4.19 Conclusions 165
The Fourier Transform 171 5.1 Introduction 171
5.1.1 A Fresh Look at the Fourier Series 172 Periodic and Nonperiodic Signals 172
5.1.2 Approximating a Nonperiodic Signal over All Time 173 5.1.3 Definition of the Fourier Transform 176 5.1.4 Existence of the Fourier Transform 177 5.1.5 The Inverse Fourier Transform 177
Contents xiii
5.2 Properties of the Fourier Transform 178 5.2.1 Linearity of the Fourier Transform 178 5.2.2 Value of the Fourier Transform at the Origin 179 5.2.3 Odd and Even Functions and the
Fourier Transform 180 5.3 The Rectangle Signal , 181
Alternate Solution 182 5.4 The Sine Function 182
5.4.1 Expressing a Function in Terms of sine(t) 184 5.4.2 The Fourier Transform of a General Rectangle 185 5.4.3 Magnitude of the Fourier Transform 188
5.5 Signal Manipulations: Time and Frequency 189 5.5.1 Amplitude Variations 189 5.5.2 Stretch and Squeeze: The Sine Function 189 5.5.3 The Scaling Theorem 190 5.5.4 Testing the Limits 191 5.5.5 A Shift in Time 192 5.5.6 The Shifting Theorem 193 5.5.7 The Fourier Transform of a Shifted Rectangle 194
Magnitude of G(/) 194 Phase of G(f) 195
5.5.8 Impulse Series—The Line Spectrum 196 5.5.9 Shifted Impulse 6(f-f0) 197 5.5.10 Fourier Transform of a Periodic Signal 197
5.6 Fourier Transform Pairs 198 5.6.1 The Illustrated Fourier Transform 200
5.7 Rapid Changes vs. High Frequencies 200 5.7.1 Derivative Theorem 201 5.7.2 Integration Theorem 202
5.8 Conclusions 203
Practical Fourier Transforms 206 6.1 Introduction 206 6.2 Convolution: Time and Frequency 206
The Logarithm Domain 207 6.2.1 Simplifying the Convolution Integral 207
6.3 Transfer Function of a Linear System 210 6.3.1 Impulse Response: The Frequency Domain 211 6.3.2 Frequency Response Curve 212
6.4 Energy in Signals: Parseval's Theorem for the Fourier Transform 213 6.4.1 Energy Spectral Density 214
6.5 Data Smoothing and the Frequency Domain 215 6.6 Ideal Filters 216
6.6.1 The Ideal Lowpass Filter Is Not Causal 219 6.7 A Real Lowpass Filter 220
MATLAB Example 1: First-Order Filter 223 6.8 The Modulation Theorem 224
6.8.1 A Voice Privacy System 226 Spectral Inversion 227
xiv Contents
6.9 Periodic Signals and the Fourier Transform 230 6.9.1 The Impulse Train 230 6.9.2 General Appearance of Periodic Signals 231 6.9.3 The Fourier Transform of a Square Wave 232
Changing the Pulse Train Appearance 232 6.9.4 Other Periodic Waveforms 233
6.10 The Analog Spectrum Analyzer 233 6.11 Conclusions 235
The Laplace Transform 240 7.1 Introduction 241 7.2 The Laplace Transform 241
7.2.1 The Frequency Term dui 243 7.2.2 The Exponential Term eat 243 7.2.3 The ^-Domain 243
7.3 Exploring the s-Domain 243 7.3.1 A Pole at the Origin 244
Graphing the Function H(s) = 1/'s 246 7.3.2 Decaying Exponential 246 7.3.3 A Sinusoid 249
The Generalized Cosine: A = cos(cut + Ф) 249 7.3.4 A Decaying Sinusoid 250 7.3.5 An Unstable System 251
7.4 Visualizing the Laplace Transform 251 7.4.1 First-Order Lowpass Filter 252 7.4.2 Pole Position Determines Frequency Response 254 7.4.3 Second-Order Lowpass Filter 256
Resonance Frequency 258 Multiple Poles and Zeros 258
7.4.4 Two-Sided Laplace Transform 258 7.4.5 The Bode Plot 260
Bode Plot—Multiple Poles and Zeros 261 Laplace Transform Exercise 1: Calculating the Laplace Transform 263
7.4.6 System Analysis in MATLAB 264 7.5 Properties of the Laplace Transform 267 7.6 Differential Equations 267
7.6.1 Solving a Differential Equation 268 Compound Interest 270
7.6.2 Transfer Function as Differential Equations 270 7.7 Laplace Transform Pairs 270
7.7.1 The Illustrated Laplace Transform 272 7.8 Circuit Analysis with the Laplace Transform 272
7.8.1 Voltage Divider 274 7.8.2 A First-Order Lowpass Filter 274 7.8.3 A First-Order Highpass Filter 277 7.8.4 A Second-Order Filter 278
Lowpass Filter 278 Bandpass Filter 279 Highpass Filter 280 Analysis of a Second-Order System 281 Series RLC Circuit Analysis 284
Contents xv
7.9 State Variable Analysis 7.9.1 State Variable Analysis—First-Order System 7.9.2 First-Order State Space Analysis with MATLAB 7.9.3 State Variable Analysis—Second-Order System 7.9.4 Matrix Form of the State Space Equations 7.9.5 Second-Order State Space Analysis with MATLAB 7.9.6 Differential Equation 7.9.7 State Space and Transfer Functions with MATLAB
7.10 Conclusions
285 286 287 288 290 291 292 293 295
Discrete Signals 301 8.1 Introduction 301 8.2 Discrete Time vs. Continuous Time Signals 301
8.2.1 Digital Signal Processing 302 8.3 A Discrete Time Signal 303
8.3.1 A Periodic Discrete Time Signal 303 8.4 Data Collection and Sampling Rate 304
8.4.1 The Selection of a Sampling Rate 304 8.4.2 Bandlimited Signal 305 8.4.3 Theory of Sampling 305 8.4.4 The Sampling Function 306 8.4.5 Recovering a Waveform from Samples 307 8.4.6 A Practical Sampling Signal 307 8.4.7 Minimum Sampling Rate 308 8.4.8 Nyquist Sampling Rate 310 8.4.9 The Nyquist Sampling Rate Is a Theoretical Minimum 310 8.4.10 Sampling Rate and Alias Frequency 312 8.4.11 Practical Aliasing 314 8.4.12 Analysis of Aliasing 316 8.4.13 Anti-Alias Filter 318
8.5 Introduction to Digital Filtering 319 8.5.1 Impulse Response Function 319 8.5.2 A Simple Discrete Response Function 319 8.5.3 Delay Blocks Are a Natural Consequence
of Sampling 321 8.5.4 General Digital Filtering 322 8.5.5 The Fourier Transform of Sampled Signals 323 8.5.6 The Discrete Fourier Transform (DFT) 325 8.5.7 A Discrete Fourier Series 326 8.5.8 Computing the Discrete Fourier Transform (DFT) 327 8.5.9 The Fast Fourier Transform (FFT) 328
8.6 Illustrative Examples 328 MATLAB Exercise 1: The FFT and the Inverse FFT 330
8.6.1 FFT and Sample Rate 332 8.6.2 Practical DFT Issues 333
Constructing the Ideal Discrete Signal 333 8.7 Discrete Time Filtering with MATLAB * 338
8.7.1 A Discrete Rectangle 338 8.7.2 A Cosine Test Signal 338 8.7.3 Check Calculation 339
8.8 Conclusions 340
xvi Contents
9 The z-Transf orm 344 9.1 Introduction 344 9.2 The z-Transform 344
9.2.1 Fourier Transform, Laplace Transform, and z-transform 345 9.2.2 Definition of die z-Transform 347 9.2.3 The z-Plane and the Fourier Transform 347
9.3 Calculating the z-Transform 348 9.3.1 Unit Step u[n] 350 9.3.2 Exponential an u[n] 352 9.3.3 Sinusoid cos(nu>(,) u[n] and sin(ww0) u[n] 353 9.3.4 Differentiation 355 9.3.5 The Effect of Sampling Rate 355
9.4 A Discrete Time Laplace Transform 356 9.5 Properties of the z-Transform 358 9.6 z-Transform Pairs 359 9.7 Transfer Function of a Discrete Linear System 359 9.8 MATLAB Analysis with the z-Transform 360
9.8.1 First-Order Lowpass Filter 360 9.8.2 Pole-Zero Diagram 362 9.8.3 Bode Plot 362 9.8.4 Impulse Response 363 9.8.5 Calculating Frequency Response 364 9.8.6 Pole Position Determines Frequency Response 366
9.9 Digital Filtering—FIR Filter 366 9.9.1 A One-Pole FIR Filter 367 9.9.2 A Two-Pole FIR Filter 368 9.9.3 Higher-Order FIR Filters 369
Frequency Response 369 Pole-Zero Diagram 370 Phase Response 370 Step Response 372
9.10 Digital Filtering—IIR Filter 373 9.10.1 A One-Pole IIR Filter 373 9.10.2 IIR versus FIR 374 9.10.3 Higher-Order IIR Filters 377 9.10.4 Combining FIR and IIR Filters 377
9.11 Conclusions 378
10 Introduction to Communications 381 10.1 Introduction , 381
10.1.1 A Baseband Signal m(t) 381 10.1.2 The Need for a Carrier Signal 382 10.1.3 A Carrier Signal c(t) 382 10.1.4 Modulation Techniques 383 10.1.5 The Radio Spectrum 383
10.2 Amplitude Modulation 385 10.2.1 Transmitted Carrier Double Sideband—(AM-TCDSB) 385
Contents xvii
10.2.2 Demodulation of AM Signals 388 10.2.3 Graphical Analysis 389 10.2.4 AM Demodulation—Diode Detector 391 10.2.5 Examples of Diode Detection 394
10.3 Suppressed Carrier Transmission 394 10.3.1 Demodulation of Single Sideband Signals 395 10.3.2 Percent Modulation and Overmodulation 397
10.4 Superheterodyne Receiver 398 10.4.1 An Experiment with Intermediate Frequency 400 10.4.2 When Receivers Become Transmitters 401 10.4.3 Image Frequency 401 10.4.4 Beat Frequency Oscillator 401
10.5 Digital Communications 402 10.5.1 Modulation Methods 403 10.5.2 Morse Code 403 10.5.3 On Off Keying (OOK) 406 10.5.4 Bandwidth Considerations 406 10.5.5 Receiving a Morse Code Signal 406
10.6 Phase Shift Keying 407 10.6.1 Differential Coding 407 10.6.2 Higher-Order Modulation Schemes 408
10.7 Conclusions 409
A The Illustrated Fourier Transform 411
В The Illustrated Laplace Transform 419
С The Illustrated z-Transform 425
D MATLAB Reference Guide 431 D.l Defining Signals 431
D.l.l MATLAB Variables 431 D.I.2 The Time Axis 432 D.1.3 Common Signals 432
D.2 Complex Numbers 433 D.3 Plot Commands 434 D.4 Signal Operations 434 D.5 Defining Systems 435
D.5.1 System Definition 435 1. Transfer Function 435 2. Zeros and Poles and Gain 437 3. State Space Model 437 4. Discrete Time Systems 437
D.5.2 System Analysis 437 D.6 Example System Definition and Test 438
xviii Contents
E Reference Tables 440 E.l Fourier Transform 440
E.l.l Fourier Transform Theorems 440 E.2 Laplace Transform 441
E.2.1 Laplace Transform Theorems 441 E.3 z-Transform 442
E.3.1 z-Transform Theorems 442
Bibliography 443
Index 445
The symbol © indicates advanced content that may be omitted without loss of continuity.