Digital Signal Processing Lab Day 5

1 71 0
Digital Signal Processing Lab   Day 5

Đang tải... (xem toàn văn)

Thông tin tài liệu

The Scientist and Engineer's Guide toDigital Signal ProcessingSecond Edition Be sure to visit the book’s website at:www.DSPguide.com The Scientist and Engineer's Guide toDigital Signal ProcessingSecond EditionbySteven W. SmithCalifornia Technical PublishingSan Diego, California Important Legal Information: Warning and DisclaimerThis book presents the fundamentals of Digital Signal Processing using examples from common science andengineering problems. While the author believes that the concepts and data contained in this book are accurate andcorrect, they should not be used in any application without proper verification by the person making the application.Extensive and detailed testing is essential where incorrect functioning could result in personal injury or damage toproperty. The material in this book is intended solely as a teaching aid, and is not represented to be an appropriateor safe solution to any particular problem. For this reason, the author, publisher, and distributors make nowarranties, express or implied, that the concepts, examples, data, algorithms, techniques, or programs containedin this book are free from error, conform to any industry standard, or are suitable for any application. The author,publisher, and distributors disclaim all liability and responsibility to any person or entity with respect to any lossor damage caused, or alleged to be caused, directly or indirectly, by the information contained in this book. If youdo not wish to be bound by the above, you may return this book to the publisher for a full refund.The Scientist and Engineer's Guide toDigital Signal ProcessingSecond EditionbySteven W. Smithcopyright © 1997-1999 by California Technical PublishingAll rights reserved. No portion of this book may be reproduced ortransmitted in any form or by any means, electronic or mechanical,without written permission of the publisher.ISBN 0-9660176-7-6 hardcoverISBN 0-9660176-4-1 paperbackISBN 0-9660176-6-8 electronicLCCN 97-80293California Technical PublishingP.O. Box 502407San Diego, CA 92150-2407To contact the author or publisher through the internet: website: DSPguide.com e-mail: Smith@DSPguide.comPrinted in the United States of America First Edition, 1997 Second Edition, 1999 vContents at a GlanceFOUNDATIONSChapter 1. The Breadth and Depth of DSP .1Chapter 2. Statistics, Probability and Noise 11Chapter 3. ADC and DAC 35Chapter 4. DSP Software .67FUNDAMENTALSChapter 5. Linear Systems 87Chapter 6. Convolution 107Chapter 7. Properties of Convolution .123Chapter 8. The Discrete Fourier Transform 141Chapter 9. Applications of the DFT 169Chapter 10. Fourier Transform Properties 185Chapter 11. Fourier Transform Pairs 209Chapter 12. The Fast Fourier Transform 225 Chapter 13. Continuous Signal Processing 243DIGITAL FILTERSChapter 14. Introduction to Digital Filters 261Chapter 15. Moving Average Filters .277Chapter 16. Windowed-Sinc Filters .285Chapter 17. Custom Filters 297Chapter 18. FFT Convolution 311Chapter 19. Digital Signal Processing Lab - Day Digital Signal Processing Lab - Day Bởi: Tan H.Nguyen Nguyen Instruction Lab instruction can be found here Attachments Template FIR filter can be found here You are supposed to the Dual FIR filter and FIR Add Filter on your own Reference For reference, have a look at these materials 1/1 TEAM LinG INTRODUCTION TODIGITAL SIGNALPROCESSING ANDFILTER DESIGN INTRODUCTION TODIGITAL SIGNALPROCESSING ANDFILTER DESIGNB. A. ShenoiA JOHN WILEY & SONS, INC., PUBLICATION Copyright © 2006 by John Wiley & Sons, Inc. All rights reserved.Published by John Wiley & Sons, Inc., Hoboken, New Jersey.Published simultaneously in Canada.No part of this publication may be reproduced, stored in a retrieval system, or transmitted in anyform or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise,except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, withouteither the prior written permission of the Publisher, or authorization through payment of theappropriate per-copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers,MA 01923, (978) 750-8400, fax (978) 750-4470, or on the web at www.copyright.com. Requeststo the Publisher for permission should be addressed to the Permissions Department, John Wiley &Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online athttp://www.wiley.com/go/permission.Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their bestefforts in preparing this book, they make no representations or warranties with respect to theaccuracy or completeness of the contents of this book and specifically disclaim any impliedwarranties of merchantability or fitness for a particular purpose. No warranty may be created orextended by sales representatives or written sales materials. The advice and strategies containedherein may not be suitable for your situation. You should consult with a professional whereappropriate. Neither the publisher nor author shall be liable for any loss of profit or any othercommercial damages, including but not limited to special, incidental, consequential, or otherdamages.For general information on our other products and services or for technical support, please contactour Customer Care Department within the United States at (800) 762-2974, outside the UnitedStates at (317) 572-3993 or fax (317) 572-4002.Wiley also publishes its books in a variety of electronic formats. Some content that appears in printmay not be available in electronic formats. For more information about Wiley products, visit ourweb site at www.wiley.com.Library of Congress Cataloging-in-Publication Data:ISBN-13 978-0-471-46482-2 (cloth)Printed in the United States of America.10987654321ISBN-100-471- 46482-1 (cloth) CONTENTSPreface xi1 Introduction 11.1 Introduction 11.2 Applications of DSP 11.3 Discrete-Time Signals 31.3.1 Modeling and Properties of Discrete-Time Signals 81.3.2 Unit Pulse Function 91.3.3 Constant Sequence 101.3.4 Unit Step Function 101.3.5 Real Exponential Function 121.3.6 Complex Exponential Function 121.3.7 Properties of cos(ω0n) 141.4 History of Filter Design 191.5 Analog and Digital Signal Processing 231.5.1 Operation of a Mobile Phone Network 251.6 Summary 28Problems 29References 302 Time-Domain Analysis and z Transform 322.1 A Linear, Time-Invariant System 322.1.1 Models of the Discrete-Time System 332.1.2 Recursive Algorithm 362.1.3 Convolution Sum 382.2 z Transform Theory 412.2.1 Definition 412.2.2 Zero Input and Zero State Response 49v viCONTENTS2.2.3 Linearity of the System 502.2.4 Time-Invariant System 502.3 Using z Transform to Solve Difference Equations 512.3.1 More Applications of z Transform 562.3.2 Natural Response and Forced Response 582.4 Solving Difference Equations Using the Classical Method 592.4.1 Transient Response and Steady-State Response 632.5 z Transform Method Revisited 642.6 Convolution Revisited 652.7 A Model from Other Models 702.7.1 Review of Model Generation 722.8 Stability 772.8.1 Jury–Marden Test 782.9 Solution Using MATLAB Functions 812.10 Summary 93Problems CHAPTER 1 Introduction 1.1 INTRODUCTION We are living in an age of information technology. Most of this technology is based on the theory of digital signal processing (DSP) and implementation of the theory by devices embedded in what are known as digital signal processors (DSPs). Of course, the theory of digital signal processing and its applications is supported by other disciplines such as computer science and engineering, and advances in technologies such as the design and manufacturing of very large scale integration (VLSI) chips. The number of devices, systems, and applications of digital signal processing currently affecting our lives is very large and there is no end to the list of new devices, systems, and applications expected to be introduced into the market in the coming years. Hence it is difficult to forecast the future of digital signal processing and the impact of information technology. Some of the current applications are described below. 1.2 APPLICATIONS OF DSP Digital signal processing is used in several areas, including the following: 1. Telecommunications. Wireless or mobile phones are rapidly replacing wired (landline) telephones, both of which are connected to a large-scale telecom- munications network. They are used for voice communication as well as data communications. So also are the computers connected to a different network that is used for data and information processing. Computers are used to gen- erate, transmit, and receive an enormous amount of information through the Internet and will be used more extensively over the same network, in the com- ing years for voice communications also. This technology is known as voice over Internet protocol (VoIP) or Internet telephony. At present we can transmit and receive a limited amount of text, graphics, pictures, and video images from Introduction to Digital Signal Processing and Filter Design, by B. A. Shenoi Copyright © 2006 John Wiley & Sons, Inc. 1 2 INTRODUCTION mobile phones, besides voice, music, and other audio signals—all of which are classified as multimedia—because of limited hardware in the mobile phones and not the software that has already been developed. However, the computers can be used to carry out the same functions more efficiently with greater memory and large bandwidth. We see a seamless integration of wireless telephones and com- puters already developing in the market at present. The new technologies being used in the abovementioned applications are known by such terms as CDMA, TDMA, 1 spread spectrum, echo cancellation, channel coding, adaptive equaliza- tion, ADPCM coding, and data encryption and decryption, some of which are used in the software to be introduced in the third-generation (G3) mobile phones. 2. Speech Processing. The quality of speech transmission in real time over telecommunications networks from wired (landline) telephones or wireless (cel- lular) telephones is very high. Speech recognition, speech synthesis, speaker verification, speech enhancement, text-to-speech translation, and speech-to-text dictation are some of the other applications of speech processing. 3. Consumer Electronics. We have already mentioned cellular or mobile phones. Then we have HDTV, digital cameras, digital phones, answering machines, fax and modems, music synthesizers, recording and mixing of music signals to produce CD and DVDs. Surround-sound entertainment systems includ- ing CD and DVD players, laser printers, copying machines, and scanners are found in many homes. But the TV set, PC, PREFACE This preface is addressed to instructors as well as students at the junior–senior level for the following reasons. I have been teaching courses on digital signal processing, including its applications and digital filter design, at the undergraduate and the graduate levels for more than 25 years. One common complaint I have heard from undergraduate students in recent years is that there are not enough numerical problems worked out in the chapters of the book prescribed for the course. But some of the very well known textbooks on digital signal processing have more problems than do a few of the books published in earlier years. However, these books are written for students in the senior and graduate levels, and hence the junior-level students find that there is too much of mathematical theory in these books. They also have concerns about the advanced level of problems found at the end of chapters. I have not found a textbook on digital signal processing that meets these complaints and concerns from junior-level students. So here is a book that I have written to meet the junior students’ needs and written with a student-oriented approach, based on many years of teaching courses at the junior level. Network Analysis is an undergraduate textbook authored by my Ph.D. thesis advisor Professor M. E. Van Valkenburg (published by Prentice-Hall in 1964), which became a world-famous classic, not because it contained an abundance of all topics in network analysis discussed with the rigor and beauty of mathematical theory, but because it helped the students understand the basic ideas in their sim- plest form when they took the first course on network analysis. I have been highly influenced by that book, while writing this textbook for the first course on digital signal processing that the students take. But I also have had to remember that the generation of undergraduate students is different; the curriculum and the topic of digital signal processing is also different. This textbook does not contain many of the topics that are found in the senior–graduate-level textbooks mentioned above. One of its main features is that it uses a very large number of numerical problems as well as problems using functions from MATLAB ® (MATLAB is a registered trademark of The MathWorks, Inc.) and Signal Processing Toolbox, worked out in every chapter, in order to highlight the fundamental concepts. These prob- lems are solved as examples after the theory is discussed or are worked out first and the theory is then presented. Either way, the thrust of the approach is that the students should understand the basic ideas, using the worked, out problems as an instrument to achieve that goal. In some cases, the presentation is more informal than in other cases. The students will find statements beginning with “Note that .,” “Remember .,” or “It is pointed out,” and so on; they are meant xi xii PREFACE to emphasize the important concepts and the results stated in those sentences. Many of the important results are mentioned more than once or summarized in order to emphasize their significance. The other attractive feature of this book is that all the problems given at the end of the chapters are problems that can be solved by using only the material discussed in the chapters, so that students would feel confident that they have an understanding of the material covered in the course when they succeed in solving the problems. Because of such considerations mentioned above, the author claims that the book is written with a student-oriented approach. Yet, the students should know that the ability to understand the solution to the problems is important but understanding the theory behind Elektor 2/98 als 11025 Hz/2 = 5512,5 Hz vor- handen. Die darüberliegenden Töne werden nach dem Abtasttheorem nicht korrekt rekonstruiert und des- halb in völlig falsche Frequenzen umgesetzt. Dies bezeichnet man als Aliasing. A LIAS -F REQUENZEN Der Vorgang des Aliasing ist übrigens keineswegs willkürlich, sondern ziem- lich einfach nachzuvollziehen. Wird ein sinusförmiges Signal mit der Fre- quenz f 0 < f s /2 mit der Frequenz f s abgetastet, so entstehen bestimmte Abtastwerte. Jedes Signal mit den Frequenzen m·f s - f 0 oder m·f s + f 0 (m = 1, 2, 3, 4 .) erzeugt bis auf das Vorzeichen die gleichen Abtastwerte, die zu f 0 gehörenden Alias-Frequenzen (Bild 2). Nach dem Abtasten kann man Signale dieser Frequenzen nicht unterschei- den. Sie alle treten infolge der abgeta- steten Werte mit Frequenz f 0 auf. Um das zu vermeiden, schaltet man vor einem A/D-Wandler ein Tiefpaßfilter, das die Alias-Frequenzen unterdrückt. Und damit wären wir beim Thema Kennt man von einem abgetasteten Signal nur die Werte zu den Abtastzei- ten, gibt das Abtasttheorem Auskunft, ob alle Signalinformationen in den abgetasteten Werten enthalten sind oder nicht: Enthält ein Signal nur Signalanteile mit Frequenzen kleiner als f max , so reichen die Abtastwerte zur Rekonstruktion des Sig- nals aus, sofern sie mit einer Abtastrate größer als 2·f max gewonnen wurden. Ein Beispiel soll eine Verletzung dieses Theorems demonstrieren, wenn ein Signal zu hohe Frequenzen für eine gegebene Abtastrate enthält. MUSICG1 <return> erzeugt eine Tonleiter ab 40 Hz. Es werden 60 Töne erzeugt, die jeweils einen Halbton ansteigen, so daß ein Bereich von fünf Oktaven überstrichen wird. Der höchste Ton hat eine Frequenz von etwa 14 kHz. Die Töne werden in MUSIC1.WAV mit einer Abtastrate von 44,1 kHz gespeichert, das Abtasttheorem ist also erfüllt, was sich problemlos durch Anhören verifi- zieren läßt. D OWNSAMPLING Nun tasten wir das gerade generierte Signal erneut ab, allerdings mit nur 11025 kHz, also mit einem Viertel der ursprünglichen Abtastfrequenz. Dieser Vorgang wird Downsampling genannt und vom Programm DWNSMPL1.EXE durchgeführt. Es verwandelt dazu MUSIC1.WAV in die Datei MUSIC2.WAV . Den Downsampling-Faktor gibt man im Aufruf DWNSMPL1 \inp=MUSIC1.WAV \out=MUSIC2.WAV \factor=4 <return> an. Nun sind lediglich niedrigere Töne 66 Digital Signal Processing Kursteil 2: Abtasten und digitale Filtertechnik Nachdem wir in der letzten Folge das Abtasten von Signalen erklärt hatten, kommen wir diesmal darauf zurück, um die damit verbunde- nen Effekte kennenzulernen. Danach steigen wir dann in die digitale Filtertechnik ein. x 1 x 2 x 3 x 4 y 1 y 2 y 3 x 5 x 6 x 7 x 8 x 9 x 10 x 11 x 12 123 567 9 10 11 12 48 0 3 1 2 980015 - 2 - 11 0 Downsampling u u t t Faktor 4 yx 1 Bild 1. Beim Down- sampling eines Signal wird nur jedes xte Sample genommen. T IEFPASSFILTERUNG Dies muß nicht mit einem “gewöhnli- chen” Filter geschehen, sondern läßt sich auch in einem digitalen Verfahren erledigen. Wir betrachten zuerst das analoge Tiefpaßfilter (Bild 3 und Bild 4) und versuchen, sein Verhalten digi- tal nachzuvollziehen. Ein bißchen Mathematik läßt sich nicht vermeiden, obwohl es der Einfachheit halber nicht sehr ”sauber” zugeht. Während eines Abtastintervalls mit der Dauer ∆ T = t k+1 -t k ändert sich die Eingangsspannung u nur wenig, sondern behält während der Zeit den Anfangswert u k . Auch die Ausgangs- spannung wird sich nur wenig ändern, so daß durch den Widerstand R der fast konstante Strom i = (u k - v k )/R fließt. Am Beginn des Abtastin- tervalls weist der Kondensator die Spannung v k auf. Er wird ∆ t lang mit diesem Strom geladen und hat dem- nach die Spannung v k+1 = v k + i ∆ t/C = v k + (v k -u k )/RC · ∆ t Wir lösen nach u k+1 auf und erhalten v k+1 = r·v k + (1-r)u k mit r = 1 -( ∆ t/RC) Das ist die Berechnungsvorschrift für unser erstes digitales Filter. Das Pro- gramm ist auf der CD-ROM

Ngày đăng: 28/10/2017, 07:57

Mục lục

  • Digital Signal Processing Lab - Day 5

Tài liệu cùng người dùng

Tài liệu liên quan