Digital Signals and Systems 1 Digital Signals A discrete-time signal ๐ฅ(๐) is a function of an integer variable ๐. In the DS processor, the signal is represented by the discrete encoded values with a finite precision. Graphical representation of a discrete-time signal ๐(๐) Functional representation ๐ฅ ๐ = … , 0 , ๐ , 1 , 4 , 1, 0, 0, … ๐ฅ ๐ = ๐ , −2 , 1 , 4 , −1, Tabular representation ๐๐๐๐๐๐๐ก๐ − ๐๐ข๐๐๐ก๐๐๐ ๐ ๐๐๐๐๐ ๐๐๐๐๐ก๐ − ๐๐ข๐๐๐ก๐๐๐ ๐ ๐๐๐๐๐ Sequence representation (bold or arrow for origin n=0) Mathematically a discrete-time signal ๐ฅ ๐ can be determined by 2 Common Digital Sequences Unit-impulse sequence: Unit-step sequence: Exponential sequence: ๐ฅ ๐ = ๐๐ ๐๐๐ ๐๐๐ ๐ 0<a<1 3 Shifted Sequences Shifted unit-impulse Shifted unit-step Right shift by two samples Left shift by two samples 4 Example 1 Sketch this following digital signal sequence, x(๐) = δ(๐ + 1) + 0.5 δ (๐ − 1) + 2 ๐ฟ(๐ − 2). Solution: 5 Generation of Digital Signals In order to generate the digital sequence from its analog signal function, the analog signal ๐ฅ ๐ก is uniformly sampled at the time interval of โ๐ก = ๐ , T is the sampling period. x(n): digital signal x(t): analog signal sampling interval : โ๐ก = ๐ ๐ฅ ๐ = ๐ฅ(๐ก) ๐ก=๐๐ = ๐ฅ(๐๐ Also 6 Example 2 Convert analog signal x(t) into digital signal x(n), when sampling period is 125 microsecond, also plot sample values. Solution: The first five sample values: Plot of the digital sequence: 7 Digital Systems A digital system is a device or an algorithm that performs prescribed operations (or transformation) on a signal ๐ฅ ๐ , called the input or excitation, to produce another signal ๐ฆ ๐ called the output or response of the system. transformation ๐ฅ ๐ Input signal (Excitation) Digital System ๐ ๐ Output signal (Response) Example Determine the response of the following system (mean value of three values) to the input signal ๐ฅ ๐ = ๐ฆ ๐ = ๐, 0, −3 ≤ ๐ ≤ 3 ๐๐กโ๐๐๐ค๐๐ ๐ 1 ๐ฅ ๐ + 1 + ๐ฅ ๐ + ๐ฅ(๐ − 1) 3 ๐ฅ ๐ = … , 0,3, 2, 1, ๐, 1, 2, 3, 0, … ๐ค๐๐กโ ๐ฅ 0 = 0 ๐๐๐๐ . 1 1 2 ) ๐ฆ 0 = ๐ฅ −1 + ๐ฅ 0 + ๐ฅ(1 = 1 + 0 + 1 = 3 3 3 5 ๐ 5 ๐ฆ ๐ = … , 0,1, , 2, 1, , 1, 2, , 1, 0, … 3 ๐ 3 8 Block Diagram Representation of Discrete-Time Systems adder Constant multiplier unit delay element signal multiplier unit advance element 9 Example 3 Sketch the block diagram representation of the discrete-time system described by the input-output relation. 1 1 1 ๐ฆ ๐ = 4 ๐ฆ ๐ − 1 + 2 ๐ฅ ๐ + 2 ๐ฅ(๐ − 1) Solution The output ๐ฆ ๐ is obtained by rearranging the input-output equation: 1 1 ๐ฆ ๐ = ๐ฆ ๐ − 1 + ๐ฅ ๐ + ๐ฅ(๐ − 1) 4 2 10 Causal and non-causal systems A system is causal if its output at any time ๐ depends only on present and past inputs [i.e. ๐ฅ ๐ , ๐ฅ ๐ − 1 , ๐ฅ ๐ − 2 , … ], but does not depend on future inputs [i.e. ๐ฅ ๐ + 1 , ๐ฅ ๐ + 2 , …]. Example 4 Determine whether the systems described below are causal Solution a. Since for ๐ > 0 the output ๐ฆ ๐ depends on the current input ๐ฅ ๐ and its past value ๐ฅ ๐ − 2 the system is causal. b. Since for ๐ > 0 the output ๐ฆ ๐ depends on the current input ๐ฅ ๐ and its future value ๐ฅ ๐ + 1 the system is non-causal. 11 Linear System Time, t Continuous system Sample number, n discrete system 12 Linear Systems: Property 1 A digital system S is linear if and only if it satisfy the superposition principle (Homogeneity and Additivity): Homogeneity: (Deals with amplitude ) If x[n] ๏ y[n], then kx[n] ๏ ky[n] K is a constant 13 Linear Systems: Property 2 Additivily Homogeneity & Additivity (superposition principle) 14 Example 5 (a) Let a digital amplifier, If the inputs are: Outputs will be: If we apply combined input to the system: The output will be: Individual outputs: 2๐ฅ1 ๐ = 2๐ข(๐) X 10 2๐ฆ1 ๐ = 20๐ข(๐) 15 Example 5 (b) ๐ฆ ๐ = ๐ฅ 2 (๐) ๐ฅ ๐ System ๐ฅ1 ๐ = ๐ข(๐) If the input is: System ๐ฆ1 ๐ = ๐ฅ 2 (๐) ๐ฅ2 ๐ = ๐ฟ(๐) System ๐ฆ2 ๐ = ๐ฟ 2 (๐) 4๐ฅ1 ๐ + 2๐ฅ2 (๐) 2 2 Then the output is: ๐ฆ ๐ = ๐ฅ (๐) = (4๐ฅ1 ๐ + 2๐ฅ2 (๐)) 2 = (4๐ข ๐ + 2๐ฟ(๐)) = 16๐ข2 ๐ + 16๐ข ๐ ๐ฟ ๐ +4๐ฟ 2 ๐ = 16๐ข ๐ + 20๐ฟ ๐ . 16 Linear Systems: Property 3 Shift (time) Invariance A system is called time-invariant (or shift-invariant) if its input-output characteristics do not change with time (a shifted input signal will produce a shifted output signal, with the same of shifting amount). 17 Example 6 (a) Given the linear system ๐ฆ ๐ = 2๐ฅ ๐ − 5 , find whether the system is time invariant or not. Solution: ๐ฅ1 ๐ System Let the shifted input be: ๐ฆ1 ๐ = 2๐ฅ1 (๐ − 5) ๐ฅ2 ๐ = ๐ฅ1 ๐ − ๐0 Therefore system output: ๐ฆ2 ๐ = 2๐ฅ2 ๐ − 5 = 2๐ฅ1 (๐ − ๐0 − 5) Shifting ๐ฆ2 ๐ = 2๐ฅ1 (๐ − 5) Equal By ๐0 samples leads to ๐ฆ1 ๐ − ๐0 = 2๐ฅ1 (๐ − 5 − ๐0 ) 18 Example 6 (b) Given the linear system ๐ฆ ๐ = 2๐ฅ 3๐ , find whether the system is time invariant or not. Solution: ๐ฅ1 ๐ ๐ฆ1 ๐ = 2๐ฅ1 (3๐) System Let the shifted input be: ๐ฅ2 ๐ = ๐ฅ1 ๐ − ๐0 Therefore system output: ๐ฆ2 ๐ = 2๐ฅ2 3๐ = 2๐ฅ1 (3๐ − ๐0 ) Shifting ๐ฆ2 ๐ = 2๐ฅ1 (3๐) By ๐0 samples leads to ๐ฆ1 ๐ − ๐0 = 2๐ฅ1 3 ๐ − ๐0 Not Equal = 2๐ฅ1 3๐ − 3๐0 19 Difference Equation A causal, linear, and time invariant system can be represented by a difference equation as follows: Outputs Inputs After rearranging: Finally: 20 Example 7 Identify non zero system coefficients of the following difference equations. 21 System Representation Using Impulse Response A linear time-invariant system (LTI system) can be completely described by its unit-impulse response โ(๐) due to the impulse input ๐ฟ(๐) with zero initial conditions. 22 Example 8 (a) Consider the difference equation with an initial condition ๐ฅ −1 = 0. a. Determine the unit-impulse response โ ๐ . b. Draw the system block diagram. c. Write the output using the obtained impulse response. Solution 23 Example 8 (b) Solution 24 Finite Impulse Response (FIR) system: When the difference equation contains no previous outputs, ( ๐๐ coefficients of ๐ฆ(๐ − ๐) are zero). Infinite Impulse Response (IIR) system: When the difference equation contains previous outputs, ( ๐๐ coefficients of ๐ฆ(๐ − ๐) are not all zero). 25 BIBO Stability BIBO: Bounded In and Bounded Out A stable system is one for which every bounded input produces a bounded output. Let, in the worst case, every input value reaches to maximum value M. Using absolute values of the impulse responses, 26 BIBO Stability To determine whether a system is stable, we apply the following equation: 27 Example 9 Given a linear system given by: Which is described by the unit-impulse response: Determine whether the system is stable or not. Solution 28 Digital Convolution A LTI system can be represented using a digital convolution sum. The unit-impulse response โ(๐) relates the system input and output. To find the output sequence ๐ฆ(๐) for any input sequence ๐ฅ(๐), we use the digital convolution: The sequences are interchangeable. Convolution sum requires h(n) to be reversed and shifted. If h(n) is the given sequence, h(-n) is the reversed sequence. 29 Reversed Sequence Example 10 30 Convolution Using Table Method Example 11 (a) 31 Convolution Using Table Method Example 11 (b) 32 Convolution Properties the order in which two signals are convolved makes no difference 33 Examples of Convolution 34 Low Pass Filters (filter's impulse response) each sample in the output signal being a weighted average of many adjacent points from the input signal. removing high-frequency components The rectangular pulse is best at reducing noise while maintaining edge sharpness. The Exponential is the simplest recursive filter. The sinc function is used to separate one band of frequencies from another. 35 High Pass Filters Typical high-pass filter kernels. These are formed by subtracting the corresponding low-pass filter kernels from a delta function. The distinguishing characteristic of high-pass filter kernels is a spike surrounded by many adjacent negative samples. 36 Signal-to-Noise Ratio (SNR) Signal-to-noise ratio ( SNR) is a measure that compares the level of a desired signal to the level of background noise. It is defined as the ratio of signal power to the noise power, often expressed in decibels. If the variance of the signal and noise are known, and the signal is zero-mean: Because many signals have a very wide dynamic range, SNRs are often expressed using the logarithmic decibel scale. In decibels, the SNR is defined as A logarithmic scale is a nonlinear scale used when there is a large range of quantities. 37 Signal-to-Noise Ratio (SNR) The decibel (dB) is a logarithmic unit used to express the ratio between two values of a physical quantity, often power or intensity. 38 Example 12 Periodicity Consider the following continuous signal for the current which is sampled at 12.5 ms. Will the resulting discrete signal be periodic? 39