digital signal processing
play

Digital Signal Processing Markus Kuhn Computer Laboratory - PowerPoint PPT Presentation

Digital Signal Processing Markus Kuhn Computer Laboratory http://www.cl.cam.ac.uk/Teaching/2003/DigSigProc/ Easter 2004 Part II 45) ing. 2nd ed., Prentice-Hall, 1999. ( 47) Textbooks 74) R.G. Lyons: Understanding digital


  1. Digital Signal Processing Markus Kuhn Computer Laboratory http://www.cl.cam.ac.uk/Teaching/2003/DigSigProc/ Easter 2004 – Part II

  2. � 45) ing. 2nd ed., Prentice-Hall, 1999. ( � 47) Textbooks � 74) → R.G. Lyons: Understanding digital signal processing. Prentice- Hall, 2004. ( � 40) → A.V. Oppenheim, R.W. Schafer: Discrete-time signal process- � 40) → J. Stein: Digital signal processing – a computer science per- spective. Wiley, 2000. ( � 38) → S.W. Smith: Digital signal processing – a practical guide for engineers and scientists. Newness, 2003. ( → K. Steiglitz: A digital signal processing primer – with appli- cations to digital audio and computer music. Addison-Wesley, 1996. ( → Sanjit K. Mitra: Digital signal processing – a computer-based approach. McGraw-Hill, 2002. ( 2

  3. Digital signal processing Concerned with algorithms to interpret, transform, and model wave- forms and the information they contain. Some typical applications: → geophysics → medical diagnostics seismology, oil exploration ECG, EEG, MEG, audiology, computer tomography, magnetic- → astronomy resonance imaging speckle interferometry, VLBI → consumer electronics → experimental physics perceptual coding of audio and video sensor-data evaluation on DVDs, speech synthesis, speech → communication systems recognition modulation/demodulation, channel → security equalization, echo cancellation steganography, digital watermarking, → aviation biometric identification, SIGINT radar, radio navigation → engineering → music control systems, feature extraction synthetic instruments, audio effects, for pattern recognition noise reduction 3

  4. Sequences and systems A discrete sequence { x n } is a sequence of numbers . . . , x − 2 , x − 1 , x 0 , x 1 , x 2 , . . . where x n denotes the n -th number in the sequence ( n ∈ Z ). A discrete sequence maps integer numbers onto real (or complex) numbers. The notation is not well standardized. Some authors write x [ n ] instead of x n , others x ( n ) . Where a discrete sequence { x n } samples a continuous function x ( t ) as x n = x ( t s · n ) = x ( n/f s ) , we call t s the sampling period and f s = 1 /t s the sampling frequency . A discrete system T receives as input a sequence { x n } and transforms it into an output sequence { y n } = T { x n } : discrete . . . , x 2 , x 1 , x 0 , x − 1 , . . . . . . , y 2 , y 1 , y 0 , y − 1 , . . . system T 4

  5. Properties of sequences A sequence { x n } is ∞ � ⇔ | x n | < ∞ absolutely summable n = −∞ ∞ | x n | 2 < ∞ � ⇔ square summable n = −∞ ⇔ ∃ k > 0 : ∀ n ∈ Z : x n = x n + k periodic A square-summable sequence is also called an energy signal , and ∞ � | x n | 2 n = −∞ its energy. This terminology reflects that if U is a voltage supplied to a load resistor R , then P = UI = U 2 /R is the power consumed. So even where we drop physical units (e.g., volts) for simplicity in sequence calcu- lations, it is still customary to refer to the squared values of a sequence as power and to its sum or integral over time as energy . 5

  6. A non-square-summable sequence is a power signal if its average power k 1 � | x n | 2 lim 1 + 2 k k →∞ n = − k exists. Special sequences Unit-step sequence: � 0 , n < 0 u n = 1 , n ≥ 0 Impulse sequence: � 1 , n = 0 δ n = 0 , n � = 0 = u n − u n − 1 6

  7. Types of discrete systems A causal system cannot look into the future: y n = f ( x n , x n − 1 , x n − 2 , . . . ) A memory-less system depends only on the current input value: y n = f ( x n ) A delay system shifts a sequence in time: y n = x n − d T is a time-invariant system if for any d { y n } = T { x n } ⇐ ⇒ { y n − d } = T { x n − d } . T is a linear system if for any pair of sequences { x n } and { x ′ n } T { a · x n + b · x ′ n } = a · T { x n } + b · T { x ′ n } . 7

  8. Examples: The accumulator system n � y n = x k k = −∞ is a causal, linear, time-invariant system with memory, as are the back- ward difference system y n = x n − x n − 1 , the M-point moving average system M − 1 y n = 1 x n − k = x n − M +1 + · · · + x n − 1 + x n � M M k =0 and the exponential averaging system ∞ (1 − α ) k · x n − k . � y n = α · x n + (1 − α ) · y n − 1 = α k =0 8

  9. Examples for time-invariant non-linear memory-less systems are y n = x 2 n , y n = log 2 x n , y n = max { min {⌊ 256 x n ⌋ , 255 } , 0 } , examples for linear but not time-invariant systems are � x n , n ≥ 0 y n = = x n · u n 0 , n < 0 y n = x ⌊ n/ 4 ⌋ x n · ℜ ( e ω j n ) y n = and examples for linear time-invariant non-causal system are 1 y n = 2( x n − 1 + x n +1 ) 9 x n + k · sin( πkω ) � y n = · [0 . 5 + 0 . 5 · cos( π k/ 10)] πkω k = − 9 9

  10. Constant-coefficient difference equations Of particular practical interest are causal linear time-invariant systems of the form x n b 0 y n N � y n = b 0 · x n − a k · y n − k z − 1 − a 1 k =1 y n − 1 z − 1 − a 2 Block diagram representation y n − 2 of sequence operations: z − 1 x ′ − a 3 n y n − 3 x n x n + x ′ n Addition: Multiplication x n a ax n The a k and b m are by constant: constant coefficients. x n x n − 1 z − 1 Delay: 10

  11. or x n x n − 1 x n − 2 x n − 3 z − 1 z − 1 z − 1 M � y n = b m · x n − m b 0 b 1 b 2 b 3 m =0 y n or the combination of both: a − 1 x n b 0 y n 0 z − 1 z − 1 b 1 − a 1 N M x n − 1 y n − 1 � � a k · y n − k = b m · x n − m z − 1 z − 1 m =0 k =0 b 2 − a 2 x n − 2 y n − 2 z − 1 z − 1 b 3 − a 3 x n − 3 y n − 3 The MATLAB function filter is an efficient implementation of the last variant. 11

  12. Convolution All linear time-invariant (LTI) systems can be represented in the form ∞ � y n = a k · x n − k k = −∞ where { a k } is a suitably chosen sequence of coefficients. This operation over sequences is called convolution and defined as ∞ � { p n } ∗ { q n } = { r n } ⇐ ⇒ ∀ n ∈ Z : r n = p k · q n − k . k = −∞ If { y n } = { a n } ∗ { x n } is a representation of an LTI system T , with { y n } = T { x n } , then we call the sequence { a n } the impulse response of T , because { a n } = T { δ n } . 12

  13. Convolution examples A B C D A ∗ B A ∗ C E F C ∗ A A ∗ E D ∗ E A ∗ F 13

  14. Properties of convolution For arbitrary sequences { p n } , { q n } , { r n } and scalars a , b : → Convolution is associative ( { p n } ∗ { q n } ) ∗ { r n } = { p n } ∗ ( { q n } ∗ { r n } ) → Convolution is commutative { p n } ∗ { q n } = { q n } ∗ { p n } → Convolution is linear { p n } ∗ { a · q n + b · r n } = a · ( { p n } ∗ { q n } ) + b · ( { p n } ∗ { r n } ) → The impulse sequence (slide 6) is neutral under convolution { p n } ∗ { δ n } = { δ n } ∗ { p n } = { p n } → Sequence shifting is equivalent to convolving with a shifted impulse { p n − d } = { p n } ∗ { δ n − d } 14

  15. Can all LTI systems be represented by convolution? Any sequence { x n } can be decomposed into a weighted sum of shifted impulse sequences: ∞ � { x n } = x k · { δ n − k } k = −∞ Let’s see what happens if we apply a linear ( ∗ ) time-invariant ( ∗∗ ) system T to such a decomposed sequence: ∞ ∞ � � ( ∗ ) � � T { x n } = T x k · { δ n − k } = x k · T { δ n − k } k = −∞ k = −∞ ∞ ∞ � � ( ∗∗ ) � � = x k · { δ n − k } ∗ T { δ n } = x k · { δ n − k } ∗ T { δ n } k = −∞ k = −∞ = { x n } ∗ T { δ n } q . e . d . ⇒ The impulse response T { δ n } fully characterizes an LTI system. 15

  16. Exercise 1 A finite-length sequence is non-zero only at a finite number of positions. If m and n are the first and last non-zero positions, respectively, then we call n − m +1 the length of that sequence. What maximum length can the result of convolving two sequences of length k and l have? Exercise 2 The length-3 sequence a 0 = − 3 , a 1 = 2 , a 2 = 1 is convolved with a second sequence { b n } of length 5. (a) Write down this linear operation as a matrix multiplication involving a matrix A , a vector � b ∈ R 5 , and a result vector � c . (b) Use MATLAB to multiply your matrix by the vector � b = (1 , 0 , 0 , 2 , 2) and compare the result with that of using the conv function. (c) Use the MATLAB facilities for solving systems of linear equations to undo the above convolution step. Exercise 3 (a) Find a pair of sequences { a n } and { b n } , where either contains at least three different values and where the convolution { a n }∗{ b n } results in an all-zero sequence. (b) Does every LTI system T have an inverse LTI system T − 1 such that { x n } = T − 1 T { x n } for all sequences { x n } ? Why? 16

  17. Direct form I and II implementations a − 1 a − 1 x n b 0 y n x n b 0 y n 0 0 z − 1 z − 1 z − 1 b 1 − a 1 − a 1 b 1 x n − 1 y n − 1 = z − 1 z − 1 z − 1 b 2 − a 2 − a 2 b 2 x n − 2 y n − 2 z − 1 z − 1 z − 1 b 3 − a 3 − a 3 b 3 x n − 3 y n − 3 The block diagram representation of the constant-coefficient difference equation on slide 11 is called the direct form I implementation . The number of delay elements can be halved by using the commutativity of convolution to swap the two feedback loops, leading to the direct form II implementation of the same LTI system. 17

Recommend


More recommend