Home > Store

C++ Algorithms for Digital Signal Processing, 2nd Edition

Register your product to gain access to bonus material or receive a coupon.

C++ Algorithms for Digital Signal Processing, 2nd Edition


  • Sorry, this book is no longer in print.
Not for Sale


  • Copyright 1999
  • Dimensions: 7" x 9-1/4"
  • Pages: 600
  • Edition: 2nd
  • Book
  • ISBN-10: 0-13-179144-3
  • ISBN-13: 978-0-13-179144-2

Bring the power and flexibility of C++ to all your DSP applications

The multimedia revolution has created hundreds of new uses for Digital Signal Processing, but most software guides have continued to focus on outdated languages such as FORTRAN and Pascal for managing new applications. Now C++ Algorithms for Digital Signal Processing applies object-oriented techniques to this growing field with software you can implement on your desktop PC. C++ Algorithms for Digital Signal Processing's programming methods can be used for applications as diverse as:

  • Digital audio and video
  • Speech and image processing
  • Digital communications
  • Radar, sonar, and ultrasound signal processing

Complete coverage is provided, including:

  • Overviews of DSP and C++
  • Hands-on study with dozens of exercises
  • Extensive library of customizable source code
  • Import and Export of Microsoft WAV and Matlab data files

Multimedia professionals, managers, and even advanced hobbyists will appreciate C++ Algorithms for Digital Signal Processing as much as students, engineers, and programmers. It's the ideal bridge between programming and signal processing, and a valuable reference for experts in either field.

Source code for all of the DSP programs and DSP data associated with the examples discussed in this book and Appendix B and the file README.TXT which provide more information about how to compile and run the programs can be downloaded from www.informit.com/title/9780131791442


CD Contents

Untitled Document Download the CD-ROM for this title.

Sample Content

Downloadable Sample Chapter

Click here for a sample chapter for this book: 0131791443.pdf

Table of Contents


List of Key Symbols.

1. Digital Signal Processing Fundamentals.


The Sampling Function. Sampled Signal Spectra. Continuous- and Discrete Time Signal Spectra. The Impulse Sequence.

Linear Time Invariant Operators.

Causality. Difference Equations. The z-transform Description of Linear Operators. Frequency Domain Transfer Function of an Operator. Frequency Response Relationship to the z-transform. Summary of Linear Operators.

Digital Filters.

FIR Filters. Linear Phase in FIR Filters. IIR Filters. Example Filter Responses. Filter Specifications. Filter Structures.

The Discrete Fourier Transform.

Form of the DFT. Properties of the DFT. Power Spectrum. Averaged Periodograms. The Fast Fourier Transform. FFT Example Result.

Nonlinear Operators.

Clipping and Compression. _-law and A-law Compression. Filtering by Sorting: Median and Min/Max Filters.

Linear Algebra: Matrices and Vectors.

Vectors. Properties of Matrix Mathematics.

Probability and Random Processes.

Basic Probability. Random Variables. Mean, Variance, and Gaussian Random Variables. Quantization of Sequences. Random Processes, Autocorrelation, and Spectral Density. Modeling Real-World Signals With AR Processes.

Adaptive Filters and Systems.

Wiener Filter Theory. LMS Algorithms.

Two-Dimensional Signal Processing.

The Two-Dimensional Fourier Transform. Two-Dimensional Convolution. Using the FFT to Speed Up Two-Dimensional Processing. Two-Dimensional Filtering in the Transform Domain.


2. Programming Fundamentals.

The Elements of DSP Programming. Variables and Data Types.

Types of Numbers. Arrays. Text Data Types: Characters and Strings.


Assignment Operators. Arithmetic and Bitwise Operators. Combined Operators. Logical Operators. Operator Overloading. Operator Precedence and Type Conversion.

Program Control.

Conditional Execution: if-else. The switch Statement. Single-Line Conditional Expressions. Loops: while, do-while, and for. Program Jumps: break, continue, and goto. Exception Handling.


Defining and Declaring Functions. Storage Class, Privacy, and Scope. Function Prototypes. Templates.

Macros and the C Preprocessor.

Conditional Preprocessor Directives. Macros. Inline Functions. Constant Variables.

Pointers, Arrays, and References.

Special Pointer Operators. Pointers and Dynamic Memory Allocation. Arrays of Pointers. References.


Declaring and Referencing Structures. Member Functions. Constructors and Destructors. Pointers to Structures.


Member Access Identifiers. Operator Overloading. Inheritance. Complex Numbers.

Input and Output.

cin, cout, and cerr. Accessing Disk Files.

Common C++ Programming Pitfalls.

Special String Characters. Array Indexing. Misusing Pointers.

Comments on Programming Style.

Software Quality. Structured Programming.


