100% found this document useful (2 votes)
431 views

Instant download Digital Signal Processing Using MATLAB 3rd Edition Vinay K. Ingle pdf all chapter

Digital

Uploaded by

riojanovaslb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
431 views

Instant download Digital Signal Processing Using MATLAB 3rd Edition Vinay K. Ingle pdf all chapter

Digital

Uploaded by

riojanovaslb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 81

Visit https://ebookgate.

com to download the full version and


explore more ebooks

Digital Signal Processing Using MATLAB 3rd Edition


Vinay K. Ingle

_____ Click the link below to download _____


https://ebookgate.com/product/digital-signal-
processing-using-matlab-3rd-edition-vinay-k-ingle/

Explore and download more ebooks at ebookgate.com


Here are some recommended products that might interest you.
You can download now and explore!

Digital Signal Processing Using Matlab 1st Edition Andre


Quinquis

https://ebookgate.com/product/digital-signal-processing-using-
matlab-1st-edition-andre-quinquis/

ebookgate.com

Instructor Solution Manual Fundamentals of Digital Signal


Processing Using MATLAB 2nd Edition Robert J. Schilling

https://ebookgate.com/product/instructor-solution-manual-fundamentals-
of-digital-signal-processing-using-matlab-2nd-edition-robert-j-
schilling/
ebookgate.com

Digital Image Processing Using MATLAB R Rafael C. Gonzalez

https://ebookgate.com/product/digital-image-processing-using-matlab-r-
rafael-c-gonzalez/

ebookgate.com

Multirate filtering for digital signal processing MATLAB


applications 1st Edition Ljiljana Milic

https://ebookgate.com/product/multirate-filtering-for-digital-signal-
processing-matlab-applications-1st-edition-ljiljana-milic/

ebookgate.com
The Digital Signal Processing Handbook Video Speech and
Audio Signal Processing 2nd Edition Vijay K. Madisetti

https://ebookgate.com/product/the-digital-signal-processing-handbook-
video-speech-and-audio-signal-processing-2nd-edition-vijay-k-
madisetti/
ebookgate.com

Digital Signal Processing 1st Edition J.S. Chitode

https://ebookgate.com/product/digital-signal-processing-1st-edition-j-
s-chitode/

ebookgate.com

DSP for MATLAB and LabVIEW I Fundamentals of Discrete


Signal Processing Synthesis Lectures on Signal Processing
Isen
https://ebookgate.com/product/dsp-for-matlab-and-labview-i-
fundamentals-of-discrete-signal-processing-synthesis-lectures-on-
signal-processing-isen/
ebookgate.com

Advanced Digital Signal Processing and Noise Reduction 3rd


ed Edition Saeed V. Vaseghi

https://ebookgate.com/product/advanced-digital-signal-processing-and-
noise-reduction-3rd-ed-edition-saeed-v-vaseghi/

ebookgate.com

Modern Digital Signal Processing 1st Edition Roberto


Cristi

https://ebookgate.com/product/modern-digital-signal-processing-1st-
edition-roberto-cristi/

ebookgate.com
Digital Signal Processing
®
Using MATLAB
Third Edition

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Digital Signal Processing
®
Using MATLAB
Third Edition

Vinay K. Ingle
John G. Proakis
Northeastern University

Australia • Brazil • Japan • Korea • Mexico • Singapore • Spain • United Kingdom • United States

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
This is an electronic version of the print textbook. Due to electronic rights restrictions,
some third party content may be suppressed. Editorial review has deemed that any suppressed
content does not materially affect the overall learning experience. The publisher reserves the right
to remove content from this title at any time if subsequent rights restrictions require it. For
valuable information on pricing, previous editions, changes to current editions, and alternate
formats, please visit www.cengage.com/highered to search by ISBN#, author, title, or keyword for
materials in your areas of interest.

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Digital Signal Processing Using 
c 2012, 2007 Cengage Learning
MATLAB®, Third Edition ALL RIGHTS RESERVED. No part of this work covered by the
Vinay K. Ingle and John G. Proakis copyright herein may be reproduced, transmitted, stored, or
used in any form or by any means graphic, electronic, or
Publisher, Global Engineering: mechanical, including but not limited to photocopying,
Christopher M. Shortt recording, scanning, digitizing, taping, web distribution,
information networks, or information storage and retrieval
Acquisitions Editor: systems, except as permitted under Section 107 or 108 of the
Swati Meherishi 1976 United States Copyright Act, without the prior written
permission of the publisher.
Assistant Developmental Editor:
Debarati Roy For product information and technology assistance, contact us
at Cengage Learning Customer & Sales Support,
Editorial Assistant:
1-800-354-9706.
Tanya Altieri
Team Assistant: For permission to use material from this text or product,
Carly Rizzo submit all requests online at www.cengage.com/permissions.
Further permissions questions can be emailed to
Marketing Manager: permissionrequest@cengage.com.
Lauren Betsos
Library of Congress Control Number: 2010941462
Media Editor:
Chris Valentine ISBN-13: 978-1-111-42737-5
ISBN-10: 1-111-42737-2
Content Project Manager: Jennifer Ziegler
Cengage Learning
Production Service: RPK Editorial Services
200 First Stamford Place, Suite 400
Copyeditor: Fred Dahl Stamford, CT 06902
USA
Proofreader: Martha McMaster
Cengage Learning is a leading provider of customized learning
Indexer: Shelly Gerger-Knechtl solutions with office locations around the globe, including
Compositor: Glyph International Singapore, the United Kingdom, Australia, Mexico, Brazil, and
Japan. Locate your local office at:
Senior Art Director: international.cengage.com/region.
Michelle Kunkler
Cengage Learning products are represented in Canada by
Internal Designer: Carmela Periera Nelson Education Ltd.
Cover Designer: Andrew Adams For your course and learning solutions, visit
www.cengage.com/engineering.
Cover Image: 
c Marilyn Volan/Shutterstock
Purchase any of our products at your local college store or at our
Rights Acquisitions Specialist:
preferred online store www.cengagebrain.com.
Deanna Ettinger
MATLAB is a registered trademark of The MathWorks, 3 Apple
Text and Image Permissions Researcher:
Hill Drive, Natick, MA.
Kristiina Paul
First Print Buyer:
Arethea L. Thomas

Printed in the United States of America


1 2 3 4 5 6 7 13 12 11 10

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Contents

PREFACE xi

1 INTRODUCTION 1

1.1 Overview of Digital Signal Processing 2


1.2 A Brief Introduction to MATLAB 5
1.3 Applications of Digital Signal Processing 17
1.4 Brief Overview of the Book 20

2 DISCRETE-TIME SIGNALS AND SYSTEMS 22

2.1 Discrete-time Signals 22


2.2 Discrete Systems 36
2.3 Convolution 40
2.4 Difference Equations 47
2.5 Problems 53

v
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
vi CONTENTS

3 THE DISCRETE-TIME FOURIER ANALYSIS 59

3.1 The Discrete-time Fourier Transform (DTFT) 59


3.2 The Properties of the DTFT 67
3.3 The Frequency Domain Representation of LTI
Systems 74
3.4 Sampling and Reconstruction of Analog Signals 80
3.5 Problems 97

4 THE z -TRANSFORM 103

4.1 The Bilateral z -Transform 103


4.2 Important Properties of the z -Transform 107
4.3 Inversion of the z -Transform 112
4.4 System Representation in the z -Domain 118
4.5 Solutions of the Difference Equations 128
4.6 Problems 134

5 THE DISCRETE FOURIER TRANSFORM 141

5.1 The Discrete Fourier Series 142


5.2 Sampling and Reconstruction in the z -Domain 149
5.3 The Discrete Fourier Transform 154
5.4 Properties of the Discrete Fourier Transform 166
5.5 Linear Convolution Using the DFT 180
5.6 The Fast Fourier Transform 187
5.7 Problems 200

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
CONTENTS vii

6 IMPLEMENTATION OF DISCRETE-TIME
FILTERS 213

6.1 Basic Elements 214


6.2 IIR Filter Structures 215
6.3 FIR Filter Structures 229
6.4 Lattice Filter Structures 240
6.5 Overview of Finite-Precision Numerical Effects 251
6.6 Representation of Numbers 252
6.7 The Process of Quantization and Error
Characterizations 268
6.8 Quantization of Filter Coefficients 275
6.9 Problems 290

7 FIR FILTER DESIGN 305

7.1 Preliminaries 306


7.2 Properties of Linear-phase FIR Filters 309
7.3 Window Design Techniques 324
7.4 Frequency Sampling Design Techniques 346
7.5 Optimal Equiripple Design Technique 360
7.6 Problems 377

8 IIR FILTER DESIGN 388

8.1 Some Preliminaries 389


8.2 Some Special Filter Types 392

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
viii CONTENTS

8.3 Characteristics of Prototype Analog Filters 402


8.4 Analog-to-Digital Filter Transformations 425
8.5 Lowpass Filter Design Using MATLAB 445
8.6 Frequency-band Transformations 450
8.7 Problems 463

9 SAMPLING RATE CONVERSION 476

9.1 Introduction 477


9.2 Decimation by a Factor D 479
9.3 Interpolation by a Factor I 488
9.4 Sampling Rate Conversion by a Rational
Factor I/D 495
9.5 FIR Filter Designs for Sampling Rate Conversion 500
9.6 FIR Filter Structures for Sampling Rate Conversion 522
9.7 Problems 532

10 ROUND-OFF EFFECTS IN DIGITAL FILTERS 540

10.1 Analysis of A/D Quantization Noise 540


10.2 Round-off Effects in IIR Digital Filters 552
10.3 Round-off Effects in FIR Digital Filters 580
10.4 Problems 592

11 APPLICATIONS IN ADAPTIVE FILTERING 596

11.1 LMS Algorithm for Coefficient Adjustment 598


11.2 System Identification or System Modeling 601

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
CONTENTS ix

11.3 Suppression of Narrowband Interference


in a Wideband Signal 602
11.4 Adaptive Line Enhancement 605
11.5 Adaptive Channel Equalization 605

12 APPLICATIONS IN COMMUNICATIONS 609

12.1 Pulse-Code Modulation 609


12.2 Differential PCM (DPCM) 613
12.3 Adaptive PCM and DPCM (ADPCM) 616
12.4 Delta Modulation (DM) 620
12.5 Linear Predictive Coding (LPC) of Speech 624
12.6 Dual-tone Multifrequency (DTMF) Signals 628
12.7 Binary Digital Communications 632
12.8 Spread-Spectrum Communications 634

BIBLIOGRAPHY 635

INDEX 637

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Preface

From the beginning of the 1980s we have witnessed a revolution in


computer technology and an explosion in user-friendly applications. This
revolution is still continuing today with low-cost personal computer
systems that rival the performance of expensive workstations. This tech-
nological prowess should be brought to bear on the educational process
and, in particular, on effective teaching that can result in enhanced learn-
ing. This companion book on digital signal processing (DSP) makes a
small contribution toward reaching that goal.
The teaching methods in signal processing have changed over the
years from the simple “lecture-only” format to a more integrated “lecture-
laboratory” environment in which practical hands-on issues are taught
using DSP hardware. However, for effective teaching of DSP the lecture
component must also make extensive use of computer-based explanations,
examples, and exercises. For the past several years, the MATLAB soft-
ware developed by The MathWorks, Inc. has established itself as the de
facto standard for numerical computation in the signal-processing com-
munity and as a platform of choice for algorithm development. There are
several reasons for this development, but the most important reason is
that MATLAB is available on practically all-computing platforms. In this
book we have made an attempt at integrating MATLAB with traditional
topics in DSP so that it can be used to explore difficult topics and solve
problems to gain insight. Many problems or design algorithms in DSP
require considerable computation. It is for these that MATLAB provides
a convenient tool so that many scenarios can be tried with ease. Such an
approach can enhance the learning process.

xi
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
xii PREFACE

SCOPE OF THE BOOK

This book is primarily intended for use as a supplement in junior- or


senior-level undergraduate courses on DSP. Although we assume that the
student (or user) is familiar with the fundamentals of MATLAB, we have
provided a brief introduction to MATLAB in Chapter 1. Also, this book
is not written as a textbook in DSP because of the availability of excellent
textbooks. What we have tried to do is to provide enough depth to the
material augmented by MATLAB functions and examples so that the
presentation is consistent, logical, and enjoyable. Therefore, this book
can also be used as a self-study guide by anyone interested in DSP.

ORGANIZATION OF THE BOOK

The first ten chapters of this book discuss traditional material typically
covered in an introductory course on DSP. The final two chapters are
presented as applications in DSP with emphasis on MATLAB-based
projects. The following is a list of chapters and a brief description of their
contents.
Chapter 1, Introduction: This chapter introduces readers to the discipline
of signal processing and presents several applications of digital signal
processing, including musical sound processing, echo generation, echo
removal, and digital reverberation. A brief introduction to MATLAB
is also provided.
Chapter 2, Discrete-time Signals and Systems: This chapter provides a
brief review of discrete-time signals and systems in the time domain.
Appropriate use of MATLAB functions is demonstrated.
Chapter 3, The Discrete-time Fourier Analysis: This chapter discusses
discrete-time signal and system representation in the frequency domain.
Sampling and reconstruction of analog signals are also presented.
Chapter 4, The z-Transform: This chapter provides signal and system
description in the complex frequency domain. MATLAB techniques
are introduced to analyze z-transforms and to compute inverse z-
transforms. Solutions of difference equations using the z-transform and
MATLAB are provided.
Chapter 5, The Discrete Fourier Transform: This chapter is devoted
to the computation of the Fourier transform and to its efficient

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
PREFACE xiii

implementation. The discrete Fourier series is used to introduce the


discrete Fourier transform, and several of its properties are demon-
strated using MATLAB. Topics such as fast convolution and fast
Fourier transform are thoroughly discussed.
Chapter 6, Implementation of Discrete-Time Filters: This chapter dis-
cusses several structures for the implementation of digital filters.
Several useful MATLAB functions are developed for the determination
and implementation of these structures. Lattice and ladder filters are
also introduced and discussed. In addition to considering various fil-
ter structures, we also treat quantization effects when finite-precision
arithmetic is used in the implementation of IIR and FIR filters.
Chapter 7, FIR Filter Design: This chapter and the next introduce the im-
portant topic of digital filer design. Three important design techniques
for FIR filters–namely, window design, frequency sampling design, and
the equiripple filer design–are discussed. Several design examples are
provided using MATLAB.
Chapter 8, IIR Filter Design: Included in this chapter are techniques used
in IIR filter design. The chapter begins with the treatment of some
basic filter types, namely, digital resonators, notch filters, comb filters,
all-pass filters, and digital sinusoidal oscillators. This is followed by
a brief description of the characteristics of three widely used analog
filters. Transformations are described for converting these prototype
analog filters into different frequency-selective digital filters. The chap-
ter concludes with several IIR filter designs using MATLAB.
Chapter 9, Sampling Rate Conversion: This chapter teats the important
problem of sampling rate conversion in digital signal processing. Top-
ics treated include decimation and interpolation by integer factors,
sampling rate conversion by rational factor, and filter structures for
sampling rate conversion.
Chapter 10, Round-off Effects in Digital Filters: The focus of this chapter
is on the effects of finite-precision arithmetic to the filtering aspects
in signal processing. Quantization noise introduced in analog-to-digital
conversion is characterized statistically and the quantization effects in
finite precision multiplication and additions are also modeled statisti-
cally. The effects of these errors in the filter output are characterized as
correlated errors, called limit cycles and as uncorrelated errors, called
round-off noise.
Chapter 11, Applications in Adaptive Filtering: This chapter is the first
of two chapters on projects using MATLAB. Included is an introduc-
tion to the theory and implementation of adaptive FIR filters with
projects in system identification, interference suppression, narrowband
frequency enhancement, and adaptive equalization.

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
xiv PREFACE

