Digital Signal Processing Analysis of Discrete time Linear Time -...

13
Digital Signal Processing Module 1 Analysis of Discrete time Linear Time - Invariant Systems Objective: 1. To understand the representation of Discrete time signals 2. To analyze the causality and stability concepts of Linear Shift Invariant (LSI) systems Introduction: Digital signals are discrete in both time (the independent variable) and amplitude (the dependent variable). Signals that are discrete in time but continuous in amplitude are referred to as discrete-time signals. A discrete-time system is one that processes a discrete-time input sequence to produce a discrete-time output sequence. There are many different kinds of such systems. One of the important kinds is Linear Shift Invariant (LSI) systems. Description: Discrete time Signals and Sequences Discrete-time signals are data sequences. A sequence of data is denoted {x[n]} or simply x[n] when the meaning is clear. The elements of the sequence are called samples. The index n associated with each sample is an integer. If appropriate, the range of n will be specified. Quite often, we are interested in identifying the sample where n = 0. This is done by putting an arrow under that sample. For instance, = ,0.35,1,1.5, 0.6, 2, The arrow is often omitted if it is clear from the context which sample is x[0]. Sample values can either be real or complex. The terms discrete-time signalsand sequencesare used interchangeably. The time interval between samples is can be assumed to be normalized to 1 unit of time. So the corresponding normalized sampling frequency is 1Hz. If the actual sampling interval is T seconds, then the sampling frequency is given by = 1 Some Elementary Sequences i) Unit Impulse Sequence The unit impulse sequence is defined by This is depicted graphically in Figure 1.1. Note that while the continuous-time unit impulse function is a mathematical object that cannot be physically realized, the unit impulse sequence can easily be generated.

