Chapter 1: Introduction Analog and Digital Signals I I analog signal = continuous-time + continuous amplitude digital signal = discrete-time + discrete amplitude Introduction to Digital Signal Processing continuous amplitude discrete amplitude x(t) continuous-time x(t) 2 2 Professor Deepa Kundur -4 -3 -2 -1 1 t -4 -3 -2 -1 0.5 1 / 58 -2 -1 1 1.5 2 3 4 t x[n] 2 0 1 2 3 n 1 -3 -2 -1 0 1 2 1 3 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing Chapter 1: Introduction 2.5 -2 1 -3 n 2 / 58 Chapter 1: Introduction Analog and Digital Signals I 4 x[n] discrete-time I 3 -2 University of Toronto Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 2 1 0.5 Discrete-time Sinusoids analog system = analog input + analog output digital system = digital input + digital output x(n) = A cos(ωn + θ) = A cos(2πfn + θ), n ∈ Z Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 3 / 58 I discrete-time signal (not digital), ∵ −A ≤ xa (t) ≤ A and n ∈ Z I A = amplitude I ω = frequency in rad/sample I f = frequency in cycles/sample; note: ω = 2πf I θ = phase in rad Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 4 / 58 Chapter 1: Introduction Chapter 1: Introduction MINIMUM OSCILLATION MAXIMUM OSCILLATION ENVELOPE CYCLES MINIMUM OSCILLATION Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 5 / 58 Chapter 1: Introduction Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 6 / 58 Chapter 1: Introduction NOT PERIODIC ENVELOPE CYCLES Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 7 / 58 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 8 / 58 Chapter 1: Introduction Chapter 1: Introduction Uniqueness: Continuous-time Uniqueness: Continuous-time F1 6= F2 : For F1 6= F2 , A cos(2πF1 t + θ) 6= A cos(2πF2 t + θ) except at discrete points in time. Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 9 / 58 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing Chapter 1: Introduction 10 / 58 Chapter 1: Introduction Uniqueness: Discrete-time -3 Let f1 = f0 + k where k ∈ Z, x1 (n) = = = = -2 -1 0 1 -1 0 1 2 3 4 5 3 4 5 6 A e j(2πf1 n+θ) A e j(2π(f0 +k)n+θ) A e j(2πf0 n+θ) · e j(2πkn) x0 (n) · 1 = x0 (n) -3 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 11 / 58 -2 2 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 6 12 / 58 Chapter 1: Introduction Chapter 1: Introduction Harmonically Related Complex Exponentials Harmonically Related Complex Exponentials Scientific Designation C1 C2 C3 C4 (middle C) C5 C6 C7 C8 Harmonically related sk (t) = e jkΩ0 t = e j2πkF0 t , (cts-time) k = 0, ±1, ±2, . . . Scientific Designation C-1 C0 C1 C2 C3 C4 .. . Frequency (Hz) 8.176 16.352 32.703 65.406 130.813 261.626 .. . k for F0 = 8.176 1 2 4 8 16 32 C9 8372.018 1024 C1 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 13 / 58 C2 C3 Frequency (Hz) 32.703 65.406 130.813 261.626 523.251 1046.502 2093.005 4186.009 C4 k for F0 = 8.176 4 8 16 32 64 128 256 512 C5 C6 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing Chapter 1: Introduction C7 C8 14 / 58 Chapter 1: Introduction Harmonically Related Complex Exponentials Harmonically Related Complex Exponentials What does the family of harmonically related sinusoids sk (t) have in common? Discrete-time Case: Harmonically related sk (t) = e jkΩ0 t = e j2π(kF0 )t , (cts-time) k = 0, ±1, ±2, . . . For periodicity, select f0 = 1 N where N ∈ Z: Harmonically related sk (n) = e j2πkf0 n = e j2πkn/N , (dts-time) k = 0, ±1, ±2, . . . 1 1 = cyclic frequency kF0 period: Tk = any integer multiple of T0 1 common period: T = k · T0,k = F0 fund. period: T0,k = Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing I 15 / 58 There are only N distinct dst-time harmonics: sk (n), k = 0, 1, 2, . . . , N − 1. Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 16 / 58 Chapter 1: Introduction Chapter 1: Introduction Analog-to-Digital Conversion Analog-to-Digital Conversion A/D converter xa(t) A/D converter xq(n) x(n) Sampler Analog signal Quantizer Discrete-time signal xa(t) 01011... Coder Quantized signal Digital signal xq(n) x(n) Sampler Analog signal Quantizer Discrete-time signal 01011... Coder Quantized signal Digital signal Sampling: I conversion from cts-time to dst-time by taking “samples” at discrete time instants I E.g., uniform sampling: x(n) = xa (nT ) where T is the sampling period and n ∈ Z Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 17 / 58 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing Chapter 1: Introduction Chapter 1: Introduction Analog-to-Digital Conversion Analog-to-Digital Conversion A/D converter xa(t) Analog signal A/D converter x(n) Sampler 18 / 58 Quantizer Discrete-time signal xq(n) Quantized signal xa(t) 01011... Coder Digital signal Analog signal Quantization: I conversion from dst-time cts-valued signal to a dst-time dst-valued signal I quantization error: eq (n) = xq (n) − x(n) for all n ∈ Z Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing x(n) Sampler Quantizer Discrete-time signal xq(n) Quantized signal 01011... Coder Digital signal Coding: I representation of each dst-value xq (n) by a b-bit binary sequence I e.g., if for any n, xq (n) ∈ {0, 1, . . . , 6, 7}, then the coder may use the following mapping to code the quantized amplitude: 19 / 58 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 20 / 58 Chapter 1: Introduction Chapter 1: Introduction Analog-to-Digital Conversion Sampling Theorem A/D converter xa(t) x(n) Sampler Analog signal Quantizer Discrete-time signal xq(n) If the highest frequency contained in an analog signal xa (t) is Fmax = B and the signal is sampled at a rate 01011... Coder Quantized signal Fs > 2Fmax = 2B Digital signal then xa (t) can be exactly recovered from its sample values using the interpolation function Example coder: 0 1 2 3 000 001 010 011 4 5 6 7 100 101 110 111 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing sin(2πBt) 2πBt is called the Nyquist rate. g (t) = Note: FN = 2B = 2Fmax 21 / 58 Chapter 1: Introduction Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing Chapter 1: Introduction Sampling Theorem Bandlimited Interpolation Sampling Period = T = 1 1 = Fs Sampling Frequency Therefore, given the interpolation relation, xa (t) can be written as xa (t) = 22 / 58 ∞ X x(n) samples bandlimited interpolation function -- sinc xa (nT )g (t − nT ) n=−∞ xa (t) = ∞ X n 0 x(n) g (t − nT ) n=−∞ where xa (nT ) = x(n); called bandlimited interpolation. Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 23 / 58 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 24 / 58 Chapter 1: Introduction Chapter 1: Introduction Digital-to-Analog Conversion Digital-to-Analog Conversion x(n) original/bandlimited interpolated signal original/bandlimited interpolated signal 1 n 0 I I Common interpolation approaches: bandlimited interpolation, zero-order hold, linear interpolation, higher-order interpolation techniques, e.g., using splines In practice, “cheap” interpolation along with a smoothing filter is employed. Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing I T 2T t 3T Common interpolation approaches: bandlimited interpolation, zero-order hold, linear interpolation, higher-order interpolation techniques, e.g., using splines In practice, “cheap” interpolation along with a smoothing filter is employed. 26 / 58 Elementary Discrete-Time Signals 1. unit sample sequence (a.k.a. Kronecker delta function): 1, for n = 0 δ(n) = 0, for n 6= 0 linear interpolation 1 0 T Chapter 2: Dst-Time Signals & Systems Digital-to-Analog Conversion -3T -2T -T 0 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing Chapter 1: Introduction original/bandlimited interpolated signal -3T -2T -T zero-order hold I 25 / 58 1 2T t 3T 2. unit step signal: 1, 0, n, for n ≥ 0 0, for n < 0 u(n) = for n ≥ 0 for n < 0 3. unit ramp signal: I I Common interpolation approaches: bandlimited interpolation, zero-order hold, linear interpolation, higher-order interpolation techniques, e.g., using splines In practice, “cheap” interpolation along with a smoothing filter is employed. Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 27 / 58 ur (n) = Note: u(n) − u(n − 1)= ur (n + 1) − 2ur (n) + ur (n − 1) δ(n) = u(n) = ur (n + 1) − ur (n) Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 28 / 58 Chapter 2: Dst-Time Signals & Systems Chapter 2: Dst-Time Signals & Systems Signal Symmetry Signal Symmetry Even signal: x(−n) = x(n) Even signal component: xe (n) = 12 [x(n) + x(−n)] Odd signal: x(−n) = −x(n) Odd signal component: xo (n) = 12 [x(n) − x(−n)] x(n) x(n) 2 2 2 1 1 1 x(n) -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 n -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 n -7 -6 -5 -4 -3 -2 -1 0 1 Note: x(n) = xe (n) + xo (n) 2 3 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 4 5 6 7 29 / 58 n Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing Chapter 2: Dst-Time Signals & Systems Chapter 2: Dst-Time Signals & Systems Signal Symmetry 1 Simple Manipulation of Discrete-Time Signals x(n) (x(n)+x(-n))/2 1 0.5 -6 -5 -4 -3 -2 -1 0 1 -0.5 2 3 4 5 6 7 8 n I Transformation of independent variable: I -6 -5 -4 -3 -2 -1 0 1 -0.5 2 3 4 5 6 7 8 n I I 1 0.5 2 3 4 5 6 7 8 n 0.5 -6 -5 -4 -3 -1 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing -2 -1 -1 0 1 2 3 4 -0.5 5 6 7 8 I n 31 / 58 Question: what if α 6∈ Z? Additional, multiplication and scaling: I odd part Question: what if k 6∈ Z? time scale: n → αn, α ∈ Z I (x(n)-x(-n))/2 1 time shift: n → n − k, k ∈ Z I -1 x(-n) -0.5 even part 0.5 -1 -6 -5 -4 -3 -2 -1 0 1 30 / 58 I amplitude scaling: y (n) = Ax(n), −∞ < n < ∞ sum: y (n) = x1 (n) + x2 (n), −∞ < n < ∞ product: y (n) = x1 (n)x2 (n), −∞ < n < ∞ Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 32 / 58 Chapter 2: Dst-Time Signals & Systems Chapter 2: Dst-Time Signals & Systems Simple Manipulation of Discrete-Time Signals I Simple Manipulation of Discrete-Time Signals II Find x(n) − x(n + 1). 3 x(n) 3 2 2 2 2 -1 2 3 4 5 6 7 8 9 10 -3 -2 -1 0 1 15 20 n -1 -2 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing -1 -1 -2 -3 -2 -3 33 / 58 1 1 15 7 8 9 10 20 n -1 -1 -x(n+1) 34 / 58 Simple Manipulation of Discrete-Time Signals Graph of x( 32 n + 1). + 1). n < −1 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 > 12 -1 5 6 2 Chapter 2: Dst-Time Signals & Systems Simple Manipulation of Discrete-Time Signals I Find 2 3 4 x(n)-x(n+1) Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing Chapter 2: Dst-Time Signals & Systems x( 32 n 1 1 1 1 -3 -2 -1 0 1 x(n) 3 3n 2 +1 < − 12 − 12 1 0 if 3n 2 5 2 4 11 2 7 17 2 10 23 2 13 29 2 16 35 2 19 > 19 0 if 3n 2 x( 3n + 1) 2 + 1 is an integer; undefined otherwise undefined x(1) = 1 undefined x(4) = 2 undefined x(7) = 3 undefined x(10) = 2 undefined x(13) = 1 undefined x(16) = −1 undefined x(19) = −2 + 1 is an integer; undefined otherwise Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 3 2 3 2 2 1 -3 -2 -1 0 1 -1 -2 -3 35 / 58 2 3 4 5 6 1 This signal is undefined for values of n that are not even integers and zero for even integers not shown on this sketch. 7 8 9 10 11 12 13 14 n -1 -2 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 36 / 58 Chapter 2: Dst-Time Signals & Systems Chapter 2: Dst-Time Signals & Systems Input-Output Description of Dst-Time Systems Classification of Discrete-Time Systems Common System Properties: input/ excitation x(n) I output/ response Discrete-time signal Discrete-time signal I y(n) Discrete-time System Input-output description (exact structure of system is unknown or ignored): y (n) = T [x(n)] “black box” representation: 37 / 58 time-invariant vs. time-variant linear vs. nonlinear causal vs. non-causal stable vs. unstable systems .. . 38 / 58 Chapter 2: Dst-Time Signals & Systems Static vs. Dynamic Static vs. Dynamic I I dynamic Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing Chapter 2: Dst-Time Signals & Systems I vs. .. . T x(n) −→ y (n) Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing static Static system (a.k.a. memoryless): the output at time n depends only on the input sample at time n; otherwise the system is said to be dynamic Consider the general system: y (n) = T [x(n − N), x(n − N + 1), · · · , x(n − 1), x(n), x(n + 1), · · · , x(n + M − 1), x(n + M)], a system is static iff (if and only if) y (n) = T [x(n), n] N, M > 0 I For N = M = 0, y (n) = T [x(n)], the system is static. I For 0 < N, M < ∞, the system is said to be dynamic with finite memory of duration N + M + 1. I For either N and/or M equal to infinite, the system is said to have infinite memory. for every time instant n. Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 39 / 58 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 40 / 58 Chapter 2: Dst-Time Signals & Systems Chapter 2: Dst-Time Signals & Systems Static vs. Dynamic Discrete-Time Bounded Signals Examples: memoryless or not? I I I I I I I I x[n] y (n) = A x(n), A 6= 0 y (n) = A x(n) + B, A, B, 6= 0 π y (n) = x(n) cos( 25 (n − 5)) y (n) = x(−n) y (n) = x(n + 1) 1 y (n) = 1−x(n+2) x[n] n n |x[n]| |x[n]| n y (n) = e 3x(n) P y (n) = nk=−∞ x(k) n x[n] x[n] BOUNDED SIGNAL n UNBOUNDED SIGNAL n Ans: Y, Y, Y, N, N, N, Y, N Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 41 / 58 Chapter 2: Dst-Time Signals & Systems Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 42 / 58 Chapter 2: Dst-Time Signals & Systems The Convolution Sum The Convolution Sum Let the response of a linear time-invariant (LTI) system to the unit sample input δ(n) be h(n). T δ(n) −→ h(n) Recall: x(n) = ∞ X T δ(n − k) −→ h(n − k) x(k)δ(n − k) T α δ(n − k) −→ α h(n − k) k=−∞ T x(k) δ(n − k) −→ x(k) h(n − k) ∞ ∞ X X T x(k)δ(n − k) −→ x(k)h(n − k) k=−∞ k=−∞ T x(n) −→ y (n) Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 43 / 58 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 44 / 58 Chapter 2: Dst-Time Signals & Systems Chapter 2: Dst-Time Signals & Systems The Convolution Sum Finite vs. Infinite Impulse Response Implementation: Two classes Finite impulse response (FIR): Therefore, y (n) = ∞ X y (n) = x(k)h(n − k) = x(n) ∗ h(n) M−1 X ) h(k)x(n − k) nonrecursive systems k=0 k=−∞ Infinite impulse response (IIR): for any LTI system. y (n) = ∞ X ) h(k)x(n − k) recursive systems k=0 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 45 / 58 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing Chapter 2: Dst-Time Signals & Systems Chapter 2: Dst-Time Signals & Systems System Realization Building Block Elements General expression for Nth-order LCCDE: N X k=0 ak y (n−k) = 46 / 58 M X bk x(n−k) Adder: + Unit delay: a0 , 1 k=0 Constant multiplier: Initial conditions: y (−1), y (−2), y (−3), . . . , y (−N). Need: (1) constant scale, (2) addition, (3) delay elements. Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing Signal multiplier: 47 / 58 + Unit advance: Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 48 / 58 Chapter 2: Dst-Time Signals & Systems Chapter 2: Dst-Time Signals & Systems Direct Form I IIR Filter Implementation v(n) + ak y (n − k) + k=1 M X bk x(n − k) k=0 is equivalent to the cascade of the following systems: ... bk x(n − k) nonrecursive | {z } k=0 input 1 N X y (n) = − ak y (n − k) + v (n) recursive |{z} |{z} k=1 output 2 input 2 v (n) = |{z} output 1 + + + + + + ... M X + ... y (n) = − N X + ... Direct Form I vs. Direct Form II Realizations + LTI All-zero system LTI All-pole system Requires: M + N + 1 multiplications, M + N additions, M + N memory locations Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 49 / 58 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing Chapter 2: Dst-Time Signals & Systems Chapter 2: Dst-Time Signals & Systems Direct Form II IIR Filter Implementation + Direct Form II IIR Filter Implementation Adder: + + + + + Unit delay: + + + Constant multiplier: + + + Unit advance: + + + + ... + + ... Signal multiplier: ... ... + ... ... + ... + ... + LTI All-pole system 50 / 58 For N>M LTI All-zero system Requires: M + N + 1 multiplications, M + N additions, M + N memory locations Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 51 / 58 Requires: M + N + 1 multiplications, M + N additions, max(M, N) memory locations Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 52 / 58 Chapter 3: The z-Transform and Its Applications Chapter 3: The z-Transform and Its Applications The Direct z-Transform I Region of Convergence Direct z-Transform: X (z) = ∞ X x(n)z −n I the region of convergence (ROC) of X (z) is the set of all values of z for which X (z) attains a finite value I The z-Transform is, therefore, uniquely characterized by: n=−∞ I Notation: X (z) ≡ 1. expression for X (z) 2. ROC of X (z) Z{x(n)} Z x(n) ←→ X (z) Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 53 / 58 Chapter 3: The z-Transform and Its Applications 54 / 58 Chapter 3: The z-Transform and Its Applications ROC Families: Finite Duration Signals Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing ROC Families: Infinite Duration Signals 55 / 58 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 56 / 58 Chapter 3: The z-Transform and Its Applications Chapter 3: The z-Transform and Its Applications z-Transform Properties Property Notation: Common Transform Pairs Linearity: Time shifting: Time Domain x(n) x1 (n) x2 (n) a1 x1 (n) + a2 x2 (n) x(n − k) z-Domain X (z) X1 (z) X2 (z) a1 X1 (z) + a2 X2 (z) z −k X (z) z-Scaling: Time reversal Conjugation: z-Differentiation: Convolution: an x(n) x(−n) x ∗ (n) n x(n) x1 (n) ∗ x2 (n) X (a−1 z) X (z −1 ) X ∗ (z ∗ ) dX (z) −z dz X1 (z)X2 (z) ROC ROC: r2 < |z| < r1 ROC1 ROC2 At least ROC1 ∩ ROC2 At least ROC, except z = 0 (if k > 0) and z = ∞ (if k < 0) |a|r2 < |z| < |a|r1 1 < |z| < r1 r1 2 ROC r2 < |z| < r1 At least ROC1 ∩ ROC2 1 2 3 4 5 6 Signal, x(n) δ(n) u(n) an u(n) nan u(n) n −a u(−n − 1) −nan u(−n − 1) 7 cos(ω0 n)u(n) 8 among others . . . sin(ω0 n)u(n) 9 an cos(ω0 n)u(n) 10 an sin(ω0 n)u(n) z-Transform, X (z) 1 1 1−z −1 1 1−az −1 az −1 (1−az −1 )2 1 1−az −1 az −1 (1−az −1 )2 1−z −1 cos ω0 1−2z −1 cos ω0 +z −2 z −1 sin ω0 1−2z −1 cos ω0 +z −2 1−az −1 cos ω0 1−2az −1 cos ω0 +a2 z −2 1−az −1 sin ω0 1−2az −1 cos ω0 +a2 z −2 ROC All z |z| > 1 |z| > |a| |z| > |a| |z| < |a| |z| < |a| |z| > 1 |z| > 1 |z| > |a| |z| > |a| Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 57 / 58 Professor Deepa Kundur (University of Toronto)Introduction to Digital Signal Processing 58 / 58