3. User Interface and Disk Storage Routines.

User Interface.

String Input. Numerical Input.

Formatted Disk Storage.

Open Formatted Data File Routines. Formatted Data Access Routines. Trailer Access Routines.

Graphic Display of Data. Exercises. References.

4. Filtering Routines.

Digital Versus Analog Filters. FIR Filters.

Floating-Point FIR Filters. Integer FIR Filters.

IIR Filters.

IIR Filter Design. IIR Filter Function.

Real-Time Filters.

FIR Real-Time Filters. Real-Time Filtering Examples.

Interpolation and Decimation.

FIR Interpolation. FIR Sample Rate Modification and Pitch Shifting.

Complex Filters.

Hilbert Transform Real-to-Complex Conversion.

Filtering to Remove Noise.

Noise Generation. Statistics Calculation. Signal-to-Noise Ratio Improvement. Filtering Quantization Noise.

Nonlinear Filtering.

Sorting. Median Filtering. Speech Compression.

Oscillators and Waveform Synthesis.

IIR Filters as Oscillators. Table-Generated Waveforms.

Adaptive Filtering and Modeling of Signals.

LMS Signal Enhancement. ARMA Modeling of Signals. AR Frequency Estimation.

Exercises. References.


The Discrete Fourier Transform Routine. The Inverse Discrete Fourier Transform. The Fast Fourier Transform Routine. The Inverse FFT Routine. Windowing Routines. Magnitude, Phase, and Logarithmic Displays. Optimizing The FFT for Real Input Sequences. Fourier Transform Examples.

FFT Test Routine. DFT Test Routine. Inverse FFT Test Routine. Real FFT Test Routine.

Fast Convolution Using the FFT. Power Spectral Estimation. Interpolation Using the Fourier Transform. Exercises. References.

6. Matrix and Vector Routines.

Vector Operations.

Vector Arithmetic. Example Vector Operations. Cross Correlation and Autocorrelation.

Matrix Operations.

Matrix Element Manipulation. Matrix Arithmetic. Matrix Inversion. Matrix Determinant. Example Matrix Routine.

Matrix Disk Storage. Least Squares Curve Fitting.

Least Squares Routine. Curve-Fitting Examples.

Exercises. References.

7. Image Processing Routines.

Transform Techniques in Image Processing.

Discrete Cosine Transform Image Compression. Coefficient Quantization in the Compressed Image. Block Coding. Discrete Cosine Transform Functions. Image Compression Routine. Image Recovery Routine. Compression And Recovery of an Image.

Histogram Processing.

Histogram Function. Histogram-Flattening Routine. Histogram-Flattening Example.

Two-Dimensional Convolution.

Convolution Speed-Up. Two-Dimensional Convolution Function. Example Convolution Routine. Two-Dimensional FFT Convolution. Edge Detection Using Convolution. Edge Detection Routine.

Nonlinear Processing of Images.

Median Filtering. Erosion And Dilation.

Exercises. References.

Appendix A: Standard C++ Class Library.

Math Functions.

Trigonometric Functions. Exponential, Log, Power, Square Root. Hyperbolic Functions. Absolute Value, Floor, Ceiling. Euclidean Distance.

Character String Functions.

Convert String to Double-Precision Number. Convert String to Integer. Number to String Conversion. String Manipulation Functions.

Memory Allocation Operators. Standard Input/Output Classes.

Get a Character from a Stream. Get a String from a Stream. Get a Block of Data from a Stream. Get a Class from a Stream. Send a Character to a Stream. Send a String or Block of Data to a Stream. Open a File. Determine the Position of a File Pointer. Reposition a File Pointer. Close a File. Formatted Output Conversion. Formatted Input Conversion.

Other Standard Functions.

Random Number Generator. Quick General Sort. Terminate a Process and Close Files.

Appendix B: DSP Function Library and Programs.

Library Functions.

User Interface Functions. Disk Storage Functions. Filter Functions. DFT Functions. Matrix Functions. Image-Processing Functions.


WINPLOT Program. File Format Conversion Programs.



This book is written with the conviction that two current trends in engineering and programming will continue in the foreseeable future and will become very closely related. The first trend is the rapidly growing importance of digital signal processing (DSP). Digital techniques have become the method of choice in signal processing as digital computers have increased in power, speed, and convenience and as powerful microprocessors have become more available. Some examples of the applications of DSP to engineering problems are:

Radar signal processing such as:

  • Synthetic aperture radar imaging
  • Multitarget tracking
  • Radar classification and identification

Ultrasound and sonar signal processing such as:
  • Doppler flow measurement
  • Adaptive beam forming
  • Image display and enhancement