Transcript of Digital Signal Processing Analysis of Discrete time Linear Time -...

  • Digital Signal Processing

    Module 1

    Analysis of Discrete time Linear Time - Invariant Systems

    Objective:

    1. To understand the representation of Discrete time signals 2. To analyze the causality and stability concepts of Linear Shift Invariant (LSI) systems

    Introduction:

    Digital signals are discrete in both time (the independent variable) and amplitude (the

    dependent variable). Signals that are discrete in time but continuous in amplitude are referred

    to as discrete-time signals.

    A discrete-time system is one that processes a discrete-time input sequence to produce

    a discrete-time output sequence. There are many different kinds of such systems. One of the

    important kinds is Linear Shift Invariant (LSI) systems.

    Description:

    Discrete time Signals and Sequences

    Discrete-time signals are data sequences. A sequence of data is denoted {x[n]} or

    simply x[n] when the meaning is clear. The elements of the sequence are called samples. The

    index n associated with each sample is an integer. If appropriate, the range of n will be

    specified. Quite often, we are interested in identifying the sample where n = 0. This is done

    by putting an arrow under that sample. For instance,

    𝑥 𝑛 = … ,0.35,1,1.5,−0.6,−2,…

    The arrow is often omitted if it is clear from the context which sample is x[0]. Sample values

    can either be real or complex. The terms “discrete-time signals” and “sequences” are used

    interchangeably.

    The time interval between samples is can be assumed to be normalized to 1 unit of time. So

    the corresponding normalized sampling frequency is 1Hz. If the actual sampling interval is T

    seconds, then the sampling frequency is given by 𝑓𝑠 =1

    𝑇

    Some Elementary Sequences

    i) Unit Impulse Sequence The unit impulse sequence is defined by

    This is depicted graphically in Figure 1.1. Note that while the continuous-time unit impulse

    function is a mathematical object that cannot be physically realized, the unit impulse

    sequence can easily be generated.

  • Figure 1.1: The Unit Impulse Sequence

    ii) Unit Step Sequence

    The unit step sequence is one that has amplitude of zero for negative indices and amplitude of

    one for non-negative indices.

    𝑢 𝑛 = 0 𝑛 < 01 𝑛 ≥ 0

    It is shown in Figure 1.2.

    Figure 1.2: The Unit Step Sequence

    iii) Exponential sequences

    The general form is

    If A and α are real numbers then the sequence is real. If 0 < α < 1 and A is

    positive, then the sequence values are positive and decrease with increasing n:

  • iv) Sinusoidal Sequences A sinusoidal sequence has the form

    This function can also be decomposed into its in-phase xi[q] and quadrature xq[n]

    components.

    This is a common practice in communications signal processing. It is shown in Figure 1.3.

    Figure 1.3: The Sinusoidal Sequence

    v) Complex Exponential Sequences

    Complex exponential sequences are essentially complex sinusoids.

    vi) Random Sequences

    The sample values of a random sequence are randomly drawn from a certain probability

    distribution. They are also called stochastic sequences. The two most common

    distributions are the Gaussian (normal) distribution and the uniform distribution. The

    zero-mean Gaussian distribution is often used to model noise. Figure 1.4 and Figure 1.5

    show examples of uniformly distributed and Gaussian distributed random sequences

    respectively.

  • Figure 1.4: Uniformly distributed random sequence with amplitudes between -0.5 and 0.5.

    Figure 1.5: Gaussian distributed random sequence with zero mean and unit variance.

    Types of Sequences

    The discrete-time signals that we encounter can be classified in a number of ways. Some

    basic classifications that are of interest to us are described below.

    i) Real vs. Complex Signals A sequence is considered complex at least one sample is complex-valued.

    ii) Finite vs. Infinite Length Signals Finite length sequences are defined only for a range of indices, say N1 toN2. The

    length of this finite length sequence is given by |N2- N1 + 1|.

    iii) Causal Signals A sequence x[n] is a causal sequence if x[n] = 0 for n < 0.

  • iv) Symmetric Signals First consider a real-valued sequence {x[n]}.

    Even symmetry implies that x[n] = x[-n] and Odd symmetry implies that x[n] = -x[n] for all n.

    Any real-valued sequence can be decomposed into odd and even parts so that

    where the even part is given by

    and the odd part is given by

    A complex-valued sequence is conjugate symmetric if x[n] = x*[-n]. The sequence has

    conjugate anti-symmetry if x[n] = -x*[-n]. Analogous to real-valued sequences, any complex-valued sequence can be decomposed into its conjugate symmetric and conjugate anti-

    symmetric parts:

    v) Periodic Signals

    A discrete-time sequence is periodic with a period of N samples if

    for all integer values of k. Note that N has to be a positive integer.

    If a sequence is not periodic, it is aperiodic or non-periodic.

    Consider a discrete-time sequence x [n] based on a sinusoid with angular frequency ωo:

    If this sequence is periodic with a period of N samples, then the following must be true:

    However, the left hand side can be expressed as

    and the cosine function is periodic with a period of 2π and therefore the right hand side

    of the above equation is given by

    for integer values of r.

    Comparing the above two equations, we have

  • where ωo = 2πfo. Since both r and N are integers, a discrete-time sinusoidal sequence is

    periodic if its frequency is a rational number. Otherwise, it is non-periodic.

    vi) Energy and Power Signals The energy of a finite length sequence x[n] is defined as

    while that for an infinite sequence is

    Note that the energy of an infinite length sequence may not be infinite. A signal with finite

    energy is usually referred to as an energy signal.

    The average power of a periodic sequence with a period of N samples is defined as

    and for non-periodic sequences, it is defined in terms of the following limit if it exists:

    A signal with finite average power is called a power signal.

    vii) Bounded Signals A sequence is bounded if every sample of the sequence has a magnitude which is less than or

    equal to a finite positive value. That is,

    viii) Summable Signals A sequence is absolutely summable if the sum of the absolute value of all its samples is finite.

  • A sequence is square summable if the sum of the magnitude squared of all its samples is

    finite.

    Classification of Systems

    Discrete-time systems, like continuous-time systems, can be classified in a variety of

    ways.

    i) Linearity A linear system is one which obeys the superposition principle. For a certain system, let the outputs corresponding to inputs x1[n] and x2[n] are y1[n]

    and y2[n] respectively. Now if the input is given by

    where A and B are arbitrary constants, then the system is linear if its corresponding output is

    Superposition is a very nice property which makes analysis much simpler. Linearization is a

    very useful approach to analyzing nonlinear systems.

    ii) Shift Invariance A shift (or time) invariant system is one that does not change with time. Let a system

    response to an input x[n] be y[n]. If the input is now shifted by n0 (an integer) samples,

    then the system is shift invariant if its response to x1[n] is

    We can use the terms linear time-invariant (LTI) and linear shift-invariant interchangeably.

    iii) Causality The response of a causal system at any time depends only on the input at the current and past

    instants, not on any future samples. In other words, the output sample y[no] for any no only

    depends on x[n] for n ≤ n0.

    iv) Stability There are two common criteria for system stability. They are exponential stability and

    bounded-input bounded-output (BIBO) stability. It requires the response of the system to

    decay exponentially fast for a finite duration input. The second one merely requires that the

    output be a bounded sequence if the input is a bounded sequence.

    Linear Shift-Invariant Systems

    A discrete-time LTI system, now called as LSI system, like its continuous-time

    counterpart, is completely characterized by its impulse response. In other words, the impulse

    response tells us everything we need to know about an LSI system as far as signal processing

  • is concerned. The impulse response is simply the observed system output when the input is an

    impulse sequence. The output of the LSI system is using Convolution sum.

    Condition for Stability

    Since the impulse response completely characterizes an LSI system, we draw conclusions

    regarding the stability of a system based on its impulse response.

    Theorem 1.1.

    An LSI system is BIBO stable if its impulse response is absolutely summable.

    Proof: Let the input be bounded, i.e. |x[n]| < B < 1 for some finite value B. The magnitude of the

    output is given by

    So the magnitude of y[n] is bounded if is finite. In other words, the impulse

    response must be absolutely summable.

    Condition for Causality

    Theorem 1.2.

    An LSI system is causal if and only if its impulse response is a causal sequence.

    Proof. Consider an LSI system with impulse response h[k]. Two different inputs x1[n] and x2[n] are

    the same up to a certain point in time, that is x1[n] = x2[n] for n ≤ n0 for some no. The outputs

    y1[n] and y2[n] at n = no are given by

  • and

    Since x1[n] = x2[n] for n ≤ no, if the system is causal, then the outputs y1[n] and y2[n] must be

    the same for n ≤ no. More specifically, y1[no] = y2[no]. Now,

    because for non-negative values of k. Since x1[n] may not be

    equal to x2[n] for n > no, we must have

    which means that h[k] = 0 for k < 0.

    Illustrative Examples:

    Problem 1: Check whether the system defined by y(n) = x2(n) is shift-invariant.

    Solution:

    If y(n) = x2(n) is the response of the system to x(n), the response of the system to

    x'(n) = x(n - no) is

    Because y'(n) = y(n - no), the system is shift-invariant.

    Problem 2: Check whether the systems described by the equations

    i) y(n) = x(n) +x(n - 1 ) ii) y(n) = x(n) + x(n+1)

    Solution:

    i) y (n) = x(n) +x(n - 1 ) is causal because the value of the output at any time n = no depends only on the input x(n) at time no and at time no - 1.

    ii) y(n) = x(n) + x(n+1) is noncausal because the output at time n = no depends on the value of the input at time no + 1.

  • Problem 3: An LSI system with unit sample response h(n) = anu(n) will be stable whenever

    |a| < 1. Justify.

    Solution:

    We have learnt that the magnitude of y[n] is bounded if is finite i.e., the

    impulse response must be absolutely summable.

    Hence, the impulse response is absolutely summable only when |a| < 1

    Problem 4: Prove that the system described by the equation y(n) = n x(n) is not BIBO stable.

    Solution:

    Assume that the input signal is a unit step signal x(n) = u(n) which is bounded.

    𝑢 𝑛 = 0 𝑛 < 01 𝑛 ≥ 0

    But the response to a unit step is y(n) = n u(n), which is unbounded as n increases

    Hence the system is not BIBO stable.

    Problem 5: Find the response of the system with impulse response h(n) = u(n) for the input

    x(n)=anu(n).

    Solution:

    With the direct evaluation of the convolution sum we find the response of the system

    Because u(k) is equal to zero for k < 0 and u(n - k) is equal to zero for k > n, when n < 0,

    there are no nonzero terms in the sum and y(n) = 0. On the other hand, if n ≥ 0,

    Since

    Therefore,

    Summary:

    Discrete-time signals are essentially a sequence of numbers. Some fundamental

    sequences, such as the unit impulse, unit step and sinusoidal (both real and complex)

    sequences are examined because more complex sequences can be expressed as a combination

    of some or all of these fundamental ones.

    The most important discrete-time systems are the linear shift invariant (LSI) systems.

    For these systems, the superposition principle applies which leads to the linear convolution

    sum. This convolution sum is the way by which we derive the output of the system given an

  • input. An LSI system is completely characterized by its impulse response. All the properties

    of such a system is revealed by its impulse response, including causality and BIBO stability.

    Assignment:

    Problem 1: Check whether the system described by the equation is shift- varying

    y(n)=x(n)+x(-n)

    Problem 2: The input x[n] and output y[n] of a system are linked by the relation

    y[n] = T{x[n]} = x[- n].

    Answer the following questions, giving reasons: a) Is the system linear? (b) Is the system

    time invariant? c) Is the system causal?

    Problem 3: Determine which of the following systems are stable:

    a) y(n) = ex(n)

    / x(n - 1)

    b) y(n)=cos(x(n))

    Problem 4: A linear shift-invariant system has a unit sample response h(n)=u(-n-1)

    Find the output if the input is x(n) =3nu(-n)

    Problem 5: The input to a linear shift-invariant system is the unit step, x(n) = u(n), and the

    response is y(n) = δ(n). Find the unit sample response of this system.

    Simulation:

    Convolution is a formal mathematical operation, just as multiplication, addition, and

    integration. Addition takes two numbers and produces a third number, while convolution

    takes two signals and produces a third signal. Convolution is used in the mathematics of

    many fields, such as probability and statistics.

    A convolution of two functions is denoted with the operator “ *”, and is written as

    Convolution Sum (Discrete functions)

    Program:

    clc; clear all; close all;

    x=input('Enter the input'); %Taking input1 from the user h=input('Enter the impulse response'); %Taking input2 from the user

    l=length(x); %Finding lengths m=length(h);

    subplot(3,1,1); %plotting the input sequences stem(0:l-1,x);

  • xlabel('n---->'); ylabel('x(n)--->'); title('Input sequence'); subplot(3,1,2); stem(0:m-1,h); xlabel('n---->'); ylabel('h(n)--->'); title('Impulse response sequence'); %convolution logic y=[]; for n=2:l+m y1=0; for k=1:max(l,m) if l>=m && n-k>0 && n-kl && n-k>0 && n-k

  • References:

    1. Digital Signal Processing, Principles, Algorithms and Applications – John G Proakis, Dimitris G Manolakis,

    Pearson Education / PHI, 2007

    2. Discrete Time Signal Processing – A V Oppenheim and R W Schaffer, PHI, 2009

    3. Digital Signal Processing – Monson H.Hayes – Schaum’s Outlines, McGraw-Hill,1999

    4. Fundamentals of Digital Signal Processing using Matlab – Robert J Schilling, Sandra L Harris, Thomson

    2007.

    5. Digital Signal processing – A Practical Approach, Emmanuel C Ifeachor and Barrie W Jervis, 2nd

    Edition, PE

    2009

    6. Digital Signal Processing – A Computer Based Approach, Sanjit K.Mitra, McGraw Hill,2nd

    Edition, 2001