Chapter 12, Applications in Communications: This chapter focuses on


several projects dealing with waveform representation and coding
and with digital communications. Included is a description of pulse-
code modulation (PCM), differential PCM (DPCM) and adaptive
DPCM (ADPCM), delta modulation (DM) and adaptive DM (ADM),
linear predictive coding (LPC), generation and detection of dual-
tone multifrequency (DTMF) signals, and a description of signal de-
tection applications in binary communications and spread-spectrum
communications.

ABOUT THE SOFTWARE

The book is an outgrowth of our teaching of a MATLAB-based under-


graduate DSP course over several years. Most of the MATLAB functions
discussed in this book were developed in this course. These functions are
collected in the book toolbox called DSPUM and are available online
on the book’s companion website. Many examples in the book contain
MATLAB scripts. Similarly, MATLAB plots were created using scripts.
All these scripts are made available at the companion website for the bene-
fit of students and instructors. Students should study these scripts to gain
insight into MATLAB procedures. We will appreciate any comments, cor-
rections, or compact coding of these functions and scripts. Solutions to
problems and the associated script files will be made available to instruc-
tors adopting the book through the companion website. To access the
book’s companion website and all additional course materials, please visit
www.cengagebrain.com. At the CengageBrain.com home page, search for
the ISBN of your title (from the back cover of your book) using the search
box at the top of the page. This will take you to the product page where
these resources can be found.
Further information about MATLAB and related publications may
be obtained from

The MathWorks, Inc.


24 Prime Park Way
Natick, MA 01760-1500
Phone: (508) 647-7000 Fax: (508) 647-7001
E-mail: info@mathworks.com
WWW: http://www.mathworks.com

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
PREFACE xv

ACKNOWLEDGMENTS

We are indebted to numerous students in our undergraduate DSP course


at Northeastern University who provided us a forum to test teaching ideas
using MATLAB and who endured our constant emphasis on MATLAB.
Many efficient MATLAB functions used in this book were developed by
some of these students. We are also indebted to reviewers of the original
edition, whose constructive criticism resulted in a better presentation of
the material: Abeer A. H. Alwan, University of California, Los Angeles;
Steven Chin, Catholic University; Prof. Huaichen, Xidian University, P. R.
China; and Joel Trussel, North Carolina State University. The follow-
ing reviewers provided additional encouragement, numerous refinements,
and useful comments for the second edition: Jyotsna Bapat, Fairleigh
Dickinson University; David Clark, California State Polytechnic Univer-
sity; Artyom Grigoryan, University of Texas, San Antonio; Tao Li, Univer-
sity of Florida; and Zixiang Xiong, Texas A & M University. Finally, based
on their use of the second edition, the following reviewers provided sev-
eral suggestions, changes, and modifications that led to the third edition:
Kalyan Mondal, Fairleigh Dickinson University; Artyom M. Grigoryan,
University of Texas at San Antonio; A. David Salvia, Pennsylvania State
University; Matthew Valenti, West Virginia University; and Christopher
J. James,University of Southampton, UK. We sincerely thank all of them.
We would also like to take this opportunity to acknowledge several
people at Cengage Learning without whom this project would not have
been possible. We thank the Publisher, Chris Shortt, for encouraging the
third edition. The Acquisitions Editor, Swati Meherishi, took considerable
amount of interest in the development of the third edition and provided
ample support for it. This project could not have been completed within
time limits without her constant push and we thank her for all her help.
Debarati Roy and Carly Rizzo coordinated the manuscript development
and preparation and Hilda Gowans provided the overall assistance in the
project. We sincerely thank them for their efforts. Finally we express our
sincere gratitude to Rose P. Kernan of RPK Editorial Services, permis-
sions researcher Kristiina Paul, and everyone else at Cengage Learning
who aided the development of this edition.

Vinay K. Ingle
John G. Proakis
Boston, Massachusetts

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
CHAPTER 1
Introduction

During the past several decades the field of digital signal processing (DSP)
has grown to be important, both theoretically and technologically. A ma-
jor reason for its success in industry is the development and use of low-cost
software and hardware. New technologies and applications in various fields
are now taking advantage of DSP algorithms. This will lead to a greater
demand for electrical and computer engineers with background in DSP.
Therefore, it is necessary to make DSP an integral part of any electrical
engineering curriculum.
Two decades ago an introductory course on DSP was given mainly at
the graduate level. It was supplemented by computer exercises on filter
design, spectrum estimation, and related topics using mainframe (or mini)
computers. However, considerable advances in personal computers and
software during the past two decades have made it necessary to introduce
a DSP course to undergraduates. Since DSP applications are primarily
algorithms that are implemented either on a DSP processor [11] or in
software, a fair amount of programming is required. Using interactive
software, such as MATLAB, it is now possible to place more emphasis
on learning new and difficult concepts than on programming algorithms.
Interesting practical examples can be discussed, and useful problems can
be explored.
With this philosophy in mind, we have developed this book as a com-
panion book (to traditional textbooks like [18, 23]) in which MATLAB is
an integral part in the discussion of topics and concepts. We have chosen
MATLAB as the programming tool primarily because of its wide avail-
ability on computing platforms in many universities across the world.
Furthermore, a low-cost student version of MATLAB has been available
for several years, placing it among the least expensive software products

1
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
2 Chapter 1 INTRODUCTION

for educational purposes. We have treated MATLAB as a computational


and programming toolbox containing several tools (sort of a super calcu-
lator with several keys) that can be used to explore and solve problems
and, thereby, enhance the learning process.
This book is written at an introductory level in order to introduce
undergraduate students to an exciting and practical field of DSP. We
emphasize that this is not a textbook in the traditional sense but a com-
panion book in which more attention is given to problem solving and
hands-on experience with MATLAB. Similarly, it is not a tutorial book in
MATLAB. We assume that the student is familiar with MATLAB and is
currently taking a course in DSP. The book provides basic analytical tools
needed to process real-world signals (a.k.a. analog signals) using digital
techniques. We deal mostly with discrete-time signals and systems, which
are analyzed in both the time and the frequency domains. The analysis
and design of processing structures called filters and spectrum analyzers
are among of the most important aspects of DSP and are treated in great
detail in this book. Two important topics on finite word-length effects and
sampling-rate conversion are also discussed in this book. More advanced
topics in modern signal processing like statistical and adaptive signal pro-
cessing are generally covered in a graduate course. These are not treated
in this book, but it is hoped that the experience gained in using this book
will allow students to tackle advanced topics with greater ease and un-
derstanding. In this chapter we provide a brief overview of both DSP and
MATLAB.

1.1 OVERVIEW OF DIGITAL SIGNAL PROCESSING

In this modern world we are surrounded by all kinds of signals in vari-


ous forms. Some of the signals are natural, but most of the signals are
manmade. Some signals are necessary (speech), some are pleasant (mu-
sic), while many are unwanted or unnecessary in a given situation. In an
engineering context, signals are carriers of information, both useful and
unwanted. Therefore extracting or enhancing the useful information from
a mix of conflicting information is the simplest form of signal processing.
More generally, signal processing is an operation designed for extracting,
enhancing, storing, and transmitting useful information. The distinction
between useful and unwanted information is often subjective as well as
objective. Hence signal processing tends to be application dependent.

1.1.1 HOW ARE SIGNALS PROCESSED?


The signals that we encounter in practice are mostly analog signals. These
signals, which vary continuously in time and amplitude, are processed

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Overview of Digital Signal Processing 3

using electrical networks containing active and passive circuit elements.


This approach is known as analog signal processing (ASP)—for example,
radio and television receivers.
Analog signal: xa (t) −→ Analog signal processor −→ ya (t) :Analog signal

They can also be processed using digital hardware containing adders,


multipliers, and logic elements or using special-purpose microprocessors.
However, one needs to convert analog signals into a form suitable for
digital hardware. This form of the signal is called a digital signal. It takes
one of the finite number of values at specific instances in time, and hence
it can be represented by binary numbers, or bits. The processing of digital
signals is called DSP; in block diagram form it is represented by

Equivalent Analog Signal Processor


digital digital
Analog → → PrF ADC DSP DAC PoF → → Analog

Discrete System

The various block elements are discussed as follows.

PrF: This is a prefilter or an antialiasing filter, which conditions the analog


signal to prevent aliasing.
ADC: This is an analog-to-digital converter, which produces a stream of
binary numbers from analog signals.
Digital Signal Processor: This is the heart of DSP and can represent a general-
purpose computer or a special-purpose processor, or digital hardware,
and so on.
DAC: This is the inverse operation to the ADC, called a digital-to-analog
converter, which produces a staircase waveform from a sequence of
binary numbers, a first step toward producing an analog signal.
PoF: This is a postfilter to smooth out staircase waveform into the desired
analog signal.

It appears from the above two approaches to signal processing, analog


and digital, that the DSP approach is the more complicated, containing
more components than the “simpler looking” ASP. Therefore one might
ask, Why process signals digitally? The answer lies in the many advan-
tages offered by DSP.

1.1.2 ADVANTAGES OF DSP OVER ASP


A major drawback of ASP is its limited scope for performing complicated
signal-processing applications. This translates into nonflexibility in pro-
cessing and complexity in system designs. All of these generally lead to

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
4 Chapter 1 INTRODUCTION

expensive products. On the other hand, using a DSP approach, it is pos-


sible to convert an inexpensive personal computer into a powerful signal
processor. Some important advantages of DSP are these:
1. Systems using the DSP approach can be developed using software run-
ning on a general-purpose computer. Therefore DSP is relatively con-
venient to develop and test, and the software is portable.
2. DSP operations are based solely on additions and multiplications, lead-
ing to extremely stable processing capability—for example, stability
independent of temperature.
3. DSP operations can easily be modified in real time, often by simple
programming changes, or by reloading of registers.
4. DSP has lower cost due to VLSI technology, which reduces costs of
memories, gates, microprocessors, and so forth.
The principal disadvantage of DSP is the limited speed of operations
limited by the DSP hardware, especially at very high frequencies. Primar-
ily because of its advantages, DSP is now becoming a first choice in many
technologies and applications, such as consumer electronics, communica-
tions, wireless telephones, and medical imaging.

1.1.3 TWO IMPORTANT CATEGORIES OF DSP


Most DSP operations can be categorized as being either signal analysis
tasks or signal filtering tasks:

Digital Signal

Analysis Digital Filter

Measurements Digital Signal

Signal analysis This task deals with the measurement of signal prop-
erties. It is generally a frequency-domain operation. Some of its applica-
tions are
• spectrum (frequency and/or phase) analysis
• speech recognition
• speaker verification
• target detection

Signal filtering This task is characterized by the signal-in signal-out


situation. The systems that perform this task are generally called filters.

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
A Brief Introduction to MATLAB 5

It is usually (but not always) a time-domain operation. Some of the ap-


plications are
• removal of unwanted background noise
• removal of interference
• separation of frequency bands
• shaping of the signal spectrum
In some applications, such as voice synthesis, a signal is first analyzed
to study its characteristics, which are then used in digital filtering to
generate a synthetic voice.

1.2 A BRIEF INTRODUCTION TO MATLAB

MATLAB is an interactive, matrix-based system for scientific and engi-


neering numeric computation and visualization. Its strength lies in the fact
that complex numerical problems can be solved easily and in a fraction
of the time required by a programming language such as Fortran or C. It
is also powerful in the sense that, with its relatively simple programming
capability, MATLAB can be easily extended to create new commands and
functions.
MATLAB is available in a number of computing environments: PCs
running all flavors of Windows, Apple Macs running OS-X, UNIX/Linux
workstations, and parallel computers. The basic MATLAB program is
further enhanced by the availability of numerous toolboxes (a collection
of specialized functions in a specific topic) over the years. The information
in this book generally applies to all these environments. In addition to the
basic MATLAB product, the Signal Processing toolbox (SP toolbox) is
required for this book. The original development of the book was done us-
ing the professional version 3.5 running under DOS. The MATLAB scripts
and functions described in the book were later extended and made com-
patible with the present version of MATLAB. Furthermore, through the
services of www.cengagebrain.com every effort will be made to preserve
this compatibility under future versions of MATLAB.
In this section, we will undertake a brief review of MATLAB. The
scope and power of MATLAB go far beyond the few topics discussed
in this section. For more detailed tutorial-based discussion, students and
readers new to MATLAB should also consult several excellent reference
books available in the literature, including [10], [7], and [21]. The informa-
tion given in all these references, along with the online MATLAB’s help
facility, usually is sufficient to enable readers to use this book. The best ap-
proach to become familiar with MATLAB is to open a MATLAB session
and experiment with various operators, functions, and commands until

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
6 Chapter 1 INTRODUCTION

their use and capabilities are understood. Then one can progress to writ-
ing simple MATLAB scripts and functions to execute a sequence of in-
structions to accomplish an analytical goal.

1.2.1 GETTING STARTED


The interaction with MATLAB is through the command window of its
graphical user interface (GUI). In the command window, the user types
MATLAB instructions, which are executed instantaneously, and the re-
sults are displayed in the window. In the MATLAB command window the
characters “>>” indicate the prompt which is waiting for the user to type
a command to be executed. For example,

>> command;

means an instruction command has been issued at the MATLAB prompt.


If a semicolon (;) is placed at the end of a command, then all output
from that command is suppressed. Multiple commands can be placed on
the same line, separated by semicolons ;. Comments are marked by the
percent sign (%), in which case MATLAB ignores anything to the right
of the sign. The comments allow the reader to follow code more easily.
The integrated help manual provides help for every command through the
fragment

>> help command;

which will provide information on the inputs, outputs, usage, and func-
tionality of the command. A complete listing of commands sorted by
functionality can be obtained by typing help at the prompt.
There are three basic elements in MATLAB: numbers, variables, and
operators. In addition, punctuation marks (,, ;, :, etc.) have special
meanings.

Numbers MATLAB is a high-precision numerical engine and can han-


dle all types of numbers, that is, integers, real numbers, complex numbers,
among others, with relative ease. For example, the real number 1.23 is rep-
√ number 4.56 × 10 can be written
7
resented as simply 1.23 while the real
as 4.56e7. The imaginary number −1 is denoted either by 1i or 1j,
although in this book we will use the symbol 1j. Hence the complex num-
ber whose real part is 5 and whose imaginary part is 3 will be written as
5+1j*3. Other constants preassigned by MATLAB are pi for π, inf for
∞, and NaN for not a number (for example, 0/0). These preassigned con-
stants are very important and, to avoid confusion, should not be redefined
by users.

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
A Brief Introduction to MATLAB 7

