An Instructor’s Solutions Manual to Accompany Fundamentals of Digital Signal Processing using MATLAB, 2nd Edition Robert J. Harris http://www.com LIBROS UNIVERISTARIOS Y SOLUCIONARIOS DE MUCHOS DE ESTOS LIBROS LOS SOLUCIONARIOS CONTIENEN TODOS LOS EJERCICIOS DEL LIBRO RESUELTOS Y EXPLICADOS DE FORMA CLARA VISITANOS PARA DESARGALOS GRATIS. © 2012, 2005 Cengage Learning ISBN-13: 978-1-1114-2603-3 ISBN-10: 1-111-42603-1 ALL RIGHTS RESERVED. No part of this work covered by the copyright herein may be reproduced, transmitted, stored, or Cengage Learning used in any form or by any means graphic, electronic, or 200 First Stamford Place, Suite 400 mechanical, including but not limited to photocopying, Stamford, CT 06902 recording, scanning, digitizing, taping, Web distribution, USA information networks, or information storage and retrieval systems, except as permitted under Section 107 or 108 of the Cengage Learning is a leading provider of customized 1976 United States Copyright Act, without the prior written learning solutions with office locations around the globe, permission of the publisher except as may be permitted by the including Singapore, the United Kingdom, Australia, license terms below. Mexico, Brazil, and Japan. Locate your local office at: international. Cengage Learning products are represented in For product information and technology assistance, contact us at Canada by Nelson Education, Ltd. Cengage Learning Academic Resource Center, 1-800-423-0563. For your course and learning solutions, visit www. For permission to use material from this text or product, submit all requests online at www. Further permissions questions can be emailed to Purchase any of our products at your local college permissionrequest@cengage. store or at our preferred online store www. NOTE: UNDER NO CIRCUMSTANCES MAY THIS MATERIAL OR ANY PORTION THEREOF BE SOLD, LICENSED, AUCTIONED, OR OTHERWISE REDISTRIBUTED EXCEPT AS MAY BE PERMITTED BY THE LICENSE TERMS HEREIN. READ IMPORTANT LICENSE INFORMATION Dear Professor or Other Supplement Recipient: posted electronically as described herein. Any material posted electronically must be through a password-protected site, with all Cengage Learning has provided you with this product (the copy and download functionality disabled, and accessible solely by “Supplement”) for your review and, to the extent that you adopt your students who have purchased the associated textbook for the the associated textbook for use in connection with your course Course. You may not sell, license, auction, or otherwise redistribute (the “Course”), you and your students who purchase the the Supplement in any form. We ask that you take reasonable textbook may use the Supplement as described below. steps to protect the Supplement from unauthorized use, Cengage Learning has established these use limitations in reproduction, or distribution. Your use of the Supplement indicates response to concerns raised by authors, professors, and other your acceptance of the conditions set forth in this Agreement. If you users regarding the pedagogical problems stemming from do not accept these conditions, you must return the Supplement unlimited distribution of Supplements. unused within 30 days of receipt. Cengage Learning hereby grants you a nontransferable license All rights (including without limitation, copyrights, patents, and trade to use the Supplement in connection with the Course, subject to secrets) in the Supplement are and will remain the sole and the following conditions. The Supplement is for your personal, exclusive property of Cengage Learning and/or its licensors. The noncommercial use only and may not be reproduced, posted Supplement is furnished by Cengage Learning on an “as is” basis electronically or distributed, except that portions of the without any warranties, express or implied. This Agreement will be Supplement may be provided to your students IN PRINT FORM governed by and construed pursuant to the laws of the State of ONLY in connection with your instruction of the Course, so long New York, without regard to such State’s conflict of law rules. as such students are advised that they may not copy or distribute any portion of the Supplement to any third party. Test Thank you for your assistance in helping to safeguard the integrity banks and other testing materials may be made available in the of the content contained in this Supplement. We trust you find the classroom and collected at the end of each class session, or Supplement a useful teaching tool. Printed in the United States of America 1 2 3 4 5 6 7 14 13 12 11 10 INSTRUCTOR'S SOLUTIONS MANUAL TO ACCOMPANY FUNDAMENTALS OF DIGITAL SIGNAL PROCESSING using MATLAB SECOND EDITION ROBERT J. HARRIS Contents Chapter 1 1 Chapter 2 57 Chapter 3 155 Chapter 4 274 Chapter 5 384 Chapter 6 467 Chapter 7 572 Chapter 8 675 Chapter 9 765 Chapter 1 1.1 Suppose the input to an amplifier is xa (t) = sin(2πF0 t) and the steady-state output is ya (t) = 100 sin(2πF0 t + φ1 ) − 2 sin(4πF0 t + φ2 ) + cos(6πF0 t + φ3 ) (a) Is the amplifier a linear system or is it a nonlinear system? (b) What is the gain of the amplifier? (c) Find the average power of the output signal. (d) What is the total harmonic distortion of the amplifier? Solution (a) The amplifier is nonlinear because the steady-state output contains harmonics.2), the amplifier gain is K = 100.4), the output power is d20 1 2 d1 + d+ 22 + d23 Py = + 4 2 = . All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.2 Consider the following signum function that returns the sign of its argument. 1 , t>0 ∆ sgn(t) = 0 , t=0 −1 , t < 0 (a) Using Appendix 1, find the magnitude spectrum (b) Find the phase spectrum Solution (a) From Table A2 in Appendix 1 1 Xa (f ) = jπf Thus the magnitude spectrum is Aa (f ) = |Xa(f )| 1 = |jπf | 1 = π|f | (b) The phase spectrum is φa (f ) = 6 Xa (f ) = −6 jπf π = −sgn(f ) 2 © 2012 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.3 Parseval’s identity states that a signal and its spectrum are related in the following way. Z ∞ Z ∞ 2 |xa (t)| dt = |Xa(f )|2 df −∞ −∞ Use Parseval’s identity to compute the following integral. Z ∞ J = sinc2 (2Bt)dt −∞ Solution From Table A2 in Appendix 1 if xa (t) = sinc(2Bt) then µa (f + B) − µa (f − B) Xa (f ) = 2B Thus by Parseval’s identity Z ∞ J = sin2 (2Bt)dt Z−∞ ∞ = |xa (t)|2 dt Z−∞ ∞ = |Xa(f )|2 df −∞ Z B 1 = df 2B −B = 1 © 2012 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.4 Consider the causal exponential signal xa (t) = exp(−ct)µa (t) (a) Using Appendix 1, find the magnitude spectrum. (b) Find the phase spectrum (c) Sketch the magnitude and phase spectra when c = 1. Solution (a) From Table A2 in Appendix 1 1 Xa (f ) = c + j2πf Thus the magnitude spectrum is Aa(f ) = |Xa(f )| 1 = |c + j2πf | 1 = p c + (2πf )2 2 (b) The phase spectrum is Aa (f ) = |Xa (f )| = 1 − 6 (c + j2πf ) 6 2πf = − tan−1 c © 2012 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.4 (c) Magnitude and Phase Spectra, c = 1 © 2012 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.5 If a real analog signal xa (t) is square integrable, then the energy that the signal contains within the frequency band [F0 , F1 ] where F0 ≥ 0 can be computed as follows. Z F1 E(F0 , F1 ) = 2 |Xa(f )|2 df F0 Consider the following double exponential signal with c > 0. Solution (a) From Table A2 in Appendix 1 2c Xa (f ) = c2 + 4π 2 f 2 Thus the total energy of xa (t) is Z ∞ E(0, ∞) = 2 |Xa(f )|2 df Z0 ∞ 2c = 2 df 0 c2 + 4π 2 f 2 ∞ 4c 2πf = tan−1 2πc c 0 2 π = π 2 = 1 (b) Using part (a), the percentage of the total energy that lies in the frequency range [0, 2] Hz is 100E(0, 2) p = E(0, ∞) = 100E(0, 2) 2πf 2 200 = tan−1 π c 0 200 4π = tan−1 % π c © 2012 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.6 Let xa (t) be a periodic signal with period T0 . The average power of xa(t) can be defined as follows. Z T0 1 Px = |xa (t)|2 dt T0 0 Find the average power of the following periodic continuous-time signals. (a) xa(t) = cos(2πF0 t) (b) xa(t) = c (c) A periodic train of pulses of amplitude a, duration T , and period T0 . Solution (a) Using Appendix 2, Z 1/F0 Px = F0 cos2 (2πF0 t)dt 0 Z 1/F0 F0 = [1 + cos(4πF0 t)]dt 2 0 1 = 2 (b) Z T0 1 Px = c2 dt T0 0 = c2 (c) Z T 1 Px = a2 dt T0 0 a2 T = T0 © 2012 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.7 Consider the following discrete-time signal where the samples are represented using N bits. x(k) = exp(−ckT )µ(k) (a) How many bits are needed to ensure that the quantization level is less than . What is the average power of the quantization noise? Solution (a) For k ≥ 0, the signal ranges over 0 ≤ x(k) ≤ 1. Thus xmin = 0 and xmax = 1 and from (1.3) the quantization level is 1 q = 2N Setting q = .001 yields 1 1 = 2N 1000 Taking the log of both sides, −N ln(2) = − ln(1000) or ln(1000) N = ceil ln(2) = ceil(9.8) the average power of the quantization noise using N = 8 bits is q2 E[e2] = 12 1 = 12(2N )2 = 1. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.8 Show that the spectrum of a causal signal xa(t) can be obtained from the Laplace transform Xa(s) be replacing s by j2πf . Is this also true for noncausal signals? Solution For a causal signal xa (t), the one-sided Laplace transform can be extended to a two-sided transform without changing the result. Thus the spectrum of a causal signal can be obtained from the Laplace transform as follows. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.9 Consider the following periodic signal. (b) Suppose xa(t) is sampled with a sampling frequency of fs = 8 Hz. Sketch the magnitude spectrum of xa (t) and the sampled signal, x̂a (t). (c) Does aliasing occur when xa (t) is sampled at the rate fs = 8 Hz? What is the folding frequency in this case? (d) Find a range of values for the sampling interval T which ensures that aliasing will not occur. The folding frequency is fs fd = 2 = 4 Hz (d) The signal xa (t) is bandlimited to 5 Hz.1, to avoid aliasing, the sampling rate must satisfy fs > 10.