Image processing such as:
  • Target recognition
  • Pattern classification
  • Robot vision
  • Image compression and restoration

    Communications signal processing such as:
    • Frequency hopped signal tracking
    • Spread spectrum signal recovery
    • Signal modulation and demodulation
    • Adaptive equalization

    Geological signal processing such as:
    • Formation identification
    • Structure velocity estimation

    Speech signal processing such as:
    • Short-time spectral analysis
    • Speaker independent word recognition
    • Phoneme identification
    • Speech synthesis

    As DSP has engulfed signal processing, the C language is proving itself to be the most valuable programming tool for real-time and computationally intensive software tasks. Due to the nature of DSP, this second trend is related in very important ways to the first. There are two broad areas of software applications in DSP:
    • Applications where the software is used to simulate hardware
    • Applications where the software is an end product in itself

    The C and C++ languages are reasonably high-level languages suitable for either of these areas. They have aspects of high-level languages that make them suitable for simulation work and still allow the engineer to produce code whose efficiency approaches that of assembly language for real-time applications.

    The C and C++ languages have significant advantages for DSP applications over other languages such as FORTRAN and Pascal. One important reason is the utility of C data structures and C++ objects for signal processing tasks. Also, the inherent modularity of C and C++ is a valuable asset in DSP programming. Digital signal processing repetitively uses a well-defined set of mathematical tools with small parameter variations. The ordering and tailoring of these algorithms to specific applications are the art of DSP. The C and C++ languages are constructed to encourage development of external library routines and objects that can be used as building blocks in the exact way required by DSP.

    Another reason the C++ language is a good choice for DSP is the popularity and widespread use of this language. Compilers are available for all popular microprocessors including 32-bit designs. In addition, many manufacturers of digital signal processing devices (such as Texas Instruments, AT&T, Motorola, and Analog Devices) provide C compilers for both 16-bit integer and 32-bit floating-point signal processing integrated circuits. The code produced by the best compilers is compact and efficient, and there are sufficient common features among compilers to allow portable code to be written if the standard ANSI C conventions are used. This allows the C code for DSP algorithms to be used directly in embedded real-time signal processing systems. All of the programs in this book are suitable for use with any standard ANSI C compiler on UNIX systems, IBM-PC platforms, and many real-time programming environments.

    Although C++ has not been the traditional language of real-time embedded systems programmers, it has been growing in popularity for application development and fast prototyping of designs. Not only does C++ allow the programmer to fully encapsulate the data with the methods that operate on the data, its inherent modularity makes it easy to write good code. Just one look at the C++ implementation of complex math operations in Chapter 5 or vectors and matrices in Chapter 6 should give the reader some idea about the power and flexibility the language offers.

    This book is constructed in such a way that it will be most useful to the professional engineer, student, and hobbyist who is familiar with both digital signal processing and programming but who is not necessarily an expert in both. This book is intended to be the ideal tool to help the reader in developing efficient, compact, and accurate programs for use in a particular DSP application. In addition, any reader who has the need to write DSP programs will be assisted by the combination of theory and actual working programs presented here. The book is useful for students of DSP and fast numerical techniques because of the numerous examples of efficient DSP algorithms and numerous exercises at the end of each chapter. The book can also serve as a quick source of debugged programs for the applications-oriented programmer who wishes to supplement an existing C or C++ library. For readers interested in a complete DSP software library, the programs presented in the text are available in a machine-readable form on the CD-ROM disk included with the book. C language versions of the C++ programs discussed in the text are also included on the CD-ROM for users of microprocessors that do not have C++ compilers available.

    The text is divided into several sections. Chapters 1 and 2 cover the basic principles to digital signal processing and C++ programming. Readers familiar with these topics may wish to skip one or both chapters. Chapter 3 covers basic use of the DSP programs, the data file formats, and user interface that will be used throughout the text. Chapters 4 and 5 cover basic one-dimensional digital signal processing techniques. Digital filtering is presented in Chapter 4, and frequency domain techniques are discussed in Chapter 5. Chapter 6 describes a C++ implementation of vectors and matrices that can be used for one-dimensional or two-dimensional signal processing. Chapter 7 discusses two-dimensional signal processing using algorithms described in Chapters 1.

    The CD-ROM disk included with the text contains source code for all of the DSP programs and DSP data associated with the examples discussed in this book. Appendix B and the file README.TXT on the disk provide more information about how to compile and run the programs. The programs are also precompiled and stored on the CD-ROM to allow the reader to try the un-modified examples on an IBM-PC platform without installing a C++ compiler. These programs have been tested using Microsoft Visual C++ version 4.2, 5.0 and 6.0 and on several UNIX platforms, but should work with most modern compilers that adhere to the ANSI C/C++ standards.

    Paul M. Embree
    Damon Danieli


Submit Errata

More Information

Unlimited one-month access with your purchase
Free Safari Membership