Variables In MATLAB, which stands for MATrix LABoratory, the ba-


sic variable is a matrix, or an array. Hence, when MATLAB operates on
this variable, it operates on all its elements. This is what makes it a pow-
erful and an efficient engine. MATLAB now supports multidimensional
arrays; we will discuss only up to two-dimensional arrays of numbers.
1. Matrix: A matrix is a two-dimensional set of numbers arranged in
rows and columns. Numbers can be real- or complex-valued.
2. Array: This is another name for matrix. However, operations on arrays
are treated differently from those on matrices. This difference is very
important in implementation.
The following are four types of matrices (or arrays):

• Scalar: This is a 1 × 1 matrix or a single number that is denoted by


the variable symbol, that is, lowercase italic typeface like
a = a11
• Column vector: This is an (N × 1) matrix or a vertical arrangement
of numbers. It is denoted by the vector symbol, that is, lowercase bold
typeface like
 
x11
 x21 
 
x = [xi1 ]i:1,...,N =  . 
 .. 
xN 1

A typical vector in linear algebra is denoted by the column vector.


• Row vector: This is a (1 × M ) matrix or a horizontal arrangement of
numbers. It is also denoted by the vector symbol, that is,
 
y = [y1j ]j=1,...,M = y11 y12 · · · y1M

A one-dimensional discrete-time signal is typically represented by an


array as a row vector.
• General matrix: This is the most general case of an (N × M ) matrix
and is denoted by the matrix symbol, that is, uppercase bold typeface
like  
a11 a12 · · · a1M
 a21 a22 · · · a2M 
 
A = [aij ]i=1,...,N ;j=1,...,m =  . .. . . .. 
 .. . . . 
aN 1 aN 2 · · · aN M
This arrangement is typically used for two-dimensional discrete-time
signals or images.

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
8 Chapter 1 INTRODUCTION

MATLAB does not distinguish between an array and a matrix except for
operations. The following assignments denote indicated matrix types in
MATLAB:
a = [3] is a scalar,
x = [1,2,3] is a row vector,
y = [1;2;3] is a column vector, and
A = [1,2,3;4,5,6] is a matrix.
MATLAB provides many useful functions to create special matrices.
These include zeros(M,N) for creating a matrix of all zeros, ones(M,N)
for creating matrix of all ones, eye(N) for creating an N × N identity
matrix, etc. Consult MATLAB’s help manual for a complete list.

Operators MATLAB provides several arithmetic and logical operators,


some of which follow. For a complete list, MATLAB’s help manual should
be consulted.
= assignment == equality
+ addition - subtraction or minus
* multiplication .* array multiplication
^ power .^ array power
/ division ./ array division
<> relational operators & logical AND
| logical OR ~ logical NOT
’ transpose .’ array transpose
We now provide a more detailed explanation on some of these operators.

1.2.2 MATRIX OPERATIONS


Following are the most useful and important operations on matrices.
• Matrix addition and subtraction: These are straightforward oper-
ations that are also used for array addition and subtraction. Care must
be taken that the two matrix operands be exactly the same size.
• Matrix conjugation: This operation is meaningful only for complex-
valued matrices. It produces a matrix in which all imaginary parts are
negated. It is denoted by A∗ in analysis and by conj(A) in MATLAB.
• Matrix transposition: This is an operation in which every row (col-
umn) is turned into column (row). Let X be an (N × M ) matrix. Then

X = [xji ] ; j = 1, . . . , M, i = 1, . . . , N

is an (M × N ) matrix. In MATLAB, this operation has one additional


feature. If the matrix is real-valued, then the operation produces the

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
A Brief Introduction to MATLAB 9

usual transposition. However, if the matrix is complex-valued, then the


operation produces a complex-conjugate transposition. To obtain just
the transposition, we use the array operation of conjugation, that is,
A. will do just the transposition.
• Multiplication by a scalar: This is a simple straightforward
operation in which each element of a matrix is scaled by a constant,
that is,

ab ⇒ a*b (scalar)

ax ⇒ a*x (vector or array)

aX ⇒ a*X (matrix)

This operation is also valid for an array scaling by a constant.


• Vector-vector multiplication: In this operation, one has to be care-
ful about matrix dimensions to avoid invalid results. The operation
produces either a scalar or a matrix. Let x be an (N × 1) and y be a
(1 × M ) vectors. Then
   
x1 x1 y 1 ··· x1 yM
 ..     . .. .. 
x ∗ y ⇒ xy =  .  y1 · · · yM =  .. . . 
xN xN y1 ··· xN yM

produces a matrix. If M = N , then


 
x1
 .  
y ∗ x ⇒ yx = y1 · · · yM  ..  = x1 y1 + · · · + xM yM
xM

• Matrix-vector multiplication: If the matrix and the vector are com-


patible (i.e., the number of matrix-columns is equal to the vector-rows),
then this operation produces a column vector:
    
a11 ··· a1M x1 y1
 .. .. ..   ..  =  .. 
y = A*x ⇒ y = Ax =  . . .  .   . 
aN 1 ··· aN M xM yN

• Matrix-matrix multiplication: Finally, if two matrices are compat-


ible, then their product is well-defined. The result is also a matrix with
the number of rows equal to that of the first matrix and the number
of columns equal to that of the second matrix. Note that the order in
matrix multiplication is very important.

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
10 Chapter 1 INTRODUCTION

Array Operations These operations treat matrices as arrays. They


are also known as dot operations because the arithmetic operators are
prefixed by a dot (.), that is, .*, ./, or .^.
• Array multiplication: This is an element by element multiplication
operation. For it to be a valid operation, both arrays must be the same
size. Thus we have
x.*y → 1D array
X.*Y → 2D array
• Array exponentiation: In this operation, a scalar (real- or complex-
valued) is raised to the power equal to every element in an array, that is,
 
ax1
 ax2 
 
a.ˆx ≡ 
 .. 

 . 
axN

is an (N × 1) array, whereas
 x 
a 11 ax12 ··· ax1M
 ax21 ax22 ··· ax2M 
 
a.ˆX ≡ 
 .. .. .. .. 

 . . . . 
axN 1 axN 2 ··· axN M

is an (N × M ) array.
• Array transposition: As explained, the operation A. produces trans-
position of real- or complex-valued array A.

Indexing Operations MATLAB provides very useful and powerful ar-


ray indexing operations using operator :. It can be used to generate se-
quences of numbers as well as to access certain row/column elements of a
matrix. Using the fragment x = [a:b:c], we can generate numbers from
a to c in b increments. If b is positive (negative) then, we get increasing
(decreasing) values in the sequence x.
The fragment x(a:b:c) accesses elements of x beginning with index
a in steps of b and ending at c. Care must be taken to use integer values
of indexing elements. Similarly, the : operator can be used to extract a
submatrix from a matrix. For example, B = A(2:4,3:6) extracts a 3 × 4
submatrix starting at row 2 and column 3.
Another use of the : operator is in forming column vectors from row
vectors or matrices. When used on the right-hand side of the equality (=)
operator, the fragment x=A(:) forms a long column vector x of elements

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
A Brief Introduction to MATLAB 11

of A by concatenating its columns. Similarly, x=A(:,3) forms a vector x


from the third column of A. However, when used on the right-hand side
of the = operator, the fragment A(:)=x reformats elements in x into a
predefined size of A.

Control-Flow MATLAB provides a variety of commands that allow


us to control the flow of commands in a program. The most common
construct is the if-elseif-else structure. With these commands, we can
allow different blocks of code to be executed depending on some condition.
The format of this construct is

if condition1
command1
elseif condition2
command2
else
command3
end

which executes statements in command1 if condition-1 is satisfied; other-


wise statements in command2 if condition-2 is satisfied, or finally state-
ments in command3.
Another common control flow construct is the for..end loop. It is
simply an iteration loop that tells the computer to repeat some task a
given number of times. The format of a for..end loop is

for index = values


program statements
:
end

Although for..end loops are useful for processing data inside of arrays by
using the iteration variable as an index into the array, whenever possible
the user should try to use MATLAB’s whole array mathematics. This will
result in shorter programs and more efficient code. In some situations the
use of the for..end loop is unavoidable. The following example illustrates
these concepts.

 EXAMPLE 1.1 Consider the following sum of sinusoidal functions.


3
1
x(t) = sin(2πt) + 1
3
sin(6πt) + 1
5
sin(10πt) = sin(2πkt), 0≤t≤1
k
k=1

Using MATLAB, we want to generate samples of x(t) at time instances


0:0.01:1. We will discuss three approaches.

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
12 Chapter 1 INTRODUCTION

Approach 1 Here we will consider a typical C or Fortran approach, that is, we will use two
for..end loops, one each on t and k. This is the most inefficient approach in
MATLAB, but possible.

>> t = 0:0.01:1; N = length(t); xt = zeros(1,N);


>> for n = 1:N
>> temp = 0;
>> for k = 1:3
>> temp = temp + (1/k)*sin(2*pi*k*t(n));
>> end
>> xt(n) = temp;
>> end

Approach 2 In this approach, we will compute each sinusoidal component in one step as a
vector, using the time vector t = 0:0.01:1 and then add all components using
one for..end loop.

>> t = 0:0.01:1; xt = zeros(1,length(t));


>> for k = 1:3
>> xt = xt + (1/k)*sin(2*pi*k*t);
>> end

Clearly, this is a better approach with fewer lines of code than the first one.

Approach 3 In this approach, we will use matrix-vector multiplication, in which MATLAB


is very efficient. For the purpose of demonstration, consider only four values for
t = [t1 , t2 , t3 , t4 ]. Then
1 1
x(t1 ) = sin(2πt1 ) + 3
sin(2π3t1 ) + 5
sin(2π5t1 )
1 1
x(t2 ) = sin(2πt2 ) + 3
sin(2π3t2 ) + 5
sin(2π5t2 )
1 1
x(t3 ) = sin(2πt3 ) + 3
sin(2π3t3 ) + 5
sin(2π5t3 )
1 1
x(t4 ) = sin(2πt4 ) + 3
sin(2π3t4 ) + 5
sin(2π5t4 )

which can be written in matrix form as


  sin(2πt1 ) sin(2π3t1 ) 
sin(2π5t1 )  
x(t1 )
x(t2 )   1
   sin(2πt2 ) sin(2π3t2 ) sin(2π5t2 )  1 
 =  
x(t3 )  sin(2πt3 ) sin(2π3t3 )
 3
sin(2π5t3 ) 1
5
x(t4 ) sin(2πt4 ) sin(2π3t4 ) sin(2π5t4 )

  
t1  
  t2    1
     1 
= sin 2π   1 3 5   3 
  t3   1
5
t4

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
A Brief Introduction to MATLAB 13

or after taking transposition


   
1
   1 1
    
x(t1 ) x(t2 ) x(t3 ) x(t4 ) = 1 3 5
sin 2π 3 t1 t2 t3 t4 
5
Thus the MATLAB code is

>> t = 0:0.01:1; k = 1:3;


>> xt = (1./k)*sin(2*pi*k’*t);

Note the use of the array division (1./k) to generate a row vector and ma-
trix multiplications to implement all other operations. This is the most compact
code and the most efficient execution in MATLAB, especially when the number
of sinusoidal terms is very large.

1.2.3 SCRIPTS AND FUNCTIONS


MATLAB is convenient in the interactive command mode if we want to
execute few lines of code. But it is not efficient if we want to write code of
several lines that we want to run repeatedly or if we want to use the code
in several programs with different variable values. MATLAB provides two
constructs for this purpose.
Scripts The first construct can be accomplished by using the so-called
block mode of operation. In MATLAB, this mode is implemented using
a script file called an m-file (with an extension .m), which is only a text
file that contains each line of the file as though you typed them at the
command prompt. These scripts are created using MATLAB’s built-in
editor, which also provides for context-sensitive colors and indents for
making fewer mistakes and for easy reading. The script is executed by
typing the name of the script at the command prompt. The script file must
be in the current directory on in the directory of the path environment.
As an example, consider the sinusoidal function in Example 1.1. A general
form of this function is
K
x(t) = ck sin(2πkt) (1.1)
k=1

If we want to experiment with different values of the coefficients ck and/or


the number of terms K, then we should create a script file. To implement
the third approach in Example 1.1, we can write a script file

% Script file to implement (1.1)


t = 0:0.01:1; k = 1:2:5; ck = 1./k;
xt = ck * sin(2*pi*k’*t);

Now we can experiment with different values.

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
14 Chapter 1 INTRODUCTION

Functions The second construct of creating a block of code is through


subroutines. These are called functions, which also allow us to extend the
capabilities of MATLAB. In fact a major portion of MATLAB is assem-
bled using function files in several categories and using special collections
called toolboxes. Functions are also m-files (with extension .m). A major
difference between script and function files is that the first executable
line in a function file begins with the keyword function followed by an
output-input variable declaration. As an example, consider the compu-
tation of the x(t) function in Example 1.1 with an arbitrary number of
sinusoidal terms, which we will implement as a function stored as m-file
sinsum.m.

function xt = sinsum(t,ck)
% Computes sum of sinusoidal terms of the form in (1.1)
% x = sinsum(t,ck)
%
K = length(ck); k = 1:K;
ck = ck(:)’; t = t(:)’;
xt = ck * sin(2*pi*k’*t);

The vectors t and ck should be assigned prior to using the sinsum


function. Note that ck(:)’ and t(:)’ use indexing and transposition
operations to force them to be row vectors. Also note the comments im-
mediately following the function declaration, which are used by the help
sinsum command. Sufficient information should be given there for the user
to understand what the function is supposed to do.

1.2.4 PLOTTING
One of the most powerful features of MATLAB for signal and data analysis
is its graphical data plotting. MATLAB provides several types of plots,
starting with simple two-dimensional (2D) graphs to complex, higher-
dimensional plots with full-color capability. We will examine only the 2D
plotting, which is the plotting of one vector versus another in a 2D coor-
dinate system. The basic plotting command is the plot(t,x) command,
which generates a plot of x values versus t values in a separate figure
window. The arrays t and x should be the same length and orientation.
Optionally, some additional formatting keywords can also be provided in
the plot function. The commands xlabel and ylabel are used to add
text to the axis, and the command title is used to provide a title on
the top of the graph. When plotting data, one should get into the habit
of always labeling the axis and providing a title. Almost all aspects of
a plot (style, size, color, etc.) can be changed by appropriate commands
embedded in the program or directly through the GUI.

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
A Brief Introduction to MATLAB 15

The following set of commands creates a list of sample points, eval-


uates the sine function at those points, and then generates a plot of a
simple sinusoidal wave, putting axis labels and title on the plot.

>> t = 0:0.01:2; % sample points from 0 to 2 in steps of 0.01


>> x = sin(2*pi*t); % Evaluate sin(2 pi t)
>> plot(t,x,’b’); % Create plot with blue line
>> xlabel(’t in sec’); ylabel(’x(t)’); % Label axis
>> title(’Plot of sin(2\pi t)’); % Title plot

The resulting plot is shown in Figure 1.1.


