biosignal and medical image processing
TRANSCRIPT
BIOSIGNAL and MEDICAL IMAGE PROCESSING
h i r d E d i t i o n
JOHN L SEMMLOW BENJAMIN GRIFFEL
(nC\ CRC Press \Cf^ J Taylor & Francis Group
^ ^ ^ ^ - ^ Boca Raton London New York
CRC Press is an imprint of the Taylor & Francis Group, an informa business
Contents
Preface xv Acknowledgments xix Authors xxi
Chapter 1 Introduction 1
1.1 Biosignals 1 1.2 Biosignal Measurement Systems 3 1.3 Transducers 4 1.4 Amplifier/Detector 6 1.5 Analog Signal Processing and Filters 7
1.5.1 Filter Types 8 1.5.2 Filter Bandwidth 9 1.5.3 Filter Order 9 1.5.4 Filter Initial Sharpness 12
1.6 ADC Conversion 13 1.6.1 Amplitude Slicing 15 1.6.2 Time Slicing 18 1.6.3 Edge Effects ( 22 1.6.4 Buffering and Real-Time Data Processing 24
1.7 Data Banks 24 1.8 Summary 24 Problems 25
Chapter 2 Biosignal Measurements, Noise, and Analysis 29
2.1 Biosignals 29 2.1.1 Signal Encoding 30 2.1.2 Signal Linearity, Time Invariance, Causality 31
2.1.2.1 Superposition 32 2.1.3 Signal Basic Measurements 33 2.1.4 Decibels 37 2.1.5 Signal-to-Noise Ratio 37
2.2 Noise 38 2.2.1 Noise Sources 39 2.2.2 Noise Properties: Distribution Functions 40 2.2.3 Electronic Noise 42
2.3 Signal Analysis: Data Functions and Transforms 44 2.3.1 Comparing Waveforms 45
2.3.1.1 Vector Representation 46
VII
Contents
2.3.1.2 Orthogonality 48 2.3.1.3 Basis Functions 50
2.3.2 Correlation-Based Analyses 52 2.3.2.1 Correlation and Covariance 53 2.3.2.2 Matrix of Correlations 54 2.3.2.3 Cross-Correlation 56 2.3.2.4 Autocorrelation 59 2.3.2.5 Autocovariance and Cross-Covariance 62
2.3.3 Convolution and the Impulse Response 64 2.4 Summary 70 Problems 71
Chapter 3 Spectral Analysis: Classical Methods 77
3.1 Introduction 77 3.2 Fourier Series Analysis 79
3.2.1 Periodic Functions 81 3.2.1.1 Symmetry 88
3.2.2 Complex Representation 88 3.2.3 Data Length and Spectral Resolution 92
3.2.3.1 Aperiodic Functions 94 3.2.4 Window Functions: Data Truncation 95
3.3 Power Spectrum 101 3.4 Spectral Averaging: Welch's Method 105 3.5 Summary I l l Problems I l l
Chapter 4 Noise Reduction and Digital Filters 119
4.1 Noise Reduction 119 4.2 Noise Reduction through Ensemble Averaging 120 4.3 Z-Transform 123
4.3.1 Digital Transfer Function 124 4.4 Finite Impulse Response Filters 127
4.4.1 FIR Filter Design and Implementation 131 4.4.2 Derivative Filters: Two-Point Central Difference
Algorithm 141 4.4.2.1 Determining Cutoff Frequency and Skip Factor 144
4.4.3 FIR Filter Design Using MATLAB 145 4.5 Infinite Impulse Response Filters 148
4.5.1 IIR Filter Implementation 150 4.5.2 Designing IIR Filters with MATLAB 151
4.6 Summary 155 Problems 155
Chapter 5 Modern Spectral Analysis: The Search for Narrowband Signals 163
5.1 Parametric Methods 163 5.1.1 Model Type and Model Order 164
viii
Contents
5.1.2 Autoregressive Model 166 5.1.3 Yule-Walker Equations for the AR Model 169
5.2 Nonparametric Analysis: Eigenanalysis Frequency Estimation 174 5.2.1 Eigenvalue Decomposition Methods 175 5.2.2 Determining Signal Subspace and Noise Subspace
Dimensions 176 5.2.3 MATLAB Implementation 176
5.3 Summary 185 Problems 186
Chapter 6 Time-Frequency Analysis 193
6.1 Basic Approaches 193 6.2 The Short-Term Fourier Transform: The Spectrogram 193
6.2.1 MATLAB Implementation of the STFT 194 6.3 The Wigner-Ville Distribution: A Special Case of Cohen's Class 200
6.3.1 The Instantaneous Autocorrelation Function 200 6.3.2 Time-Frequency Distributions 202 6.3.3 The Analytic Signal 207
6.4 Cohen's Class Distributions 208 6.4.1 The Choi-Williams Distribution 208
6.5 Summary 212 Problems 214
Chapter 7 Wavelet Analysis 217
7.1 Introduction 217 7.2 Continuous Wavelet Transform 218
7.2.1 Wavelet Time-Frequency Characteristics 220 7.2.2 MATLAB Implementation 222
7.3 Discrete Wavelet Transform 225 7.3.1 Filter Banks 226
7.3.1.1 Relationship between Analytical Expressions and Filter Banks 230
7.3.2 MATLAB Implementation 231 7.3.2.1 Denoising' 234 7.3.2.2 Discontinuity Detection 236
7.4 Feature Detection: Wavelet Packets 237 7.5 Summary 243 Problems 244
Chapter 8 Optimal and Adaptive Filters 247
8.1 Optimal Signal Processing: Wiener Filters 247 8.1.1 MATLAB Implementation 250
8.2 Adaptive Signal Processing 254 8.2.1 ALE and Adaptive Interference Suppression 256 8.2.2 Adaptive Noise Cancellation 257 8.2.3 MATLAB Implementation 258
IX
Contents
8.3 Phase-Sensitive Detection 263 8.3.1 AM Modulation 263 8.3.2 Phase-Sensitive Detectors 265 8.3.3 MATLAB Implementation 267
8.4 Summary 269 Problems 270
Chapter 9 Multivariate Analyses: Principal Component Analysis and Independent Component Analysis 273
9.1 Introduction: Linear Transformations 273 9.2 Principal Component Analysis 276
9.2.1 Determination of Principal Components Using Singular-Value Decomposition 278
9.2.2 Order Selection: The Scree Plot 279 9.2.3 MATLAB Implementation 279
9.2.3.1 Data Rotation 279 9.2.4 PCA in MATLAB 280
9.3 Independent Component Analysis 284 9.3.1 MATLAB Implementation 291
9.4 Summary 293 Problems 294
Chapter 10 Chaos and Nonlinear Dynamics 297
10.1 Nonlinear Systems 297 10.1.1 Chaotic Systems 298 10.1.2 Types of Systems 301 10.1.3 Types of Noise 302 10.1.4 Chaotic Systems and Signals 303
10.2 Phase Space 304 10.2.1 Iterated Maps 308 10.2.2 The Henon Map 308 10.2.3 Delay Space Embedding 311 10.2.4 The Lorenz Attractor 313
10.3 Estimating the Embedding Parameters 315 10.3.1 Estimation of the Embedding Dimension Using
Nearest Neighbors 316 10.3.2 Embedding Dimension: SVD 323
10.4 Quantifying Trajectories in Phase Space: The Lyapunov Exponent 324 10.4.1 Goodness of Fit of a Linear Curve 326 10.4.2 Methods of Determining the Lyapunov Exponent 327 10.4.3 Estimating the Lyapunov Exponent Using Multiple
Trajectories 330 10.5 Nonlinear Analysis: The Correlation Dimension 335
10.5.1 Fractal Objects 335 10.5.2 The Correlation Sum 337
10.6 Tests for Nonlinearity: Surrogate Data Analysis 345
x
Contents
10.7 Summary 353 Exercises 353
Chapter 11 Nonlinearity Detection: Information-Based Methods 357
11.1 Information and Regularity 357 11.1.1 Shannon's Entropy Formulation 358
11.2 Mutual Information Function 359 11.2.1 Automutual Information Function 364
11.3 Spectral Entropy 370 11.4 Phase-Space-Based Entropy Methods 374
11.4.1 Approximate Entropy 374 11.4.2 Sample Entropy 378 11.4.3 Coarse Graining 381
11.5 Detrended Fluctuation Analysis 385 11.6 Summary 389 Problems 390
Chapter 12 Fundamentals of Image Processing: The MATLAB Image Processing Toolbox 393
12.1 Image-Processing Basics: MATLAB Image Formats 393 12.1.1 General Image Formats: Image Array Indexing 393 12.1.2 Image Classes: Intensity Coding Schemes 395 12.1.3 Data Formats 396 12.1.4 Data Conversions 397
12.2 Image Display 399 12.3 Image Storage and Retrieval 404 12.4 Basic Arithmetic Operations 404 12.5 Block-Processing Operations 411
12.5.1 Sliding Neighborhood Operations 411 12.5.2 Distinct Block Operations 415
12.6 Summary 416 Problems 418
Chapter 13 Image Processing: Filters, Transformations, and Registration 421
13.1 Two-Dimensional Fourier Transform 421 13.1.1 MATLAB Implementation 423
13.2 Linear Filtering 425 13.2.1 MATLAB Implementation 426 13.2.2 Filter Design 427
13.3 Spatial Transformations 4 433 13.3.1 Affine Transformations 434
13.3.1.1 General Affine Transformations 436 13.3.2 Projective Transformations 437
13.4 Image Registration 441 13.4.1 Unaided Image Registration 442 13.4.2 Interactive Image Registration 445
XI
Contents
13.5 Summary 447 Problems 448
Chapter 14 Image Segmentation 451
14.1 Introduction 451 14.2 Pixel-Based Methods 451
14.2.1 Threshold Level Adjustment 452 14.2.2 MATLAB Implementation 455
14.3 Continuity-Based Methods 456 14.3.1 MATLAB Implementation 457
14.4 Multithresholding 463 14.5 Morphological Operations 465
14.5.1 MATLAB Implementation 466 14.6 Edge-Based Segmentation 472
14.6.1 Hough Transform 473 14.6.2 MATLAB Implementation 474
14.7 Summary 477 Problems 479
Chapter 15 Image Acquisition and Reconstruction 483
15.1 Imaging Modalities 483 15.2 CT, PET, and SPECT 483
15.2.1 Radon Transform 484 15.2.2 Filtered Back Projection 486 15.2.3 Fan Beam Geometry 489 15.2.4 MATLAB Implementation of the Forward and Inverse
Radon Transforms: Parallel Beam Geometry 489 15.2.5 MATLAB Implementation of the Forward and Inverse
Radon Transforms: Fan Beam Geometry 492 15.3 Magnetic Resonance Imaging 494
15.3.1 Magnetic Gradients 497 15.3.2 Data Acquisition: Pulse Sequences 497
15.4 Functional MRI 499 15.4.1 fMRI Implementation in MATLAB 501 15.4.2 Principal Component and ICA 503
15.5 Summary 506 Problems 508
Chapter 16 Classification I: Linear Discriminant Analysis and Support Vector Machines 511
16.1 Introduction 511 16.1.1 Classifier Design: Machine Capacity 514
16.2 Linear Discriminators 515 16.3 Evaluating Classifier Performance 520 16.4 Higher Dimensions: Kernel Machines 525 16.5 Support Vector Machines 527
16.5.1 MATLAB Implementation 530
XII
Contents
16.6 Machine Capacity: Overfitting or "Less Is More" 534 16.7 Extending the Number of Variables and Classes 536 16.8 Cluster Analysis 537
16.8.1 fc-Nearest Neighbor Classifier 538 16.8.2 k-Means Clustering Classifier 540
16.9 Summary 544 Problems 545
Chapter 17 Classification II: Adaptive Neural Nets 549
17.1 Introduction 549 17.1.1 Neuron Models 549
17.2 Training the McCullough-Pitts Neuron 552 17.3 The Gradient Decent Method or Delta Rule 557 17.4 Two-Layer Nets: Back Projection 561 17.5 Three-Layer Nets 565 17.6 Training Strategies 568
17.6.1 Stopping Criteria: Cross-Validation 568 17.6.2 Momentum 569
17.7 Multiple Classifications 573 17.8 Multiple Input Variables 575 17.9 Summary 577 Problems 578
Appendix A: Numerical Integration in MATLAB 581
Appendix B: Useful MATLAB Functions 585
Bibliography 589
Index 593
xiii