Docsity

Digital Signal Processing, Study notes of Digital Signal Processing

Partial preview of the text

Download Digital Signal Processing and more Study notes Digital Signal Processing in PDF only on Docsity!

Digital Signal

Processing

Digital Signal

Processing

Fundamentals and

Applications

Li Tan

DeVry University

Decatur, Georgia

AMSTERDAM • BOSTON • HEIDELBERG • LONDON NEW YORK • OXFORD • PARIS • SAN DIEGO SAN FRANCISCO • SINGAPORE • SYDNEY • TOKYO Academic Press is an imprint of Elsevier

Academic Press is an imprint of Elsevier

30 Corporate Drive, Suite 400, Burlington, MA 01803, USA 525 B Street, Suite 1900, San Diego, California 92101-4495, USA 84 Theobald’s Road, London WC1X 8RR, UK

This book is printed on acid-free paper. 1

Copyright ß 2008, Elsevier Inc. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopy, recording, or any information storage and retrieval system, without permission in writing from the publisher.

Permissions may be sought directly from Elsevier’s Science & Technology Rights Department in Oxford, UK: phone: (þ44) 1865 843830, fax: (þ44) 1865 853333, E-mail: [email protected]. You may also complete your request on-line via the Elsevier homepage (http://elsevier.com), by selecting ‘‘Support & Contact’’ then ‘‘Copyright and Permission’’ and then ‘‘Obtaining Permissions.’’

Library of Congress Cataloging-in-Publication Data Application submitted.

British Library Cataloguing-in-Publication Data A catalogue record for this book is available from the British Library.

ISBN: 978-0-12-374090-

For information on all Academic Press publications visit our Web site at www.books.elsevier.com

Printed in the United States of America 07 08 09 10 11 9 8 7 6 5 4 3 2 1

9.5 Finite Impulse Response and Infinite Impulse Response

12 Multirate Digital Signal Processing, Oversampling of

  • 1 Introduction to Digital Signal Processing About the Author xvii
    • 1.1 Basic Concepts of Digital Signal Processing
    • 1.2 Basic Digital Signal Processing Examples in Block Diagrams - 1.2.1 Digital Filtering - 1.2.2 Signal Frequency (Spectrum) Analysis
      • Applications 1.3 Overview of Typical Digital Signal Processing in Real-World
        • 1.3.1 Digital Crossover Audio System
        • 1.3.2 Interference Cancellation in Electrocardiography
        • 1.3.3 Speech Coding and Compression
        • 1.3.4 Compact-Disc Recording System
        • 1.3.5 Digital Photo Image Enhancement
    • 1.4 Digital Signal Processing Applications
    • 1.5 Summary
  • 2 Signal Sampling and Quantization
    • 2.1 Sampling of Continuous Signal
    • 2.2 Signal Reconstruction - Anti-Aliasing Filtering 2.2.1 Practical Considerations for Signal Sampling: - Anti-Image Filter and Equalizer 2.2.2 Practical Considerations for Signal Reconstruction:
      • Conversion, and Quantization 2.3 Analog-to-Digital Conversion, Digital-to-Analog
    • 2.4 Summary
    • 2.5 MATLAB Programs
    • 2.6 Problems
  • 3 Digital Signals and Systems
    • 3.1 Digital Signals
      • 3.1.1 Common Digital Sequences
      • 3.1.2 Generation of Digital Signals
    • 3.2 Linear Time-Invariant, Causal Systems - 3.2.1 Linearity - 3.2.2 Time Invariance - 3.2.3 Causality
    • 3.3 Difference Equations and Impulse Responses - 3.3.1 Format of Difference Equation - 3.3.2 System Representation Using Its Impulse Response
    • 3.4 Bounded-in-and-Bounded-out Stability
    • 3.5 Digital Convolution
    • 3.6 Summary
    • 3.7 Problems
  • 4 Discrete Fourier Transform and Signal Spectrum
    • 4.1 Discrete Fourier Transform - 4.1.1 Fourier Series Coefficients of Periodic Digital Signals - 4.1.2 Discrete Fourier Transform Formulas
    • 4.2 Amplitude Spectrum and Power Spectrum
    • 4.3 Spectral Estimation Using Window Functions
    • 4.4 Application to Speech Spectral Estimation
    • 4.5 Fast Fourier Transform - 4.5.1 Method of Decimation-in-Frequency - 4.5.2 Method of Decimation-in-Time
    • 4.6 Summary
    • 4.7 Problems
  • 5 The z-Transform
    • 5.1 Definition
    • 5.2 Properties of the z-Transform
    • 5.3 Inverse z-Transform - 5.3.1 Partial Fraction Expansion Using MATLAB
    • 5.4 Solution of Difference Equations Using the z-Transform
    • 5.5 Summary
    • 5.6 Problems
      • and Digital Filter Realizations 6 Digital Signal Processing Systems, Basic Filtering Types,
    • 6.1 The Difference Equation and Digital Filtering
    • 6.2 Difference Equation and Transfer Function - 6.2.1 Impulse Response, Step Response, and System Response
    • 6.3 The z-Plane Pole-Zero Plot and Stability
    • 6.4 Digital Filter Frequency Response
    • 6.5 Basic Types of Filtering
    • 6.6 Realization of Digital Filters
      • 6.6.1 Direct-Form I Realization
      • 6.6.2 Direct-Form II Realization
      • 6.6.3 Cascade (Series) Realization
      • 6.6.4 Parallel Realization
    • 6.7 Application: Speech Enhancement and Filtering
      • 6.7.1 Pre-Emphasis of Speech
      • 6.7.2 Bandpass Filtering of Speech
    • 6.8 Summary
    • 6.9 Problems
  • 7 Finite Impulse Response Filter Design
    • 7.1 Finite Impulse Response Filter Format
    • 7.2 Fourier Transform Design
    • 7.3 Window Method - Two-Band Digital Crossover 7.4 Applications: Noise Reduction and - 7.4.1 Noise Reduction - 7.4.2 Speech Noise Reduction - 7.4.3 Two-Band Digital Crossover
    • 7.5 Frequency Sampling Design Method
    • 7.6 Optimal Design Method
    • 7.7 Realization Structures of Finite Impulse Response Filters - 7.7.1 Transversal Form - 7.7.2 Linear Phase Form
    • 7.8 Coefficient Accuracy Effects on Finite Impulse Response Filters - and Selection of FIR Filter Design Methods in Practice 7.9 Summary of Finite Impulse Response (FIR) Design Procedures
    • 7.10 Summary
    • 7.11 MATLAB Programs
    • 7.12 Problems
  • 8 Infinite Impulse Response Filter Design
    • 8.1 Infinite Impulse Response Filter Format
    • 8.2 Bilinear Transformation Design Method - 8.2.1 Analog Filters Using Lowpass Prototype Transformation - 8.2.2 Bilinear Transformation and Frequency Warping - 8.2.3 Bilinear Transformation Design Procedure
    • 8.3 Digital Butterworth and Chebyshev Filter Designs - 8.3.1 Lowpass Prototype Function and Its Order - 8.3.2 Lowpass and Highpass Filter Design Examples - 8.3.3 Bandpass and Bandstop Filter Design Examples
      • 9.4.5 Fixed-Point Digital Signal Processors
      • 9.4.6 Floating-Point Processors
      • Filter Implementation in Fixed-Point Systems
    • 9.6 Digital Signal Processing Programming Examples - 9.6.1 Overview of TMS320C67x DSK - 9.6.2 Concept of Real-Time Processing - 9.6.3 Linear Buffering - 9.6.4 Sample C Programs
    • 9.7 Summary
    • 9.8 Problems
  • 10 Adaptive Filters and Applications - Impulse Response Filters 10.1 Introduction to Least Mean Square Adaptive Finite
    • 10.2 Basic Wiener Filter Theory and Least Mean Square Algorithm - and Line Enhancement 10.3 Applications: Noise Cancellation, System Modeling,
      • 10.3.1 Noise Cancellation
      • 10.3.2 System Modeling
      • 10.3.3 Line Enhancement Using Linear Prediction
    • 10.4 Other Application Examples - Linear Prediction 10.4.1 Canceling Periodic Interferences Using
      • 10.4.2 Electrocardiography Interference Cancellation - Telephone Circuits 10.4.3 Echo Cancellation in Long-Distance
    • 10.5 Summary
    • 10.6 Problems
  • 11 Waveform Quantization and Compression
    • 11.1 Linear Midtread Quantization
    • 11.2 m-law Companding
      • 11.2.1 Analog m-Law Companding
      • 11.2.2 Digital m-Law Companding - Delta Modulation, and Adaptive DPCM G.721 11.3 Examples of Differential Pulse Code Modulation (DPCM), - and Delta Modulation 11.3.1 Examples of Differential Pulse Code Modulation
      • 11.3.2 Adaptive Differential Pulse Code Modulation G.721 - Transform, and Transform Coding in MPEG Audio 11.4 Discrete Cosine Transform, Modified Discrete Cosine
      • 11.4.1 Discrete Cosine Transform
        • 11.4.2 Modified Discrete Cosine Transform
        • 11.4.3 Transform Coding in MPEG Audio
    • 11.5 Summary
    • 11.6 MATLAB Programs
    • 11.7 Problems
      • Bandpass Signals Analog-to-Digital Conversion, and Undersampling of
    • 12.1 Multirate Digital Signal Processing Basics - 12.1.1 Sampling Rate Reduction by an Integer Factor - 12.1.2 Sampling Rate Increase by an Integer Factor - 12.1.3 Changing Sampling Rate by a Non-Integer Factor L/M - 12.1.4 Application: CD Audio Player - 12.1.5 Multistage Decimation
    • 12.2 Polyphase Filter Structure and Implementation
    • 12.3 Oversampling of Analog-to-Digital Conversion - Resolution 12.3.1 Oversampling and Analog-to-Digital Conversion - 12.3.2 Sigma-Delta Modulation Analog-to-Digital Conversion
    • 12.4 Application Example: CD Player
    • 12.5 Undersampling of Bandpass Signals
    • 12.6 Summary
    • 12.7 Problems
  • 13 Image Processing Basics
    • 13.1 Image Processing Notation and Data Formats - 13.1.1 8-Bit Gray Level Images - 13.1.2 24-Bit Color Images - 13.1.3 8-Bit Color Images - 13.1.4 Intensity Images - Conversion 13.1.5 Red, Green, Blue Components and Grayscale - 13.1.6 MATLAB Functions for Format Conversion
    • 13.2 Image Histogram and Equalization - 13.2.1 Grayscale Histogram and Equalization - 13.2.2 24-Bit Color Image Equalization - 13.2.3 8-Bit Indexed Color Image Equalization - 13.2.4 MATLAB Functions for Equalization
    • 13.3 Image Level Adjustment and Contrast - 13.3.1 Linear Level Adjustment - 13.3.2 Adjusting the Level for Display - 13.3.3 Matlab Functions for Image Level Adjustment
    • 13.4 Image Filtering Enhancement - 13.4.1 Lowpass Noise Filtering - 13.4.2 Median Filtering - 13.4.3 Edge Detection - 13.4.4 MATLAB Functions for Image Filtering
    • 13.5 Image Pseudo-Color Generation and Detection
    • 13.6 Image Spectra
    • 13.7 Image Compression by Discrete Cosine Transform - 13.7.1 Two-Dimensional Discrete Cosine Transform - Compression Example 13.7.2 Two-Dimensional JPEG Grayscale Image - 13.7.3 JPEG Color Image Compression
    • 13.8 Creating a Video Sequence by Mixing Two Images
    • 13.9 Video Signal Basics - 13.9.1 Analog Video - 13.9.2 Digital Video
    • 13.10 Motion Estimation in Video
    • 13.11 Summary
    • 13.12 Problems
  • Appendix A Introduction to the MATLAB Environment
    • A.1 Basic Commands and Syntax
    • A.2 MATLAB Array and Indexing
    • A.3 Plot Utilities: Subplot, Plot, Stem, and Stair
    • A.4 MATLAB Script Files
    • A.5 MATLAB Functions
  • Appendix B Review of Analog Signal Processing Basics
    • B.1 Fourier Series and Fourier Transform
      • B.1.1 Sine-Cosine Form
      • B.1.2 Amplitude-Phase Form
      • B.1.3 Complex Exponential Form
      • B.1.4 Spectral Plots
      • B.1.5 Fourier Transform
    • B.2 Laplace Transform
      • B.2.1 Laplace Transform and Its Table - Laplace Transform B.2.2 Solving Differential Equations Using
      • B.2.3 Transfer Function
      • Steady-State Response B.3 Poles, Zeros, Stability, Convolution, and Sinusoidal
      • B.3.1 Poles, Zeros, and Stability
      • B.3.2 Convolution
      • B.3.3 Sinusoidal Steady-State Response
    • B.4 Problems
  • Appendix C Normalized Butterworth and Chebyshev Fucntions
    • C.1 Normalized Butterworth Function
    • C.2 Normalized Chebyshev Function
  • Appendix D Sinusoidal Steady-State Response of Digital Filters
    • D.1 Sinusoidal Steady-State Response
    • D.2 Properties of the Sinusoidal Steady-State Response - Frequency Sampling Design Method Appendix E Finite Impulse Response Filter Design Equations by the
  • Appendix F Some Useful Mathematical Formulas
  • Bibliography
  • Answers to Selected Problems
  • Index

Preface

Technologies such as microprocessors, microcontrollers, and digital signal pro- cessors have become so advanced that they have had a dramatic impact on the disciplines of electronics engineering, computer engineering, and biomedical engineering. Technologists need to become familiar with digital signals and systems and basic digital signal processing (DSP) techniques. The objective of this book is to introduce students to the fundamental principles of these subjects and to provide a working knowledge such that they can apply DSP in their engineering careers. The book is suitable for a sequence of two-semester courses at the senior level in undergraduate electronics, computer, and biomedical engineering technology programs. Chapters 1 to 8 provide the topics for a one semester course, and a second course can complete the rest of the chapters. This textbook can also be used in an introductory DSP course at the junior level in undergraduate elec- trical engineering programs at traditional colleges. Additionally, the book should be useful as a reference for undergraduate engineering students, science students, and practicing engineers. The material has been tested in two consecutive courses in signal processing sequence at DeVry University on the Decatur campus in Georgia. With the background established from this book, students can be well prepared to move forward to take other senior-level courses that deal with digital signals and systems for communications and controls. The textbook consists of 13 chapters, organized as follows: & (^) Chapter 1 introduces concepts of DSP and presents a general DSP block diagram. Application examples are included. & (^) Chapter 2 covers the sampling theorem described in time domain and frequency domain and also covers signal reconstruction. Some practical considerations for designing analog anti-aliasing lowpass filters and anti- image lowpass filters are included. The chapter ends with a section dealing with analog-to-digital conversion (ADC) and digital-to-analog conversion (DAC), as well as signal quantization and encoding. & (^) Chapter 3 introduces digital signals, linear time-invariant system concepts, difference equations, and digital convolutions.

create a video sequence. Finally, motion compensation of the video sequence is explored, which is a key element of video compression used in MPEG.

MATLAB programs are listed wherever they are possible. Therefore, a MATLAB tutorial should be given to students who are new to the MATLAB environment.

& (^) Appendix A serves as a MATLAB tutorial. & (^) Appendix B reviews key fundamentals of analog signal processing. Topics include Fourier series, Fourier transform, Laplace transform, and analog system basics. & (^) Appendixes C, D, and E overview Butterworth and Chebyshev filters, sinusoidal steady-state responses in digital filters, and derivation of the FIR filter design equation via the frequency sampling method, respectively. & (^) Appendix F offers general useful mathematical formulas. Instructor support, including solutions, can be found at http://textbooks. elsevier.com. MATLAB programs and exercises for students, plus Real- time C programs, can be found at http://books.elsevier.com/companions/

The author wishes to thank Dr. Samuel D. Stearns (professor at the Univer- sity of New Mexico; Sandia National Laboratories, Albuquerque, NM), Dr. Delores M. Etler (professor at the United States Naval Academy at Annapolis, MD) and Dr. Neeraj Magotra (Texas Instruments, former professor at the University of New Mexico) for inspiration, guidance, and sharing of their insight into DSP over the years. A special thanks goes to Dr. Jean Jiang (professor at DeVry University in Decatur) for her encouragement, support, insightful suggestions, and testing of the manuscript in her DSP course. Special thanks go to Tim Pitts (senior commissioning editor), Rick Adams (senior acquistions editor), and Rachel Roumeliotis (acquisitions editor) and to the team members at Elsevier Science publishing for their encouragement and guidance in developing the complete manuscript. I also wish to thank Jamey Stegmaier (publishing project manager) at SPi for coordinating the copyediting of the manuscript. Thanks to all the faculty and staff at DeVry University, Decatur, for their encouragement and support. The book has benefited from many constructive comments and suggestions from the following reviewers and anonymous reviewers. The author takes this opportunity to thank them for their significant contributions:

Professor Mateo Aboy, Oregon Institute of Technology, Klamath Falls, OR Professor Jean Andrian, Florida International University, Miami, FL Professor Rabah Aoufi, DeVry University, Irving, TX Professor Larry Bland, John Brown University, Siloam Springs, AR

P R E F A C E xv

Professor Phillip L. De Leon, New Mexico State University, Las Cruces, NM Professor Mohammed Feknous, New Jersey Institute of Technology, Newark, NJ Professor Richard L. Henderson, DeVry University, Kansas City, MO Professor Ling Hou, St. Cloud State University, St. Cloud, MN Professor Robert C. (Rob) Maher, Montana State University, Bozeman, MT Professor Abdulmagid Omar, DeVry University, Tinley Park, IL Professor Ravi P. Ramachandran, Rowan University, Glassboro, NJ Professor William (Bill) Routt, Wake Technical Community College, Raleigh, NC Professor Samuel D. Stearns, University of New Mexico; Sandia National Laboratories, Albuquerque, NM Professor Les Thede, Ohio Northern University, Ada, OH Professor Igor Tsukerman, University of Akron, Akron, OH Professor Vijay Vaidyanathan, University of North Texas, Denton, TX Professor David Waldo, Oklahoma Christian University, Oklahoma City, OK Finally, I am immensely grateful to my wife, Jean, and my children, Ava, Alex, and Amber, for their extraordinary patience and understanding during the entire preparation of this book.

Li Tan DeVry University Decatur, Georgia May 2007

xvi P R E F A C E

Introduction to Digital Signal

Processing

O b j e c t i v e s :

This chapter introduces concepts of digital signal processing (DSP) and reviews an overall picture of its applications. Illustrative application examples include digital noise filtering, signal frequency analysis, speech and audio compression, biomedical signal processing such as interference cancellation in electrocardiog- raphy, compact-disc recording, and image enhancement.

1. 1 B a s i c C o n c e p t s o f D i g i t a l S i g n a l

P r o c e s s i n g

Digital signal processing (DSP) technology and its advancements have dramat- ically impacted our modern society everywhere. Without DSP, we would not have digital/Internet audio or video; digital recording; CD, DVD, and MP players; digital cameras; digital and cellular telephones; digital satellite and TV; or wire and wireless networks. Medical instruments would be less efficient or unable to provide useful information for precise diagnoses if there were no digital electrocardiography (ECG) analyzers or digital x-rays and medical image systems. We would also live in many less efficient ways, since we would not be equipped with voice recognition systems, speech synthesis systems, and image and video editing systems. Without DSP, scientists, engineers, and tech- nologists would have no powerful tools to analyze and visualize data and perform their design, and so on.

The concept of DSP is illustrated by the simplified block diagram in Figure 1.1, which consists of an analog filter, an analog-to-digital conversion (ADC) unit, a digital signal (DS) processor, a digital-to-analog conversion (DAC) unit, and a reconstruction (anti-image) filter. As shown in the diagram, the analog input signal, which is continuous in time and amplitude, is generally encountered in our real life. Examples of such analog signals include current, voltage, temperature, pressure, and light inten- sity. Usually a transducer (sensor) is used to convert the nonelectrical signal to the analog electrical signal (voltage). This analog signal is fed to an analog filter, which is applied to limit the frequency range of analog signals prior to the sampling process. The purpose of filtering is to significantly attenuate aliasing distortion, which will be explained in the next chapter. The band-limited signal at the output of the analog filter is then sampled and converted via the ADC unit into the digital signal, which is discrete both in time and in amplitude. The DS processor then accepts the digital signal and processes the digital data according to DSP rules such as lowpass, highpass, and bandpass digital filtering, or other algorithms for different applications. Notice that the DS processor unit is a special type of digital computer and can be a general-purpose digital computer, a microprocessor, or an advanced microcontroller; furthermore, DSP rules can be implemented using software in general. With the DS processor and corresponding software, a processed digital output signal is generated. This signal behaves in a manner according to the specific algorithm used. The next block in Figure 1.1, the DAC unit, converts the processed digital signal to an analog output signal. As shown, the signal is continuous in time and discrete in amplitude (usually a sample-and-hold signal, to be discussed in Chapter 2). The final block in Figure 1.1 is designated as a function to smooth the DAC output voltage levels back to the analog signal via a reconstruction (anti-image) filter for real-world applications. In general, the analog signal process does not require software, an algorithm, ADC, and DAC. The processing relies wholly on electrical and electronic devices such as resistors, capacitors, transistors, operational amplifiers, and integrated circuits (ICs). DSP systems, on the other hand, use software, digital processing, and algo- rithms; thus they have a great deal of flexibility, less noise interference, and no

Analog filter ADC^

DS processor DAC^

Reconstruction filter

Analog input

Analog output

Band-limited signal

Digital signal

Processed digital signal

Output signal

F I G U R E 1. 1 A digital signal processing scheme.

2 1 I N T R O D U C T I O N T O D I G I T A L S I G N A L P R O C E S S I N G