For plotting a set of discrete numbers (or discrete-time signals), we
will use the stem command which displays data values as a stem, that
is, a small circle at the end of a line connecting it to the horizontal axis.
The circle can be open (default) or filled (using the option ’filled’).
Using Handle Graphics (MATLAB’s extensive manipulation of graphics
primitives), we can resize circle markers. The following set of commands
displays a discrete-time sine function using these constructs.

>> n = 0:1:40; % sample index from 0 to 20


>> x = sin(0.1*pi*n); % Evaluate sin(0.2 pi n)
>> Hs = stem(n,x,’b’,’filled’); % Stem-plot with handle Hs
>> set(Hs,’markersize’,4); % Change circle size
>> xlabel(’n’); ylabel(’x(n)’); % Label axis
>> title(’Stem Plot of sin(0.2 pi n)’); % Title plot

The resulting plot is shown in Figure 1.2.


MATLAB provides an ability to display more than one graph in the
same figure window. By means of the hold on command, several graphs
can be plotted on the same set of axes. The hold off command stops
the simultaneous plotting. The following MATLAB fragment (Figure 1.3)

Plot of sin(2π t)
1

0.5
x(t)

–0.5

–1
0 0.5 1 1.5 2
t in sec

FIGURE 1.1 Plot of the sin(2πt) function

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
16 Chapter 1 INTRODUCTION

Stem Plot of sin(0.2 π n)


1

0.5

x(n)
0

–0.5

–1
0 5 10 15 20 25 30 35 40
n

FIGURE 1.2 Plot of the sin(0.2π n) sequence

displays graphs in Figures 1.1 and 1.2 as one plot, depicting a “sampling”
operation that we will study later.

>> plot(t,xt,’b’); hold on; % Create plot with blue line


>> Hs = stem(n*0.05,xn,’b’,’filled’); % Stem-plot with handle Hs
>> set(Hs,’markersize’,4); hold off; % Change circle size

Another approach is to use the subplot command, which displays


several graphs in each individual set of axes arranged in a grid, using the
parameters in the subplot command. The following fragment (Figure 1.4)
displays graphs in Figure 1.1 and 1.2 as two separate plots in two rows.

. . .
>> subplot(2,1,1); % Two rows, one column, first plot
>> plot(t,x,’b’); % Create plot with blue line
. . .
>> subplot(2,1,2); % Two rows, one column, second plot
>> Hs = stem(n,x,’b’,’filled’); % Stem-plot with handle Hs
. . .

Plot of sin(2π t) and its samples


1

0.5
x(t) and x(n)

–0.5

–1
0 0.5 1 1.5 2
t in sec

FIGURE 1.3 Simultaneous plots of x(t) and x(n)

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Applications of Digital Signal Processing 17

Plot of sin(2π t)
1

0.5

x(t)
0

–0.5

–1
0 0.5 1 1.5 2
t in sec
Stem Plot of sin(0.2π n)
1

0.5
x(n)

–0.5

–1
0 5 10 15 20 25 30 35 40
n

FIGURE 1.4 Plots of x(t) and x(n) in two rows

The plotting environment provided by MATLAB is very rich in


its complexity and usefulness. It is made even richer using the handle-
graphics constructs. Therefore, readers are strongly recommended to
consult MATLAB’s manuals on plotting. Many of these constructs will
be used throughout this book.
In this brief review, we have barely made a dent in the enormous
capabilities and functionalities in MATLAB. Using its basic integrated
help system, detailed help browser, and tutorials, it is possible to acquire
sufficient skills in MATLAB in a reasonable amount of time.

1.3 APPLICATIONS OF DIGITAL SIGNAL PROCESSING

The field of DSP has matured considerably over the last several decades
and now is at the core of many diverse applications and products. These
include
• speech/audio (speech recognition/synthesis, digital audio, equalization,
etc.),
• image/video (enhancement, coding for storage and transmission,
robotic vision, animation, etc.),
• military/space (radar processing, secure communication, missile guid-
ance, sonar processing, etc.),
• biomedical/health care (scanners, ECG analysis, X-ray analysis, EEG
brain mappers, etc.)

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
18 Chapter 1 INTRODUCTION

• consumer electronics (cellular/mobile phones, digital television, digital


camera, Internet voice/music/video, interactive entertainment systems,
etc) and many more.

These applications and products require many interconnected com-


plex steps, such as collection, processing, transmission, analysis, audio/
display of real-world information in near real time. DSP technology has
made it possible to incorporate these steps into devices that are inno-
vative, affordable, and of high quality (for example, iPhone from Apple,
Inc.). A typical application to music is now considered as a motivation
for the study of DSP.

Musical sound processing In the music industry, almost all musical


products (songs, albums, etc.) are produced in basically two stages. First,
the sound from an individual instrument or performer is recorded in an
acoustically inert studio on a single track of a multitrack recording device.
Then, stored signals from each track are digitally processed by the sound
engineer by adding special effects and combined into a stereo recording,
which is then made available either on a CD or as an audio file.
The audio effects are artificially generated using various signal-
processing techniques. These effects include echo generation, reverber-
ation (concert hall effect), flanging (in which audio playback is slowed
down by placing DJ’s thumb on the flange of the feed reel), chorus effect
(when several musicians play the same instrument with small changes
in amplitudes and delays), and phasing (aka phase shifting, in which
an audio effect takes advantage of how sound waves interact with each
other when they are out of phase). These effects are now generated using
digital-signal-processing techniques. We now discuss a few of these sound
effects in some detail.

Echo Generation The most basic of all audio effects is that of time
delay, or echoes. It is used as the building block of more complicated effects
such as reverb or flanging. In a listening space such as a room, sound
waves arriving at our ears consist of direct sound from the source as well
as reflected off the walls, arriving with different amounts of attenuation
and delays.
Echoes are delayed signals, and as such are generated using delay
units. For example, the combination of the direct sound represented by
discrete signal y[n] and a single echo appearing D samples later (which is
related to delay in seconds) can be generated by the equation of the form
(called a difference equation)

x[n] = y[n] + αy[n − D], |α| < 1 (1.2)

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Applications of Digital Signal Processing 19

where x[n] is the resulting signal and α models attenuation of the di-
rect sound. Difference equations are implemented in MATLAB using the
filter function. Available in MATLAB is a short snippet of Handel’s
hallelujah chorus, which is a digital sound about 9 seconds long, sampled
at 8192 sam/sec. To experience the sound with echo in (1.2), execute
the following fragment at the command window. The echo is delayed by
D = 4196 samples, which amount to 0.5 sec of delay.

load handel; % the signal is in y and sampling freq in Fs


sound(y,Fs); pause(10); % Play the original sound
alpha = 0.9; D = 4196; % Echo parameters
b = [1,zeros(1,D),alpha]; % Filter parameters
x = filter(b,1,y); % Generate sound plus its echo
sound(x,Fs); % Play sound with echo

You should be able to hear the distinct echo of the chorus in about a
half second.

Echo Removal After executing this simulation, you may experience


that the echo is an objectionable interference while listening. Again DSP
can be used effectively to reduce (almost eliminate) echoes. Such an echo-
removal system is given by the difference equation
w[n] + αw[n − D] = x[n] (1.3)
where x[n] is the echo-corrupted sound signal and w[n] is the output
sound signal, which has the echo (hopefully) removed. Note again that
this system is very simple to implement in software or hardware. Now try
the following MATLAB script on the signal x[n].

w = filter(1,b,x);
sound(w,Fs)

The echo should no longer be audible.

Digital Reverberation Multiple close-spaced echoes eventually lead


to reverberation, which can be created digitally using a somewhat more
involved difference equation
N −1
x[n] = αk y[n − kD] (1.4)
k=0
which generates multiple echoes spaced D samples apart with exponen-
tially decaying amplitudes. Another natural sounding reverberation is

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
20 Chapter 1 INTRODUCTION

given by

x[n] = αy[n] + y[n − D] + αx[n − D], |α| < 1 (1.5)

which simulates a higher echo density.


These simple applications are examples of DSP. Using techniques,
concepts, and MATLAB functions learned in this book you should be
able to simulate these and other interesting sound effects.

1.4 BRIEF OVERVIEW OF THE BOOK

The first part of this book, which comprises Chapters 2 through 5, deals
with the signal-analysis aspect of DSP. Chapter 2 begins with basic de-
scriptions of discrete-time signals and systems. These signals and systems
are analyzed in the frequency domain in Chapter 3. A generalization of
the frequency-domain description, called the z-transform, is introduced in
Chapter 4. The practical algorithms for computing the Fourier transform
are discussed in Chapter 5 in the form of the discrete Fourier transform
and the fast Fourier transform.
Chapters 6 through 8 constitute the second part of this book, which is
devoted to the signal-filtering aspect of DSP. Chapter 6 describes various
implementations and structures of digital filters. It also introduces finite-
precision number representation, filter coefficient quantization, and its
effect on filter performance. Chapter 7 introduces design techniques and
algorithms for designing one type of digital filter called finite-duration
impulse response (FIR) filters, and Chapter 8 provides a similar treatment
for another type of filter called infinite-duration impulse response (IIR)
filters. In both chapters only the simpler but practically useful techniques
of filter design are discussed. More advanced techniques are not covered.
Finally, the last part, which consists of the remaining four chapters,
provides important topics and applications in DSP. Chapter 9 deals with
the useful topic of the sampling-rate conversion and applies FIR filter de-
signs from Chapter 7 to design practical sample-rate converters. Chapter
10 extends the treatment of finite-precision numerical representation to
signal quantization and the effect of finite-precision arithmetic on filter
performance. The last two chapters provide some practical applications
in the form of projects that can be done using material presented in the
first 10 chapters. In Chapter 11, concepts in adaptive filtering are intro-
duced, and simple projects in system identification, interference suppres-
sion, adaptive line enhancement, and so forth are discussed. In Chapter 12
a brief introduction to digital communications is presented with projects
involving such topics as PCM, DPCM, and LPC being outlined.

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Brief Overview of the Book 21

In all these chapters, the central theme is the generous use and ad-
equate demonstration of MATLAB, which can be used as an effective
teaching as well as learning tool. Most of the existing MATLAB functions
for DSP are described in detail, and their correct use is demonstrated in
many examples. Furthermore, many new MATLAB functions are devel-
oped to provide insights into the working of many algorithms. The authors
believe that this hand-holding approach enables students to dispel fears
about DSP and provides an enriching learning experience.

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
CHAPTER 2
Discrete-time
Signals and
Systems

We begin with the concepts of signals and systems in discrete time. A


number of important types of signals and their operations are introduced.
Linear and shift-invariant systems are discussed mostly because they are
easier to analyze and implement. The convolution and the difference equa-
tion representations are given special attention because of their impor-
tance in digital signal processing and in MATLAB. The emphasis in this
chapter is on the representations and implementation of signals and sys-
tems using MATLAB.

2.1 DISCRETE-TIME SIGNALS

Signals are broadly classified into analog and discrete signals. An analog
signal will be denoted by xa (t), in which the variable t can represent any
physical quantity, but we will assume that it represents time in seconds. A
discrete signal will be denoted by x(n), in which the variable n is integer-
valued and represents discrete instances in time. Therefore it is also called
a discrete-time signal, which is a number sequence and will be denoted by
one of the following notations:
x(n) = {x(n)} = {. . . , x(−1), x(0), x(1), . . .}

where the up-arrow indicates the sample at n = 0.

22
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Discrete-time Signals 23

In MATLAB we can represent a finite-duration sequence by a row


vector of appropriate values. However, such a vector does not have any
information about sample position n. Therefore a correct representation
of x(n) would require two vectors, one each for x and n. For example, a
sequence x(n) = {2, 1, −1, 0, 1, 4, 3, 7} can be represented in MATLAB by

>> n=[-3,-2,-1,0,1,2,3,4]; x=[2,1,-1,0,1,4,3,7];

Generally, we will use the x-vector representation alone when the sample
position information is not required or when such information is trivial
(e.g. when the sequence begins at n = 0). An arbitrary infinite-duration
sequence cannot be represented in MATLAB due to the finite memory
limitations.

2.1.1 TYPES OF SEQUENCES


We use several elementary sequences in digital signal processing for anal-
ysis purposes. Their definitions and MATLAB representations follow.
1. Unit sample sequence:
  
1, n = 0
δ(n) = = . . . , 0, 0, 1, 0, 0, . . .
 0
0, n = ↑

In MATLAB the function zeros(1,N) generates a row vector of N


zeros, which can be used to implement δ(n) over a finite interval. How-
ever, the logical relation n==0 is an elegant way of implementing δ(n).
For example, to implement

1, n = n0
δ(n − n0 ) =
0, n = n0
over the n1 ≤ n0 ≤ n2 interval, we will use the following MATLAB
function.

function [x,n] = impseq(n0,n1,n2)


% Generates x(n) = delta(n-n0); n1 <= n <= n2
% ----------------------------------------------
% [x,n] = impseq(n0,n1,n2)
%
n = [n1:n2]; x = [(n-n0) == 0];

2. Unit step sequence:



1, n ≥ 0
u(n) = = {. . . , 0, 0, 1, 1, 1, . . .}
0, n < 0 ↑

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
24 Chapter 2 DISCRETE-TIME SIGNALS AND SYSTEMS

In MATLAB the function ones(1,N) generates a row vector of N ones.


It can be used to generate u(n) over a finite interval. Once again an
elegant approach is to use the logical relation n>=0. To implement

1, n ≥ n0
u(n − n0 ) =
0, n < n0

over the n1 ≤ n0 ≤ n2 interval, we will use the following MATLAB


function.

function [x,n] = stepseq(n0,n1,n2)


% Generates x(n) = u(n-n0); n1 <= n <= n2
% ------------------------------------------
% [x,n] = stepseq(n0,n1,n2)
%
n = [n1:n2]; x = [(n-n0) >= 0];

3. Real-valued exponential sequence:

x(n) = an , ∀n; a ∈ R

In MATLAB an array operator “.^” is required to implement a real


exponential sequence. For example, to generate x(n) = (0.9)n , 0 ≤
n ≤ 10, we will need the following MATLAB script:

>> n = [0:10]; x = (0.9).^n;

4. Complex-valued exponential sequence:

x(n) = e(σ+jω0 )n , ∀n

where σ produces an attenuation (if <0) or amplification (if >0)


and ω0 is the frequency in radians. A MATLAB function exp is
used to generate exponential sequences. For example, to generate
x(n) = exp[(2 + j3)n], 0 ≤ n ≤ 10, we will need the following MATLAB
script:

>> n = [0:10]; x = exp((2+3j)*n);

5. Sinusoidal sequence:

x(n) = A cos(ω0 n + θ0 ), ∀n

where A is an amplitude and θ0 is the phase in radians. A MAT-


LAB function cos (or sin) is used to generate sinusoidal sequences.

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Discrete-time Signals 25

For example, to generate x(n) = 3 cos(0.1πn + π/3) + 2 sin(0.5πn),


0 ≤ n ≤ 10, we will need the following MATLAB script:

>> n = [0:10]; x = 3*cos(0.1*pi*n+pi/3) + 2*sin(0.5*pi*n);

6. Random sequences: Many practical sequences cannot be described


by mathematical expressions like those above. These sequences are
called random (or stochastic) sequences and are characterized by pa-
rameters of the associated probability density functions. In MATLAB
two types of (pseudo-) random sequences are available. The rand(1,N)
generates a length N random sequence whose elements are uniformly
distributed between [0, 1]. The randn(1,N) generates a length N Gaus-
sian random sequence with mean 0 and variance 1. Other random se-
quences can be generated using transformations of the above functions.
7. Periodic sequence: A sequence x(n) is periodic if x(n) = x(n + N ),
∀n. The smallest integer N that satisfies this relation is called the
fundamental period. We will use x̃(n) to denote a periodic sequence.
To generate P periods of x̃(n) from one period {x(n), 0 ≤ n ≤ N −1},
we can copy x(n) P times:

>> xtilde = [x,x,...,x];

But an elegant approach is to use MATLAB’s powerful indexing capa-


bilities. First we generate a matrix containing P rows of x(n) values.
Then we can concatenate P rows into a long row vector using the
construct (:). However, this construct works only on columns. Hence
we will have to use the matrix transposition operator ’ to provide the
same effect on rows.

>> xtilde = x’ * ones(1,P); % P columns of x; x is a row vector


>> xtilde = xtilde(:); % long column vector
>> xtilde = xtilde’; % long row vector

Note that the last two lines can be combined into one for compact
coding. This is shown in Example 2.1.

2.1.2 OPERATIONS ON SEQUENCES


Here we briefly describe basic sequence operations and their MATLAB
equivalents.
1. Signal addition: This is a sample-by-sample addition given by
{x1 (n)} + {x2 (n)} = {x1 (n) + x2 (n)}

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
26 Chapter 2 DISCRETE-TIME SIGNALS AND SYSTEMS

It is implemented in MATLAB by the arithmetic operator “+”. How-


ever, the lengths of x1 (n) and x2 (n) must be the same. If sequences are
of unequal lengths, or if the sample positions are different for equal-
length sequences, then we cannot directly use the operator +. We have
to first augment x1 (n) and x2 (n) so that they have the same position
vector n (and hence the same length). This requires careful attention
to MATLAB’s indexing operations. In particular, logical operation of
intersection “&”, relational operations like “<=” and “==”, and the
find function are required to make x1 (n) and x2 (n) of equal length.
The following function, called the sigadd function, demonstrates these
operations.

function [y,n] = sigadd(x1,n1,x2,n2)


% implements y(n) = x1(n)+x2(n)
% -----------------------------
% [y,n] = sigadd(x1,n1,x2,n2)
% y = sum sequence over n, which includes n1 and n2
% x1 = first sequence over n1
% x2 = second sequence over n2 (n2 can be different from n1)
%
n = min(min(n1),min(n2)):max(max(n1),max(n2)); % duration of y(n)
y1 = zeros(1,length(n)); y2 = y1; % initialization
y1(find((n>=min(n1))&(n<=max(n1))==1))=x1; % x1 with duration of y
y2(find((n>=min(n2))&(n<=max(n2))==1))=x2; % x2 with duration of y
y = y1+y2; % sequence addition

Its use is illustrated in Example 2.2.


2. Signal multiplication: This is a sample-by-sample (or “dot”) multi-
plication) given by
{x1 (n)} · {x2 (n)} = {x1 (n)x2 (n)}
It is implemented in MATLAB by the array operator .*. Once again,
the similar restrictions apply for the .* operator as for the + operator.
Therefore we have developed the sigmult function, which is similar to
the sigadd function.

function [y,n] = sigmult(x1,n1,x2,n2)


% implements y(n) = x1(n)*x2(n)
% -----------------------------
% [y,n] = sigmult(x1,n1,x2,n2)
% y = product sequence over n, which includes n1 and n2
% x1 = first sequence over n1
% x2 = second sequence over n2 (n2 can be different from n1)
%

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Random documents with unrelated
content Scribd suggests to you:
duca di Fagnano capo di una comitiva di...? Ah, Geltrude, tu non
puoi intendere che dolore sarà per suo padre! Come dice la carta?
L’ho letta or ora e l’ho tutta innanzi agli occhi: Che inesorabilmente
saranno puniti i colpevoli e non si farà alcun male agl’innocenti. Ora,
chi più colpevole, agli occhi dei Francesi, di lui, di Riccardo? Chi ha
ucciso più soldati? E a quelli lì per ogni loro soldato ferito, non
bastano a vendetta venti vite delle nostre! Ah, Geltrude, Geltrude, io
nel leggere il nome del duca Tommaso di Fagnano a piè di quella
carta ero per morire dalla gioia; ma ora, ora, dopo aver bene
riflettuto, mi sento morire dallo spavento!
— Scusa sai, ma io non lo comprendo un tale spavento — rispose lei.
— Io capirei, sì, che tu ne morissi dalla gioia, ma dallo spavento!...
— Perchè tu — proruppe lui — non intendi, non intendi! Un padre
che ritrova il figlio suo a capo di gente macchiata di ogni delitto, via,
non illudiamoci... macchiata di ogni delitto, quando poi tal padre è
un nobile, uno dei primi nobili del Regno, e vien qui per punire
coloro che hanno messo a subbuglio queste contrade, alle quali poi
non so che debba importare se il governo sia borbonico o francese!
Ho inteso dire che altra volta fu spagnuolo, un’altra aragonese,
un’altra angioino; ma noi, povera gente, fummo sempre angariati, e
se ne verrà un altro che invece d’una bandiera bianca, come quella
dei Borboni, ne farà sventolare una di tre colori, come quella dei
Francesi, sarà lo stesso per noi, credi a me, lo stesso; e sai che ci
avremo guadagnato? che il re invece di chiamarsi Ferdinando si
chiamerà Carmine come me, o Francesco Antonio come il fu tuo
padre, e sarà detto grande, leale, munifico, magnanimo nè più nè
meno come l’altro che si chiamava Carlo, Ferdinando o Francesco!
— Questo è vero: chi è nato incudine...
— E tutti i governi, tutti, anche quelli, anzi specialmente quelli che
sdilinguono pei dolori e le miserie del povero popolo, sono martelli
che battono su noi martelli tanto più forti, per quanto ostentano di
aver pietà di noi!
— Ma insomma che pensi di fare? — chiese Geltrude a cui pareva
che il povero uomo avesse dato di volta.
— Non lo so, te lo giuro, non lo so. Andar da quel povero vecchio...
che credo sia divenuto vecchio almeno quanto me... son trent’anni
oramai!... andar da quel povero vecchio e dirgli: il tuo figliuolo è il
capo di coloro che tu cerchi per far tagliar loro la testa: il tuo
figliuolo mostra con le sue ferite quanto ostinata fu la sua resistenza:
il tuo figliuolo fu colui che fece strage dei tuoi soldati: il tuo figliuolo
è fra i primi di coloro che tu dovrai condannare a morte... che vuoi ti
dica? non so risolvermi a farlo, perchè so che darei un gran dolore,
un mortale dolore a quel povero vecchio, senza forse salvar la vita di
quel povero Riccardo!
— Ah — scoppiò lei che non ne poteva più. — E dunque per un tale
scrupolo vorresti lasciar morire quel povero giovane? Dunque per un
tale scrupolo vorresti che un padre lasciasse tagliar la testa al suo
figliuolo, e per giunta ne pronunziasse lui la sentenza? E non temi tu
che se il duca un giorno venisse a sapere che per causa tua fece
condannare il figlio alle forche, il proprio figlio, intendi? avrebbe il
diritto di punir te che gli facesti commettere un tale orrore?
— È anche vero questo, anche vero! — balbettò Carmine.
— Del resto, il tuo sacrosanto dovere è di attenere la promessa che
facesti a quella moribonda. Tu non devi preoccuparti d’altro. Perciò
dimani ti presenterai al duca, gli dirai chi sei; se egli non ti riconosce
gli consegnerai la lettera della sua povera sposa; gli dirai infine che il
figlio suo è tra i feriti, e te ne tornerai qui tranquillo e contento
d’aver fatto il tuo dovere.
— Sì, ma — disse Carmine tuttora perplesso — io poi dovrei anche
parlarne a Pietro il Toro...
— Mettigli il sale sulla coda a Pietro il Toro! Non è tra i feriti e non fu
trovato tra i morti. Chissà con quelle gambe storte quante miglia
avrà fatto! Ma La lettera fu data o non fu data a te? E dunque tu
devi consegnarla a chi è diretta.
— Mi hai convinto, mi hai convinto... Eppoi, è forse questo l’unico
mezzo per salvar la vita a quel povero giovane. Ti ringrazio,
Geltrude, d’esser venuta, ti ringrazio!
— E si dice poi che noialtre femmine non sappiamo dar dei consigli!
Senza di me chissà quando tu avresti saputo che il duca era tornato,
e chi sa se saresti stato in tempo per salvar dalla morte il povero
Riccardo... Ora, in compenso dammi da cena e concedimi il solito
cantuccio sulla panca del focolare...
— Non dormirò questa notte, non dormirò — borbottava Carmine. —
Chi se l’aspettava! Chi l’avrebbe creduto? Dopo trent’anni, nè più nè
meno, trent’anni!
II.

Si era in breve divulgata la nuova che due compagnie di soldati


avevano posto quartiere intorno al castello, e molti rivenduglioli,
rassicurati dalla voce sparsa che la più severa disciplina, cosa
veramente incredibile, le teneva a freno, eran venuti dalla città e dai
dintorni per esercitare le loro piccole industrie; anzi un furbo
contadino, sicuro di fare ottimi affari, aveva in una casetta in fondo
allo spiazzo del castello messo una tavernuola in cui vendeva del
buon vino e pane e companatico con gran contento dei soldati che
convenivano in essa a far la partita. Sicchè, in certe ore del giorno
specialmente, la tavernucola risuonava di voci e di canti ed era
ingombra di una folla di soldati che avevan trovato assai buono il
vino di Cicco il cantiniere, il quale aveva un suo metodo speciale per
mutar l’acqua della vicina fonte nel liquore sacro a Bacco, e sapeva
anche renderlo piacevole al gusto e non tanto dannoso al cervello.
E a poco a poco si erano andati addomesticando anche i contadini
del dintorno, i quali cominciavano a farsi intendere dai Francesi e ad
intenderli. Ne era nata una specie di lingua convenzionale che
sentiva del dialetto paesano e dell’argot soldatesco. Nè gli ufficiali
mal vedevano quella dimestichezza dalla quale potevano trarre
preziose notizie intorno agli intenti dei superstiti delle due bande, i
quali, a quel che si diceva, avevano in animo di raccogliersi per
ripigliare la lotta.
Otto giorni dopo il memorabile assalto al castello, in sull’imbrunire,
nella taverna di massaro Cicco erano riuniti alcuni sottufficiali
francesi che, seduti intorno a una tavola unta e bisunta, trincavano
allegramente il vinello che il tavernaio mesceva in certe caraffe da
una botticella dietro il bancone.
— Beh — disse un giovanotto — la vita qui non sarebbe poi tanto
sgradevole: buon vino, buona carne, buoni formaggi; manca però
qualcosa...
— Manca sempre qualcosa alla piena felicità dell’uomo! — sentenziò
un caporale.
— Sta a vedere l’importanza d’una tale qualcosa. Io per esempio
farei a meno della carne morta, ma non so fare a meno della carne
viva...
— Te lo dico io il rimedio — disse un sergente — l’acqua ghiacciata
della fontana qui presso...
— Oppure un altro... Si contempla per un pezzo fisso la luna e... e...
e si può fare a meno anche della carne viva...
— O amici, amici miei, non direste così se per un mese foste stati a
Garropoli, a Gimigliamo, a Marcellinara! Ah, miei cari, colà gli uomini
tutti briganti: le femmine bocconi da re... o da briganti! Che bellezza,
con quei corpetti rossi fiammanti, quelle camicie bianche qual neve,
che lascian vedere certe nevi calde e palpitanti... Non vi nascondo
che ci era da rischiar la pelle talvolta; alcuni nostri commilitoni che
nel seguirle avevano sperato di passar la notte fra quelle braccia
morbide e gagliarde, si trovarono poi fra le braccia villose dei mariti
e degli amanti e al mattino furono visti giacenti fra le erbe con un
buco in petto! Ma vi so dire io che ne vale la pena. Una sola volta si
muore, infine, e noi ogni giorno rischiamo di morire per molto, ma
molto meno!
— Per la gloria! — disse solennemente un baffuto brigadiere dei
volteggiatori.
— Ah, sì, la gloria! Vorrei un po’ sapere chi si ricorda più di tanti
nostri poveri commilitoni che l’altro giorno seppellimmo laggiù!
Avesse almeno la gloria un bel viso, un colmo petto, degli opulenti
fianchi....
— Taci, tu bestemmii — esclamò il brigadiere. — Alle Piramidi, a
Marengo essa camminava innanzi e ci additava la via tra un mucchio
di morti e di feriti, fra un nembo di fuoco e di fumo, e il rombo e lo
scoppiar della mitraglia.
Tutti zittirono; ma dopo un istante di silenzio, poichè pareva che le
parole del vecchio soldato avessero in qualche modo raffreddato il
buon umore, un caporale gridò:
— Ah, comprendo cos’è: manca il vino! Su, del vino, vecchio
tavernaio!
Massaro Cicco dormicchiava dietro il bancone; a quel grido si scosse,
si alzò e poco dopo fece ritorno con altre carafe piene e le posò sulla
tavola.
Ma il giovanotto, cui l’ebbrezza aveva sciolto lo scilinguagnolo, non
volle arrendersi.
— Sì, non dico: la gloria è una gran bella cosa e noi siamo per essa
qui; ma le femmine di Gimigliano e di Marcellinara... sono pure da
non disprezzarsi, e di uso più immediato della gloria. È vero però che
quanto più gli anni passano meno si apprezzano, e il nostro glorioso
brigadiere è già in quegli anni che....
— Che non impediscono di rompere il muso ad uno sbarbatello come
te — gridò il brigadiere.
— Andiamo, andiamo, si vien qui per divertirsi — gridarono gli altri,
alcuni dei quali si erano alzati per interporsi. — Sapete che il
capitano ha minacciato di far chiudere la cantina se vi faremo
chiasso? Diavolo, siamo dei bravi soldati, dei buoni amici, e
dobbiamo guastarci il sangue per un’inezia?
— Per me non serbo rancore — disse il sergentino — ma non voglio
che mi si disprezzino le belle femmine di Gimigliano e di Marcellinara,
ecco...
— Io non ho inteso disprezzare chi non ho mai visto — disse alla sua
volta il brigadiere.
Anche a lui lucevano gli occhietti come al sergentino. Non erano del
tutto ubbriachi ma poco vi mancava.
— Orsù — disse alzandosi un caporale — risolvo io la questione:
facciamo un brindisi alla gloria e un altro alle belle femmine di
Gimigliano.
— Sì, bravo, bene: alla gloria e alle belle femmine!
— Di Gimigliano e di Marcellinara... — aggiunse il sergentino con
l’ostinatezza propria degli ubbriachi.
— Come vuoi: di Gimigliano e di Marcellinara.
I volti erano arrossati, gli occhi lucenti; le lingue incominciavano a
confondersi.
La porta si aprì spinta da una mano. Al rumore tutti si rivolsero.
Videro sull’uscio un povero vecchio sciancato e controfatto che si
sforzava di salire il gradino che metteva nella taverna. Dietro a lui,
una giovane donna dalle vesti diverse da quelle che usavano le
contadine di quel dintorno, cercava di sorreggerlo e di spingerlo nella
taverna.
Il vecchio entrò: appoggiava la tozza e bassa persona ad un ramo
d’albero dispogliato delle fronde; un cappellaccio gli copriva il capo
canuto e una bisaccia che pareva ben ricolma gli pendeva a
cavalcioni dell’omero.
— Andiamo, via, nonno — disse la giovane donna — che questa
buona gente permetterà che ci riposiamo qui per questa notte, e ce
lo permetterà anche il fondachiere quando saprà che abbiamo di che
pagare l’alloggio e la cena.
— Non ne posso più, non ne posso più! — gemeva il vecchio. Poi
volgendo il capo lentamente verso il gruppo dei bevitori con voce
fioca e piagnucolosa disse:
— Permettete, bravi soldati, che segga in un cantuccio. Mi trascino
da stamane, sorretto da questa povera figliuola che si tiene in piedi
per miracolo.
— Ma sicuro, ma sicuro: sedete, buon vecchio — risposero a coro i
sottufficiali.
Ma nel dir ciò nessuno badava al vecchio, intesi com’erano ad
ammirare la giovane donna, la cui bellezza era degna dello stupore
che aveva destato. Alta, slanciata, il bel viso di un sano pallore si
delineava tra i lembi d’una bianca tovagliuola che, appuntata ai neri
riccioluti capelli, le scendeva per le spalle. Un corpetto scarlatto ne
stringeva il busto ricolmo, dal quale uscivan fuori i pizzi della camicia
lasciando discoperto il sommo del seno ed il collo rotondo e pastoso:
una gonnelletta verde, il colore che indica la nubilanza, scendeva
fino ai garretti sottili, lasciando vedere un piedino calzato di leggiere
scarpette.
— Ah! — disse il sergentino con gli occhi più degli altri accesi —
eccovene una, eccovene una... La riconosco alle vesti, la riconosco...
A queste parole la donna si era fatta indietro e aveva messo la mano
nel corpetto con un atto rapido e con un viso che aveva avuto una
strana espressione d’ira e insieme di ardimento. Anche il vecchio si
era sollevato con una energia che sarebbe parsa ben singolare a chi
l’avesse notata; ma ella si rimise d’un subito e chinò la testa in atto
pudicamente timido. Il vecchio riprese a tentennare il capo, allorchè
il sergentino continuò:
— È una ragazza di Gimigliano, la riconosco alle vesti, e vi so dire
anche che è zitella dal color verde della gonna. Ora ditemi voi se non
avevo ragione io! Questa qui è la bella fra le belle, il sole fra gli astri,
la rosa fra i fiori. Che ne dici brigadiere La Harpe?
Il brigadiere La Harpe non si era mosso dal suo posto: guardava con
occhi imbambolati la giovane donna, lisciandosi i grossi baffi.
— Dico... dico che ho visto al Cairo delle odalische... le schiave dei
Mammalucchi... ne trovammo alcune sotto le tende, dopo la
battaglia... Questa qui è assai più bella. Sì, ma la gloria è una bella
cosa, anche come le odalische de’ Mammalucchi, e... questa qui...
— Il brigadiere è ito — disse il caporale all’orecchio del sergentino.
— Quando incomincia a parlare di Mammalucchi vuol dire che ci vuol
poco per andar giù, sotto la tavola. Domani il capitano gli darà i soliti
due giorni di consegna per lasciargli il tempo di digerire la sbornia.
Intanto la giovane donna pareva tutta intenta ad aver cura del
vecchio nonno. Gli aveva tolto la bisaccia per mettergliela vicino, gli
aveva fatto stendere le gambe su un’altra sedia, con disinvoltura
incurante dei sottufficiali che avevano dimenticato i colmi bicchieri
per seguire lei con gli occhi che andavano accendendosi vieppiù.
Solo massaro Cicco, nè si era mosso dal suo banco nè aveva fatto
alcun gesto di meraviglia. Ella gli si avvicinò:
— Un po’ di vino, un po’ di pane e di formaggio pel nonno, e per me
due uova. Resteremo qui questa notte; se avete dove alloggiarci vi
staremo anche dimani e forse diman l’altro, perchè il nonno,
poveretto, ha bisogno di due o tre giorni di riposo. Ecco, pagatevi
l’alloggio e il vitto.
— Non posso darvi — disse il fondachiere — che un po’ di paglia, lì
in fondo fra le due botti.
— Ci contenteremo — rispose la donna. — Quando non si ha di
meglio... si sta almeno al coperto.
Pareva affatto incurante di tutti quei soldati, fra i quali erano anche
alcuni di età matura, che la contemplavano con occhi accesi. Avevan
cessato dal bere e dal discorrere, mentre ella andava attorno svelta
e tranquilla come se fosse stata a casa sua, ed accudiva al suo
vecchio nonno, che mangiucchiava il pane ed il formaggio, con
premura affettuosa.
— E sono tutte così, tutte così? — disse il caporale al sergente senza
cessar dal contemplare la giovane donna.
— Son tutte belle — rispose il sergente — però questa qui ne è il
fiore. Si vede che è ancora ingenua, mentre le altre, quelle che ho
conosciuto io, darebbero cento punti al diavolo...
— Andiamo, su, da bere — bofonchiò il brigadiere La Harpe. — Una
femminuccia vi ha imbecilliti? Cantiniere, un altro di quei tuoi
boccali... come li chiami?... ah, sì un’altra carafa... Pago io, pago io,
e s’intuoni la Marsigliese... E voglio che questa bella ragazza beva
con noi alla salute dell’Imperatore e dei soldati francesi.
Massaro Cicco aveva posto sulla tavola un’altra carafa ed era tornato
al suo banco. Il brigadiere mescè del vino in un bicchiere e
volgendosi alla ragazza che in quel mentre affettava il pane pel
nonno:
— Ehi là, vieni qui... devi bere con noi, hai inteso? e se questi citrulli
ti guardano come se non avessero mai visto della grazia di Dio, non
sia detto che il vecchio La Harpe, veterano delle Piramidi e di
Marengo, non sappia l’obbligo suo con le donnette...
— Grazie — rispose lei. — Non bevo vino.
— Corpo di una mitraglia, non bevi vino?! E che bevi dunque alla
gloria dell’Imperatore e della Francia? Ma io voglio che tu beva,
intendi? E quando il brigadiere La Harpe vuole una cosa...
Si era alzato, e mal reggendosi in piedi si avvicinò alla donna che
smettendo l’aria dimessa si volse agli altri.
— Dite al vostro camerata che mi lasci tranquilla, altrimenti gli farò
ben io digerire la sbornia.
— Ha ragione — esclamò il sergentino — se il vino non le piace!...
Capperi, con che tono parla! Via, brigadiere, bevilo tu per lei cotesto
bicchiere...
— No, no: deve bere, deve bere alla salute dell’Imperatore,
altrimenti crederò che sia una nemica della Francia.
— Via — disse il vecchio — bevi Margherita; questo bravo militare
crede di farci cosa grata. Lo so che non hai mai bevuto del vino, ma
un sacrificio lo puoi fare...
— E voglio che beva tutta... tutta la carafa! — gridò l’ubbriaco.
— Questo è troppo! — esclamarono alcuni.
— No, deve bere — urlarono altri. — È un’offesa alla Francia e
all’Imperatore.
Si erano tutti alzati e gridavano a coro, mentre lei pareva si frenasse
a stento. Il vecchio si era alzato anch’esso, ma nello scompiglio
nessuno si era accorto che le gambe non gli tremavano più e che la
testa non più tentennava.
— Voi siete ubbriachi tutti — gridò il sergentino — avete capito?
ubbriachi tutti. Io ne farò rapporto al capitano...
— Qui il capitano non c’entra... si tratta della gloria dell’Imperatore e
della Francia — urlarono gli ubbriachi.
Ella, intanto, seguita dal nonno, si era messa tra la porta e la tavola
che la separava dai sottufficiali. Non pareva punto intimorita, e
sottovoce, rapidamente, scambiava delle parole con colui che aveva
detto esser suo nonno, il quale aveva messo le mani nella bisaccia e
girava intorno gli occhietti vivaci e arditi tanto da smentire gli
acciacchi e la stanchezza.
Il sergente però non cedette: gli era parso che gli occhi della bella
ragazza si volgessero a lui con una espressione di preghiera
invocando un difensore, e quegli sguardi lo accesero vieppiù.
— No — disse — io non permetterò che si faccia violenza a questa
povera ragazza e a questo povero vecchio. Non si tratta di bere o di
non bere del vino... non avete saputo trovare altra scusa che questa
per... Siete degl’imbecilli e degli ubbriachi! Sì, sì, ve lo dice il
sergente De Chantal!
E in ciò dire saltò presso la giovane donna, e mettendo mano alla
daga:
— Che nessuno faccia un passo innanzi! Io sono a molti di voi
superiore in grado, agli altri uguale, intendete? Dunque chi fa un
passo innanzi avrà da fare con me.
— Grazie, signor sergente, grazie — disse il vecchio che aveva
ripreso il suo atteggiamento dimesso. — Vi ringrazio io per questa
povera figliuola così spaventata che non sa quel che pur sarebbe il
suo dovere.
E in così dire lanciò uno sguardo alla donna, del quale ella dovè
comprendere il significato, perchè si rivolse al giovane:
— Sì, sì, grazie. Voi siete buono e coraggioso, voi!
Un osservatore avrebbe notato che ci era come un’ironia nell’accento
e nello sguardo che rivolse al sergente il quale se ne ringalluzzì
tutto; ma intanto i compagni, punti da quelle parole, cercavano di
rovesciare la tavola che dai tre li separava.
— Noi non abbiamo paura di te, sergente De Chantal! — gridavano
— e cotesta ragazza, voglia o non voglia, stanotte dovrà...
— Che cos’è questo chiasso? — disse una voce dall’uscio.
Si volsero, avendo riconosciuta la voce del loro capitano, un vecchio
soldato, burbero nell’aspetto, ma molto amato per la bontà
dell’animo.
Tutti tacquero assumendo un contegno dimesso e tenendosi
immobili.
— Ah, ah! — disse infine il capitano che aveva girato intorno lo
sguardo. — Venere e Bacco!... Su, in caserma, e che non vi colga più
a fare tale baccano.
Mogi, mogi, come scolaretti i caporali e sergenti presero la via
dell’uscio: solo il brigadiere indugiava borbottando:
— Si trattava della gloria della Francia e dell’Imperatore.
— Brigadiere La Harpe, se fra mezz’ora non vi troverò a letto ne
avrete per due giorni di pane ed acqua — gridò il capitano.
Il brigadiere salutò mordicchiandosi i baffi; volse uno sguardo
minaccioso al sergente ed andò via tenendosi ritto della persona per
dissimulare un certo imbarazzo nello incedere.
Il vecchio e la giovane donna si erano tenuti silenziosi sull’uscio.
Il capitano li squadrò per un pezzo borbottando: non pareva punto
soddisfatto dell’esame.
— Vi avviso — disse poi rivoltosi al fondachiere — che il signor
Commissario civile emanerà presto un ordine di rifiutare alloggio ai
vagabondi. Che questo vecchio e questa ragazza lascino al più presto
questi luoghi se non vogliono vedere il sole attraverso i cancelli.
Avete inteso?
— Sissignore — rispose il fondachiere. — Non ho nulla da
guadagnare con cotesta gente, perciò io fin d’ora li metto alla porta.
Ehi, vecchio — disse poi volgendosi al compagno della ragazza —
parmi che il signor capitano abbia parlato chiaro, perciò fatemi il
piacere di andar via.
— Dove volete che vada? — gemette il vecchio. — Per carità, signor
capitano, che non ci si mandi via, almeno per questa notte. Io non
ne posso più; mia nipote, questa disgraziata creatura, a cui non
rimango che io solo misero vecchio, sarebbe esposta a tutti i cattivi
incontri, povera innocente! Vedete, non sa che piangere...
Invero la ragazza aveva chinato il capo sul petto, nascondendo la
faccia col grembiale.
— Noi non siamo punto dei vagabondi — continuò il vecchio. —
Abbiamo dovuto fuggire dal nostro paese per salvarci dalle insidie
della mala gente che dopo avere ucciso il mio povero figlio e la mia
povera nuora insidiavano questa disgraziata... Via su, non piangere:
il capitano ci farà la grazia di permettere che il fondachiere ci dia
alloggio per questa notte.
E in così dire aveva preso pel mento la nipote e cercava di farle
sollevare la testa, ma ella si schermiva, continuando a tener celata la
faccia col grembiale.
— Beh — disse il capitano — poichè ancora l’ordine non è emanato,
restino qui fino a domani questi poveri diavoli... fino a domani, ma
non più!...
— Grazie, signor capitano... che il cielo ve lo renda.
Il capitano mormorò alcune parole ed andò via, seguito con lo
sguardo dal vecchio, che man mano si raddrizzava come si andava
rassicurando di non esser visto che dal fondachiere, il quale si era
rimesso a sedere. Anche la donna aveva lentamente sollevato il
capo.
— In che imbroglio mi hai messo, Pietro? — disse infine sottovoce
massaro Cicco. — Se vi scoprono, con voi fucileranno anche me.
— Zitto — rispose il vecchio che aveva continuato a guardar fuori —
viene a questa volta il sergentino.
— Io credetti per poco che si dovesse venire alle mani — disse la
donna. — Già incominciava a montarmi il sangue alla testa...
— Pensate al povero capitan Riccardo — mormorò il vecchio.
— Se non fosse per lui, credi che mi sarei acconciata a questa
commedia?
— Su, rimettetevi a piangere... il sergentino si guarda intorno... certo
vien qui di nascosto. Capperi, ha preso fuoco l’amico!...
— Glielo darò io il fuoco! — mormorò la donna con aria minacciosa,
ripiegando il capo e tornando a nascondere la faccia nel grembiule.
Intanto si era fatto notte, e il fondachiere aveva acceso una
lucernetta di creta che spandeva per lo stambugio un fioco chiarore.
In questo il sergente De Chantal apparve sull’uscio.
— Badate — gli disse massaro Cicco nel vederlo — se il capitano
ritorna, vi farà passare la voglia di andare in giro a quest’ora.
— Ma se proprio lui mi ha mandato! Egli sa che io non sono punto
un beone e che non mi piace fare il chiasso. Mi ha mandato per
rassicurare questi due poveretti e dir loro che possono rimaner qui,
anche, se occorra, tre o quattro giorni. Io l’ho persuaso che non
sono punto quel che aveva creduto in sulle prime.
— E che aveva creduto, quel buon capitano? — domandò il vecchio.
— Che foste delle spie.
— Spie noi? E di chi, San Francesco benedetto?
— Di tutti i residui delle bande che ancora si aggirano pei dintorni.
— Lo senti, lo senti, Margherita — piagnucolò il vecchio — ci han
creduto delle spie, e di chi poi? di coloro che ti han fatto orfana, che
ti hanno costretta a fuggire dal tuo paesello, che poco mancò non mi
tagliassero il collo!... E foste voi, bravo sergente, a convincere il
vostro capitano che noi siamo della buona gente?
— Sì, proprio io — rispose il sergente che contemplava la giovane
donna sperando di ottenerne almeno un sorriso in compenso.
— Su, su, alza il capo, Margherita. È il buon giovane che ci ha difeso,
che ci ha salvati dalle scostumatezze dei suoi compagni.
E in così dire l’aveva di nuovo presa pel mento per costringerla a
sollevare il capo. Ella si schermiva, poi volse un fuggevole sguardo al
sergente e disse, facendo un po’ la scornosa:
— Che la Madonna del Carmine lo rimuneri della sua buona azione!
— Dovete permettermi però che io vi offra da cena... Faremo più
intima la nostra conoscenza... Non dite di no, via!
— Non per rifiutare la vostra offerta — rispose il vecchio — ma io
sono stanco, non mi reggo in piedi e vorrei dormire.
— Ma la vostra nipote...... non sembra stanca, lei.
— In verità, vedrei volentieri che mia nipote si ristorasse un po’
meglio di quel che non ha fatto. Povera creatura, due uova appena...
Ma è tanto timida! Di’, Margherita, vuoi accettare l’offerta di questo
buon giovane che ci ha protetti? Io intanto mi riposerò là in fondo e
se mi sentirai russare, mi sveglierai come le altre volte. Di’ vuoi?
Bisogna pur mostrarsi grati coi nostri benefattori!
— Farò il voler tuo, nonno — rispose la ragazza.
Il sergentino non capiva nei panni per la gioia, tanto più che ella
pareva che a poco a poco vincesse la timidezza e gli lanciava degli
sguardi che gli facevan correre dei brividi per le carni.
— Per rassicurarvi — disse il giovanotto — chiuderò la porta. Stasera
sono di guardia ai feriti, poveri diavoli del tutto impotenti a muovere
un passo. Solo il capo, quel capitan Riccardo che, almeno per quel
che si dice, è assai nelle buone grazie di Madama Carolina, mi dà un
po’ di pensiero... È un valoroso colui, capace delle più temerarie
imprese. Lo abbiamo visto alle prove; ma l’ho ben raccomandato al
caporale. Possiamo dunque godercela un po’ chiacchierando.
— Ma — disse il fondachiere — se i soliti avventori troveran chiusa la
porta andranno via, e a me chi mi rivalerà di quel che perdo?
— Quel che perdi me lo metterai nel conto, e non ti pagherò in
assegnati, sta tranquillo, ma in belle piastre con l’effigie di quel
vigliaccone che fu già vostro re. Apri l’orecchio e ascolta.
In così dire battè sul taschino della giubba che mandò un tintinnio
d’argento.
— Su, prepara in un cantuccio un po’ di cena: quel che hai di meglio.
Massaro Cicco si diede attorno per preparare la cena; intanto il
sergente, che aveva chiuso la porta, si era fatto vicino alla ragazza,
mentre il vecchio aveva deposto la bisaccia sul mucchio della paglia
e vi si era sdraiato vicino.
— Non avete paura di me, bella Margherita? — disse il sergente con
un fatuo sorrisetto.
La ragazza lo squadrò, e come se stesse per prorompere mosse le
labbra; ma si contenne, e riassumendo l’aria timida ed ingenua,
rispose:
— Nè di voi, nè... di nessuno. Quando si sa di non far male....
— E noi non facciamo male a nessuno; ma lasciatemi sperare che
diverremo buoni amici.
— Certo, buoni amici — disse lei con un sorrisetto che avrebbe fatto
sorgere gravi dubbi a chi l’avesse bene osservato.
— Su, venite a cena. Ah, bravo! Il tintinnìo dell’argento ha fatto un
miracolo: della carne, del salame, mentre, amico fondachiere, poco
fa dicevi non avere che del formaggio.
La ragazza si alzò e andò a sedere su uno dei due sgabelli che Cicco
aveva messo ai due lati della mensa. Il sergente le sedette di contro.
Aveva riacquistato l’aria sicura e tranquilla; nessuno avrebbe detto
che pochi istanti prima ella avesse pianto; si era messa a cenare di
buon appetito, con un certo aspetto che avea dell’ironico.
— Fa caldo, non è vero? — disse poi.
Si tolse la tovaglia che le scendeva dal capo, slacciò il lembo
superiore della camicia, e il bel collo e il principio del seno si
offrirono agli sguardi del sergentino che pareva alquanto
scombussolato.
— Non sembrate più la stessa — disse infine.
— Gli è che — rispose lei sottovoce e guardandosi intorno — il
nonno mi sgriderebbe se mi vedesse così. Il nonno non vuole che io
sia molto confidente coi bei giovani, perchè dice che gli uomini son
tutti traditori e che ingannano le povere ragazze che ad essi si
affidano.
— Io, per esempio, non v’ingannerei — mormorò lui.
— Chi lo sa! Sentite il nonno come russa! Debbo svegliarlo,
altrimenti poi non la finirebbe più!
— Lasciatelo dormire, via! Vi debbo dire tante cose prima che esso si
svegli!......
— Ditemele dunque, ma fate presto... Che mi volete dire?
— Che sei bella, sei bella come un fiore e che io ti voglio bene.
Ella tentennò il capo, ma non si mostrò punto sgomenta o
imbarazzata.
— Ah, era questo che volevate dire?
Mescè del vino in un bicchiere e lo portò alle labbra; ma mentre
beveva lentamente, fissava il giovane con uno sguardo pregno di
fascino.
— Tu mi sembri un’altra, un’altra, ora — diceva il sergente che
incominciava a sentirsi confuso.
— Non sono più bella dunque?
— Sì, sì: da far dannare un santo, ma...
— E non mi volete più bene?
— Non guardarmi così, Margherita! Io sento come se tu lentamente
mi avvolgessi intorno alle carni una catena. Credevo di dover durare
molta fatica per vincere la tua ritrosia, la tua timidezza, per
asciugare le tue lagrime... e ora, sono io, ora che a te vicino provo
come un intontimento. Mi vorrai bene tu, dì, mi vorrai bene?
— Fra due o tre giorni — rispose lei con un sospiro — ce ne
andremo. Dove? Chi lo sa!
— Io verrò a raggiungerti ovunque. Mi han promesso un mese di
congedo... Poi, poi, se tu mi vorrai bene...
— Dunque non potremo vederci più? — disse lei — Non siete certo
di guardia ogni sera...
— No, ogni sera no, ma potrei farmi cedere il turno da un
compagno, per venir qui come stasera.
Ella scrollò il capo.
— Il nonno non mi lascerà più sola così... Avrei dovuto svegliarlo:
quando poi si sveglierà da sè... non sapete quanto sia rabbioso quel
vecchio!... quando poi si sveglierà da sè mi toccherà sopportare i
suoi rimbrotti, e non mi lascerà più sola con un... bel giovane.
Lo guardava, intanto con una espressione di dolcezza onde il
sergentino si sentiva sdilinquere.
Poi, come se volesse mutar discorso per non lasciarsi vincere da un
sentimento che troppo la turbava, gli disse con accento tranquillo e
disinvolto:
— Dunque il più terribile dei feriti è quel capitan Riccardo del quale
ho pure inteso discorrere tanto! Ed è chiuso anche lui con gli altri?
— No, l’abbiamo messo in uno stambugio per custodirlo meglio.
Unito agli altri avrebbe macchinato chi sa che diavolerie!
— Dovrà bene annoiarsi, solo, al buio!
— Ne avrà per poco.
— Perchè ne avrà per poco?
— Perchè appena gli caveran di bocca quel che al Commissario civile
importa sapere, lo fucileranno.
— Ah, lo fucileranno! — disse lei rimanendo pensosa.
— Parlami di te, Margherita, parlami di te — disse il sergentino che si
era avvicinato vieppiù e aveva cercato di cingere con un braccio la
vita della giovane donna.
Ella diede un balzo e si alzò, fissando il giovane con tale uno sguardo
feroce che egli rimase interdetto.
— Perchè mi guardi così? — disse infine.
Ella, come pentita, raddolcì la fisonomia, lo sguardo tornò sereno.
— Ve l’ho detto — rispose — che ho paura di mio nonno.
— E non ti lascia mai tuo nonno?
— No, mai.
— E... e se trovassimo un mezzo come poter deludere la vigilanza di
quel vecchio?
— Impossibile — mormorò lei con accento di rammarico.
— Ma se si potesse...
— Per carità... il fondachiere sonnecchia, ma è un furbo colui... Se vi
vedesse così vicino a me! No, no, è impossibile. Io sono una ragazza
onesta... Mio nonno mi ha portato fuori del mio paese appunto per
salvarmi dalle insidie che mi si tendevano... Dove vederci se ovunque
ci è della gente? Quei vostri compagni son brutali, gli abitanti di
questi luoghi così maligni... Dove vederci anche se qualche notte,
mentre mio nonno dorme, io mi arrischiassi a lasciarlo?
— Ah, — gridò lui — lo so io un luogo, lo so io ove staremmo al
sicuro, e dove potrebbe venire anche tuo nonno. Tuo nonno si
addormenterebbe e tu potresti venir da me, sicura che se si
svegliasse potresti accorrere in breve vicino a lui.
Ella lo ascoltava con gli occhi pregni d’una gioia profonda che
sarebbe parsa ben strana al sergente se questi non avesse avuto gli
occhi e la mente velati dal torrido desiderio di posseder quella
giovane donna.
— Se fosse questo, se fosse questo! — disse lei infine — Perchè, sì,
ora lo comprendo; è necessario che il nonno venga anch’esso. Se
non mi trovasse a sè vicino nello svegliarsi, se il fondachiere mi
denunciasse? Dio mio, tremo solo a pensarlo. Ma sentiamo il vostro
progetto.
— Debbo ben maturarlo — rispose il giovane. — Esso è molto ardito,
ma per poter stare al sicuro e per aver del tempo innanzi a noi, non
ci è altro mezzo. Lo so che arrischio di essere degradato se si viene a
sapere, ma che importa? Senti, Margherita, io ho incominciato con
ammirar la tua bellezza, poi per avere per te un sentimento non mai
provato; adesso... e non sono quattr’ore dacchè ti ho vista, adesso
mi pare di averti amata e di averti desiderata per lunghi, lunghi anni.
Sento che il sangue brucia, sento che le visceri ardono, sento che
per un tuo bacio commetterei anche una viltà.
Ella ascoltava distratta, come se le parole del giovane sconvolto dalla
subita passione, non la riguardassero punto.
— Me lo direte domani il vostro progetto? — chiese allorchè egli
tacque.
— Sì, domani. Ti voglio con me tutta una notte, tutta una notte,
perciò ho pensato di far venire con noi tuo nonno.
— Avete riparato ad un mio fallo! — disse lei.
Egli lo guardò sorpreso, non giungendo a comprenderla.
— È inutile che comprendiate... ve la darò poi la spiegazione...
quando riusciremo nel nostro disegno.
— Dunque pure tu aneli di trovarti con me nella piena sicurezza,
nella libertà completa?
— Ve lo giuro — rispose lei grave e solenne — Sì, darei la vita per
essere un’ora nella libertà completa e nella piena sicurezza.
— Ma non mi hai detto ancora che mi vuoi bene! — mormorò lui
guardandola con occhi ardenti.
— Che importa — rispose con un sorriso — se non ve l’ho detto?...
Ve lo proverò e sarà meglio.
Il sergentino si era alzato, ma non si decideva ad andar via. Aveva
nello sguardo, nella espressione del viso un pensiero, un desiderio
che era lì per prorompere. Anche lei si era alzata, e quasi avesse ben
letto nell’anima del giovane, sorrideva vagamente pur fingendo
d’essere impacciata.
— Il fondachiere dorme, tuo nonno dorme — disse lui sottovoce e
fissandola con occhi accesi — siamo soli... Si fa presto a spegnere il
lume.
— Spegnere il lume? Perchè? — chiese lei con ingenuità
perfettamente simulata.
— Per darmi un bacio, un solo... e poi andrò via, te lo giuro, andrò
via...
Essa chinò gli occhi e scosse la testa.
— Non vuoi? Via, parla, non vuoi?
Rimase muta, col seno ansante, le guance fatte di porpora.
— Non ti chieggo molto... un bacio, solo un bacio...
E si avvicinava sempre più alla giovane donna; già l’aveva presa per
la vita, già con le labbra arse si era chinato per cercare la bocca di
lei. Ella aveva ceduto piegandosi, gli si era stretta alla persona,
quando di un tratto, mentre lui tremava per l’orgasmo, lo respinse
vigorosamente e balzò in fondo alla stanza.
— Andate via, andate via! — gridò come sgomenta e pentita della
sua debolezza.
Egli rimase interdetto, senza osar di seguirla ed affannando, chè la
piena dell’orgasmo gli toglieva ogni forza. Solo balbettò
sommessamente:
— Lo vedi che non mi vuoi bene, lo vedi?
— Andate via, andate via! — ripeteva lei.
— Ma promettimi che sarai più buona con me quando saremo soli e
sicuri... promettimelo...
— Sì, sì, ve lo prometto... Ma non vi accostate... ho paura di voi, ho
paura! Non abusate di me...
— Promettimi, promettimi! — insisteva lui.
— Sì, sì, ve lo prometto... Un demone mi spinge a voi... Ora
lasciatemi... Che volete di più, che volete di più?...
Egli ebbe un sospiro di gioia ineffabile. Era quella una promessa che
avrebbe mantenuta: anche lei appariva visibilmente commossa: gli si
sarebbe data, sì, era evidente, se non avesse avuto paura. Non
doveva insistere più oltre per non spaventarla. Già aveva formato il
suo disegno: fra tre giorni quella bellezza sarebbe stata sua ed egli
già ne pregustava tutto le ebbrezze.
— Vado, vado per ubbidirti, ma... ricordati, ricordati!
Ella accennò di sì con la testa. Nel passarle vicino il giovane la
guardò, lei sollevò gli occhi e i loro sguardi s’incontrarono.
— Vivrò di questa speranza — mormorò il sergente — Fra tre giorni
sarò di guardia... verrete voi da me e nessuno vi vedrà. Tuo nonno
andrà a letto e...
— Sì, sì, sì — esclamò lei col viso sfolgorante di gioia.
Il sergentino aveva tutti i motivi per essere lusingato da quella gioia
e se ne intese sconvolto. Indugiò un istante come se lottasse seco
stesso, poi, vincendosi, fuggì.
Ella che lo aveva seguito con lo sguardo, quando non intese più il
rumore dei passi diede in uno scroscio di risa.
— Capperi, la so far bene la civetta, eppure è la prima volta in vita
mia!
Nell’avvicinarsi al giaciglio del vecchio, vide che questi si era
sollevato a mezzo.
— Ho inteso tutto — le disse — il merlotto è caduto nella pania.
— Hai visto come so fare la vergognosa? Però ci furono degli istanti
in cui ero lì lì per insegnargli la creanza. Con che occhi frugava fra le
pieghe del corpetto!... Non vedo l’ora di buttar via questa gonna che
m’imbarazza: non è questo il minore dei sacrifici che ho fatto per lui,
questo, e l’essermi lasciata occhieggiare da quell’imbecille... Purchè
si riesca a liberarlo! Chi sa che pensa, chi sa quanto soffre! E dire
che io raccomandavo a lui, di assistermi se fossi ferita o morta!
Giungeremo a liberarlo? Chi sa, chi sa!
— Ho fede di sì — rispose il vecchio — Altrimenti sai che faremo?
Daremo fuoco al castello, anche se dovessimo morirci come topi. Ci
stai?
— Se ci sto! Me lo domandi?
— Sei un bravo amico tu che il buon Dio ha per isbaglio creato
femmina.
— Ma insomma posso spegnere il lume, adesso? — gridò il
fondachiere.
Ella si coricò sulla paglia accanto al vecchio. Poco dopo nel buio si
sentiva la sonora respirazione degli addormentati.
III.

La prigione in cui avevano rinchiuso capitan Riccardo, o meglio, a


voler tenere in conto il brevetto firmato dal re Ferdinando IV, il
colonnello Riccardo, era una stanzuccia di una delle torri che aveva
dovuto servire di prigione nei tempi in cui i duchi di Fagnano
avevano potere di alta e bassa giustizia nelle loro terre. Era
preceduta da altre due stanze nelle quali un picchetto di soldati
montava la guardia, ma così buie e anguste che si preferiva star
fuori, tanto il prigioniero era ben custodito da una massiccia porta di
ferro. Nei primi giorni la sorveglianza era stata rigida e severa, ma
poi a poco a poco si era rallentata, sia perchè il medico militare
aveva detto che il giovane era incapace di muoversi per le tante
ferite riportate, sia perchè l’angusto pertugio che s’apriva in alto e la
porticina di ferro rassicuravano che ogni tentativo di evasione
sarebbe riuscito infruttuoso. E poichè di quella prigione improvvisata
mancavano i secondini, il sergente o il caporale che vi montava di
guardia ne custodiva le chiavi, e la porta non si apriva che due volte
al giorno, per la visita del medico e per il cibo al prigioniero.
Nessuna delle ferite era mortale, e già la robusta fibra del giovane
incominciava a riaversi dal gran sangue perduto. Eran passati
parecchi giorni e lui era tuttora incerto sulla sorte che gli serbava.
Aveva più volte cercato di appurar qualcosa da coloro che
accompagnavano il medico e che gli portavano il cibo, ma le sue
domande erano rimaste senza risposta, sia perchè forse il suo
linguaggio non era compreso, sia perchè la consegna era di non
rispondere; onde passava le lunghe giornate standosene in sul
giaciglio, parato a tutto; chè questa volta ben comprendeva d’esser
finita per lui. Sapeva pur troppo quale pena gli spettava, e conveniva
seco d’averla meritata. Anche essi non davano quartiere, anche essi
fucilavano i Francesi che cadevano prigioni nelle loro mani,
quantunque fossero dei soldati costretti dalla disciplina e dall’onor
militare a combattere, mentre essi volontariamente avevano preso le
armi. Solo si maravigliava e grandemente che ancora fosse in vita,
mentre sapeva che si era andati sempre per le spiccie, e nessuno
mai aveva visto la notte del giorno in cui era caduto in mano a quei
nemici.
— Aspettano che guarisca dalle ferite e che riacquisti le forze, perchè
vada co’ miei piedi a morire — diceva a sè stesso.
Ma le ferite erano quasi rimarginate, il riposo ed il nutrimento
abbondante l’avevano a poco a poco ringagliardito. Che si aspettava
dunque?
In verità, gli rincresceva di morire, di morire proprio sul limitare di
quel mondo che l’amore o il capriccio di una regina gli aveva fatto
intravedere. Se non fosse caduto in quella immane lotta che
ricordava con fierezza, e che aveva destato l’ammirazione anche dei
nemici, i quali ben s’intendevano di valore, un ben altro avvenire gli
si sarebbe schiuso dinanzi: egli avrebbe lasciato quei luoghi, non
sarebbe stato più il capo di una banda, che, se non per l’intento, per
le persone onde era composta e quantunque delle meno feroci, per
la rovina che apportava, più che di partigiani era una banda di
masnadieri. Il suo cuore, la mente, il suo braccio sarebbero
consacrati ad un’alta e nobile impresa che aveva intraveduto nelle
parole regali: egli avrebbe fatto ammenda di tutto il passato del
quale la sua coscienza non era punto soddisfatta.
Cosa strana: l’amore per lui della Regina non entrava per nulla nel
suo rammarico: quantunque il ricordo delle ebbrezze godute dovesse
accendergli il sangue, egli restava freddo a tal ricordo. Se sotto
l’influenza dello sguardo di lei, se a contatto di quella sfolgorante
bellezza cui gli anni invece di attenuarlo ne avevano acuito il fascino;
se le torride carezze che ne facevano un’amante formidabile lo
sconvolgevano, onde quelle due notti di amore erano state per lui un
delirio; lontano da lui, quella donna non era più l’amante, ma era pur
sempre la Regina. Inoltre, se interrogando bene l’anima sua egli
doveva convenire che non sentimento d’amore era il suo, perchè,
senza volerlo, il pensiero vagheggiava un’altra immagine e ci era nel
profondo del suo cuore una tenerezza che gli faceva mormorare un
altro nome, pure sentiva di esser legato indissolubilmente alla sorte
di quella augusta donna, fatta segno a tanto odio, cui si attribuivano
tante colpe e tanti delitti. Non avrebbe saputo dire qual fosse il suo
sentimento per lei, ma se avesse avuto cento vite, cento vite
avrebbe dato pel trionfo di lei. Non per sè gli dispiaceva di morire:
infine, aveva vissuto abbastanza, e povero e miserabile trovatello,
aveva un grado datogli da un re, aveva goduto gioie sovrumane
dategli da una regina: non per quella tenerezza che gli empiva
l’animo, talvolta, di malinconia, perchè se una donna regale aveva
avuto per lui baci e carezze, la giovinetta dell’anima sua era più in
alto assai che nel suo pensiero, ed egli sapeva bene che neanche
con lo sguardo giunger poteva a tanta altitudine. La morte dunque
per lui sarebbe stata la fine di un sogno che non avrebbe potuto
divenir mai una realtà. Ma gli doleva di morire perchè sarebbe
venuto meno alla promessa che aveva fatto di esser lui il cuore
fedele, l’anima devota necessaria ai disegni dell’augusta donna.
Superstizioso come tutte le nature primitive era giunto a convincersi
esser lui indispensabile al trionfo della Regina. Non gliel’aveva detto
che ogni sua speranza era riposta in lui? Non gli aveva fatto giurare
che se fosse uscito vivo dalla mischia l’avrebbe raggiunta in Sicilia,
disposto ad ubbidirle ciecamente? Il cuore fedele, l’anima devota
necessaria al gran disegno era lui, che fra poco sarebbe caduto
colpito a morte come un vile e nefando malfattore! Morto lui, chi, chi
mai l’augusta donna avrebbe trovato disposto a sacrificarlesi?
Era in questi pensieri quando udì un cigolar di catenacci: poco dopo
la porticina di ferro si aprì e un sergente entrò seguito da alcuni
soldati.
— Ho l’ordine di condurvi innanzi al Commissario civile — disse il
sergente.
Egli si era alzato dal suo giaciglio, punto sorpreso dalle parole del
soldato.
— Che vuole da me? — rispose sorridendo — Che io denunci i nomi
dei miei compagni? Che io faccia la spia insomma? Potrebbero ben
risparmiarmi e risparmiarvi tanti fastidi, che io non dirò nulla
neanche se mi facessero a brani.
— Io non so altro — rispose il sergente — che debbo condurvi
innanzi al Commissario coi polsi stretti nei ferri.
In così dire mostrava una catenella.
— Sentite, camerata — disse capitan Riccardo — so bene che voi
eseguite un ordine, ma... guardatemi bene in viso... Sono io capace
di dare una parola e di venir meno alla parola data? Ci è qualcosa
che ci accomuna, ed è il valore: ed un valoroso non è mai un
mentitore. Io so come voi vi battete, voi non ignorate come io mi
batto, voi quindi dovete stimarmi come io vi stimo. Mi inganno forse?
Se militassi nelle vostre file non mi credereste degno di stringermi la
mano?
— Non dico di no — rispose il sergente che aveva nel viso una
profonda cicatrice — Non dico di no: vi siete battuto come un
soldato francese; ma io non capisco a che mirano le vostre parole.
— Mirano ad ottenere che quella catena, che mani leali use a
maneggiar la sciabola ed il fucile mal saprebbero maneggiare, non
disonorino i polsi di chi ha combattuto da leale e valoroso soldato. Io
vi do la mia parola d’onore che lungo il tragitto da questa carcere
alla dimora del Commissario civile nulla farò per evadere, soccorso o
non soccorso, come dicevano i cavalieri antichi. Ve ne do la mia
parola d’onore, ripeto.
Il sergente fissò lo sguardo in viso al prigioniero; stette un pezzo
pensoso ed incerto, poi scagliando lungi da sè la catenella esclamò:
— Ebbene, sì. Ne avrò forse per dieci giorni di consegna ma non sia
detto che un soldato francese abbia dubitato della parola d’onore di
un prode, col quale ha scambiato colpi mortali. Perchè fui io che vi
atterrai col calcio del fucile.
— Che mi ha tenuto per tre giorni col capo intronato.
— E che per buona fortuna dei miei camerati vi ho messo fuori
combattimento. Orsù — disse il sergente volto ai suoi soldati —
andate via. Accompagnerò io solo il prigioniero.
— Grazie, sergente — rispose capitan Riccardo — Ed ora vi prego di
un altro servigio: che siate voi a comandare il fuoco quando dovrò
essere fucilato.
— Come il più anziano tocca a me tale incarico. In ogni modo ve lo
prometto.
Il prigioniero si era alzato e attendeva a ricomporsi. Quantunque le
ferite gli dolessero, pure dissimulava il dolore con grande meraviglia
del sergente che pochi giorni prima lo aveva visto col corpo
tagliuzzato e sanguinante disteso su quel giaciglio.
— Che bravi soldati, che bravi soldati sarebbero mai! — mormorò —
degni della vecchia Guardia.
Uscirono entrambi dalla prigione e passarono tra i soldati stupiti, ma
che pure non osavano biasimare il vecchio sergente, che era il più
stimato del reggimento. Il giovane, seguìto dal suo custode, sali
l’ampia scala del castello, finchè giunsero all’anticamera del primo
piano ove era l’alloggio del Commissario civile.
Seduto su una delle panche lungo le pareti, capitan Riccardo vide un
uomo nel quale riconobbe Carmine.
Diedero entrambi un grido di gioia e si slanciarono l’uno nelle braccia
dell’altro.
— Libero, sei tu libero? — diceva Carmine, ingannato dal veder
senza legami il giovane — Lo dicevo io, lo dicevo. Ma come è
avvenuto? Dunque il Commissario civile...
— Ho dato la mia parola d’onore a questo buon sergente — rispose
Riccardo — che non avrei tentato di evadere. Ma è pur troppo vero
che io son prigioniero e che forse... non vedrò il sole discendere
dietro le spalle dei nostri monti. Questa è la guerra, caro Carmine, e
bisogna pur rassegnarsi.
— Tu che dici? Tu che dici? — esclamò il buon uomo — tu lo vedrai
ancora per molti e molti anni non solo morire, ma nascere il nostro
sole. Tu dunque ignori?... Ma già, come puoi saperlo? che cosa
intendevi dire con quelle parole? Che ti fucileranno forse? Fucilar te?
E chi ne dovrebbe dar l’ordine, il Commissario civile? Lui!... Via,
lascia che mi sbellichi dalle risa...
E il vecchio si diede a ridere così sonoramente che il giovane,
temendo avesse dato di volta pel dolore, lo guardava impietosito.
— Tu mi credi pazzo? — disse Carmine quando si riebbe. — Non
sono pazzo, no, e lo vedrai, lo vedrai. Ma, a proposito dimmi che n’è
di Pietro il Toro e dove potrei trovarlo.
— Io, però — disse il sergente — non posso più oltre permettere un
tale colloquio. Se ho assentito a condurre qui il prigioniero senza
ceppi...
Il vecchio Carmine lo guardò con un sorriso di compatimento sulle
labbra.
— Voi avete creduto di far cosa biasimevole anche se il vostro cuore
l’approvava — disse voltosi al sergente. — Ma di questa buona
azione voi avrete un premio, ve lo dico io, avrete un premio.
Dunque, dove potrei trovare quella testa matta di Pietro il Toro?
— Che vuoi che ne sappia io? — rispose Riccardo. — Io so che fra
poche ore... povero zio Carmine, sarò in un luogo donde non si fa
più ritorno.
In questo la porta si aprì e un valletto comparve.
— Ci è qui un paesano che ha chiesto un’udienza?
— Sono io — disse Carmine avanzandosi e facendo un segno con la
mano a Riccardo, come se volesse fargli intendere che quell’udienza
chiesta ed ottenuta spiegar doveva il mistero delle sue parole.
— Il Commissario civile vi aspetta — disse il valletto. — Che il
prigioniero attenda qui per esser chiamato.
Riccardo ben sentiva che qualche cosa di grave vi era in quel
mistero; che il vecchio Carmine era lì per lui; che quella sicurezza,
quella gioia nascondevano un mistero che gli sarebbe presto
spiegato. Ma rinunciava a indovinarlo, e quindi sedette per aspettare
la sua volta, come aveva detto l’usciere.
— Ah, mi aspetta, mi aspetta! — esclamò Carmine che pareva fuori
di sè dalla gioia. — Eccomi, eccomi...
Poi voltosi a Riccardo:
— Ce ne andremo insieme a braccetto dopo che anche tu avrai
parlato col Commissario civile che bacierà in terra per ringraziare il
Cielo. Ce ne andremo insieme a braccetto... se però tu... quando
saprai, e sarà fra poco, non sdegnerai la mia compagnia!
Ciò detto si precipitò verso l’uscio, mentre Riccardo, che non aveva
nulla compreso delle parole di Carmine, lo guardava stupito.
— Quel povero vecchio è matto! — disse il sergente sedendo presso
il prigioniero.
Il duca di Fagnano sedeva innanzi un ampio scrittoio e teneva gli
occhi fissi alla porta con una grande curiosità, aspettando che
comparisse colui che gli aveva scritto di aver gravi cose da
comunicargli e che si riferivano al tempo in cui il duca, evaso dalle
carceri, era tornato nel villaggio. Ciò era bastato per fargli sorgere
nell’animo una speranza vaga, strana, alla quale sicuramente
avrebbe tenuto dietro una delusione.
Che cosa aveva fatto lui prima di prendere la via dell’esilio? Era
tornato nel villaggio a rischio di essere ripreso, si era abboccato con
quella povera creatura che era stata svegliata a mezzo della notte
dal noto fischio di lui, aveva ottenuto che ella, nel delirio della gioia
per rivederlo vivo e libero, assentisse a seguirlo di notte nella chiesa
per la celebrazione del matrimonio; aveva pregato il parroco, si era
provvisto di due testimoni. Poi, appena le nozze celebrate, era
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookgate.com

You might also like