Digital signal processing...1 Digital signal processing Digital signal processing (DSP) is concerned...

59
1 Digital signal processing Digital signal processing (DSP) is concerned with the representation of signals by a sequence of numbers or symbols and the processing of these signals. Digital signal processing and analog signal processing are subfields of signal processing. DSP includes subfields like: audio and speech signal processing, sonar and radar signal processing, sensor array processing, spectral estimation, statistical signal processing, digital image processing, signal processing for communications, control of systems, biomedical signal processing, seismic data processing, etc The goal of DSP is usually to measure, filter and/or compress continuous real-world analog signals. The first step is usually to convert the signal from an analog to a digital form, by sampling it using an analog-to-digital converter (ADC), which turns the analog signal into a stream of numbers. However, often, the required output signal is another analog output signal, which requires a digital-to-analog converter (DAC). A signal : is a function of asset of independent variable, with being perhaps the most prevalent signal variation. The signal itself carries some kind of information available for observation. Processing: Means operation in some faction on a signal to extract some useful information. Digital: means that the processing is done with a digital computer or special purpose digital hardware.

Transcript of Digital signal processing...1 Digital signal processing Digital signal processing (DSP) is concerned...

  • 1

    Digital signal processing Digital signal processing (DSP) is concerned with the representation of

    signals by a sequence of numbers or symbols and the processing of these

    signals. Digital signal processing and analog signal processing are subfields

    of signal processing. DSP includes subfields like: audio and speech signal

    processing, sonar and radar signal processing, sensor array processing,

    spectral estimation, statistical signal processing, digital image processing,

    signal processing for communications, control of systems, biomedical signal

    processing, seismic data processing, etc

    The goal of DSP is usually to measure, filter and/or compress continuous

    real-world analog signals. The first step is usually to convert the signal from

    an analog to a digital form, by sampling it using an analog-to-digital

    converter (ADC), which turns the analog signal into a stream of numbers.

    However, often, the required output signal is another analog output signal,

    which requires a digital-to-analog converter (DAC).

    A signal : is a function of asset of independent variable, with being perhaps the most prevalent signal variation. The signal itself carries some

    kind of information available for observation.

    Processing: Means operation in some faction on a signal to extract some useful information.

    Digital: means that the processing is done with a digital computer or special

    purpose digital hardware.

  • 2

    We deal mostly with discrete time signals and systems, which are analyzed

    in both the time and the frequency domains. The analysis and design of

    processing structures called filters and spectrum analyzers is one of the most

    important aspects of DSP.

    signal processing: is an area of electrical engineering and applied mathematics that deals with

    operations on or analysis of signals, in either discrete or continuous time, to

    perform useful operations on those signals. Signals of interest can include

    sound, images, time-varying measurement values and sensor data, for

    example biological data such as electrocardiograms, control system signals,

    telecommunication transmission signals such as radio signals, and many

    others. Signals are analog or digital electrical representations of time-

    varying or spatial-varying physical quantities. In the context of signal

    processing, arbitrary binary data streams and on-off signalling are not

    considered as signals, but only analog and digital signals that are

    representations of analog physical quantities.

    However, one needs to convert analog signals into a form suitable for digital

    hardware. This form of the signal is called a digital signal. It takes one of the

    finite number of values at specific instances in time, and hence it can be

    represented by binary numbers, or bits. The processing of digital signals is

    called DSP; in block diagram form it is represented by

  • 3

    where the various block elements are discussed below.

    PrF: This is a prefilter or an antaliasing filter, which conditions the analog

    signal to prevent aliasing.

    ADC: This is called an analog-to-digital converter, which produces a stream

    of binary numbers from analog signals.

    Digital signal processor: This is the heart of DSP and can represent a

    neural-purpose computer or a special-purpose processor, or digital hardware,

    and so on.

    DAC: This is the inverse operation to the ADC, called a digital-to-analog

    converter, which produces a staircase waveform from a sequence of binary

    numbers, a first step towards producing an analog signal.

    PoF: This is a post filter to smooth out staircase waveform into the desired

    analog signal.

    Advantages of DSP 1. allows more complex processing than is possible with analog circuitry.

    2. provides better signal quality and repeatable performance because of the

    digital processing.

    3. is more flexible since the digital processing can often be easi1y modified

    (e.g. software can be up-graded)

    4. usually results in a lower cost for equivalent performance.

  • 4

    The principal disadvantage of DSP 1. limited to signal with relatively low bandwidth.

    2. the point at which DSP becomes too expensive will depend on the

    application and the current state of conversion and digital processing

    technology.

    3. the need for an ADC and DAC makes DSP uneconomical for simple

    applications (e-g a simple filters)

    4. higher power consumption and size of a DSP implementation can make it

    unsuitable for simple very low-power or small size applications

    Applications 1. digital sound recording such as CD and DAT.

    2. speech and compression for telecommunication and storage .

    3. implementation of wire line and radio modems (including digital filtering

    modulation, echo cancellation and other functions).

    4. image enhancement and compression.

    The Sampling Theorem also known as Shannon’s Sampling Theorem, states that a signal can be

    exactly reconstructed from its samples if the sampling frequency is greater

    than twice the highest frequency of the signal; but requires an infinite

    number of samples . In practice, the sampling frequency is often

    significantly more than twice that required by the signal's limited bandwidth.

    A typical digital signal processing system contains a low-pass analog filter,

    often called pre-sampling filter, to ensure that the highest frequency allowed

    into the system, will be equal or less the sampling rate so that the signal can

  • 5

    be recovered. The highest frequency allowed by the pre-sampling filter is

    referred to as the Nyquist frequency.

    If a signal is not band-limited, or if the sampling rate is too low, the spectral

    components of the signal will overlap each another and this condition is

    called aliasing. To avoid aliasing, we must increase the sampling rate.

    we will adopt the following notations:

    N = number of samples in time or frequency period.

    fs = sampling frequency = samples per second

    Tt = period of a periodic discrete time function

    tt = interval between the N samples in time period Tt

    Tf = period of a periodic discrete frequency function

    tf = interval between the N samples in frequency period Tf

    we have the relations:

    Example :

    The period of a periodic discrete time function is 0.125 millisecond, and it is

    sampled at 1024 equally spaced points. It is assumed that with this number

    of samples, the sampling theorem is satisfied and thus there will be no

    aliasing.

    a. Compute the period of the frequency spectrum in KHz

    b. Compute the interval between frequency components in KHz.

    c. Compute the sampling frequency fs

    d. Compute the Nyquist frequency

    Solution:

  • 6

    Intervals between samples and periods in discrete time and frequency

    domains Tt = 0.125 ms and N = 1024 point . Therefore, the time between

    successive time components is

    a. the period Tf of the frequency spectrum is

  • 7

    b. the interval ft between frequency components is

    C. the sampling frequency fs is

    d. the Nyquist frequency must be equal or less than half the sampling

    frequency, that is,

    DISCRETE-TIME SIGNALS Signals are broadly classified into analog and discrete signals. An analog

    signal will be denoted by x(t), in which the variable t can represent any

    physical quantity, but we will assume that it represents time in seconds. A

    discrete signal will be denoted by x (n),in which the variable n is integer

    valued and represents discrete instances in time. Therefore it is also called a

    discrete time signal, which is a number sequence and will be denoted by one

    of the following notations:

    where the up-arrow indicates the sample at n = 0.

  • 8

    Example: X(n)=[1 0 2 -1.5 3+j4 -2.5-j1.025 ]

    Example:

    X(n)=

    otherwiseonn

    ................22..........5.0

    n x(n)

    -2 0.25

    -1 0.5

    0 1 x(n)=[0.25 0.5 1 2 4]

    1 2

    2 4

    3 0

    4 0

    Example:(period function):

    X(n)=[…….. 1 -1 2 1 -1 2 1 -1 2 1 -1 2 ……]

    P=3 :period :min. integrate that satisfies x(n)=x(n+p)

    x(n)=[……. 2 2 1 2 2 1 2 2 1 -1 2 2 1 2 2 1 2 2 1 -1 2 2 1……]

    p=10

    x(n)=[……1 2 1 1 2 1 3 1 2 1 1 2 1 1 2 1 …….] not period

  • 9

    Continuous/Discrete-Time Signals In this section, we introduce several elementary signals which not only occur

    frequently in nature, but also serve as building blocks for constructing many

    other signals.

    Some continuous–time and discrete–time signals

  • 10

    TYPES OF SEQUENCES 1a- The unit step function us(t) 1b- Unit step sequence

    1c-A delayed and scaled step function 1d-A delayed and scaled step sequence

    • The unit step function offers a convenient method of describing the sudden

    application of a voltage or current source.

    2a- Unit impulse function 2b-Unit sample or impulse sequence

    2c-A delayed and scaled impulse function 2d-A delayed and scaled impulse sequence

    • The unit impulse or delta function, denoted as δ(t) , is the derivative of the

    unit step u0(t) . It is also defined as

    And

  • 11

    • The shifting property of the delta function states that

    • The sampling property of the doublet function δ'(t) states that

    *Relationship between δ(t) and us (t) *Relationship between δ[n] and us [n]

    3- The Unit Ramp Function u1(t)

    we define u1(t) as

    Since u1(t) is the integral of u0(t) , then u0(t) must be the derivative of u1(t)

  • 12

    Higher order functions of t can be generated by repeated integration of the

    unit step function. For example, integrating u0(t) twice and multiplying by

    2, we define u2(t) as:

    The Unit Step Function u0(t)

    is defined as: Waveform for uo(t):

    (At t = to) Waveform for uo(t-to)

    (At t = -to) Waveform for uo(t+to)

  • 13

    Other forms of the unit step function are shown in Figure:

    A rectangular pulse expressed as the sum of two unit step functions

    the pulse of Figure (a) is the sum of the unit step functions of Figures (b) and

    (c) is represented as u0(t) – u0(t–1)

  • 14

    example: x(n)=u(n+2)-u(n-3)

    n x(n)

    -3 0 u(n+2)

    -2 1 - u(n-3)

    -1 1 = u(n+2)-u(n-3)

    0 1

    1 1

    2 1

    3 0

    Ex: u(n+5)-u(n+2)+2u(n)-3u(n-3)+u(n-5)

  • 15

    Example

    Express the square waveform of Figure as a sum of unit step

    functions. The vertical dotted lines indicate the discontinuities at T,

    2T, 3T and so on.

    Solution:

  • 16

    Systems A system is a plant or a process that produces a response called an output in response to an excitation called an input. If a system’s input and output signals are scalars, the system is called a single-input single-output (SISO) system. If a system’s input and output signals are vectors, the system is called a multiple-input multiple-output (MIMO) system. A single-input multiple-output (SIMO) system and a multiple-input single-output (MISO) system can also be defined in a similar way. For example, is an electric circuit whose inputs are voltage/current sources and whose outputs are voltages/currents/charges in the circuit.

    A description of continuous–time and discrete–time systems

    DISCRETE SYSTEMS Mathematically, a discrete time system (or discrete system for short) is

    described as an operator T[.] that takes a sequence x(n) (called excitation)

    and transforms it into another sequence y(n) (called response). That is,

    In DSP we will say that the system processes an input signal into an output

    signal. Discrete systems are broadly classified into linear and nonlinear

    systems. We will deal mostly with linear systems.

  • 17

    LINEAR SYSTEMS A discrete system T[. ] is a linear operator L[. ] if and only if L[.] satisfies

    the principle of superposition, namely,

    the output y(n) of a linear system to an arbitrary input x(n) is given by

    The response L [ (n - k)] can be interpreted as the response of a linear

    system at time n due to a unit sample (a well-known sequence) at time k. It

    is called an impulse response and is denoted by h(n ,k). The output then is

    given by the superposition summation

    Linear time-invariant (LTI) system:

    A system is said to be time/shift-invariant if a delay/shift in the input causes

    only the same amount of delay/shift in the output without causing any

    hanged of the characteristics (shape) of the output. Time/shift-invariance can

    be expressed as follows:

    Then the time-varying function h (n,k ) becomes a time-invariant function h

    (n - k), and the output is given by

  • 18

    The impulse response of a LTI system is given by h(n). The mathematical

    operation is called a linear convolution sum and is denoted by:

    Stability: This is a very important concept in linear system theory. The primary reason

    for considering stability is to avoid building harmful systems or to avoid

    burnout or saturation in the system operation. A system is said to be

    bounded-input bounded-output (BIBO) stable if every bounded input

    produces a bounded output.

    An LTI system is BIBO stable if and only if its impulse response is

    absolutely summable.

    Causality:

    This important concept is necessary to make sure that systems can be built.

    A system is said to be causal if the output at index 0n depends only on the

    input up to and including the index 0n ; that is, the output does not depend on

    the future values of the input. An LTI system is causal if and only if the

    impulse response:

  • 19

    Ex: Linearity of the 3-sample averager .The transformation produced by the

    3-sample averager is given by

    y(n) =1\3[x(n + 1) + x(n) + x(n - 1)]= L{x(n)}

    sol:

    L{ax1(n) + bx2(n)) }=

    =1\3[ax1(n + 1) + bx2(n + 1) + ax1(n) + bx2(n)+ ax1(n - 1) + bx2(n - 1)]

    =a/3[x1(n+ 1) + x1(n) + x1(n- 1)]+ b/3[x2(n + 1) + x2(n) + x2(n - 1)]

    = a{y1(n)} + b{y2(n)} its linear system

    Example: A nonlinear system. Let us consider a square-law device, in which

    the output is the square of the input: {y(n)} =L{x(n))= {x^2(n)}

    Sol:

    L{ax1(n)+bx2(n)}=[ax1(n)+bx2(n)]^2=a^2x1^2(n)+b^2x2^2(n)+2abx1(n)x

    2(n)

    which is not equal to ax1^2(n)+bx2^2(n), the output required for the system

    to be linear, hence , the square-law device is a nonlinear system.

  • 20

    CONVOLUTION EXAMPLE: Let the rectangular pulse x(n) = u(n) - u(n - 10) be an input to

    an LTI system with impulse response u(n) (0.9) h(n)n ,Determine the output

    y(n).

    Sol.:

    There are three different conditions under which u(n - k) can be evaluated.

    CASE 1 : n < 0 Then u(n - k) = 0, 90 K .

    In this case the nonzero values of x(n) and h(n) do not overlap.

    CASE 2 : 90 n : Then u(n - k) = 1, nK 0

  • 21

    In this case the impulse response h(n) partially overlaps the input x(n).

    CASE 3 : 9n : Then u(n - k) = 1, 90 K

    In this last case h(n) completely overlaps x ( n ) .

    EXAMPLE : Given the following two sequences

    determine the convolution

    Sol.:

  • 22

    the beginning point (first nonzero sample) of y(n) is given by

    n = -3 + (-1) = -4, while the end point (the last nonzero sample) is given by

    n = 3 + 4 = 7. The complete output is given by

    Note that the resulting sequence y (n) has a longer length than both the x (n)

    and h (n) sequences.

  • 23

    A digital filter: A digital filter is a numerical procedure, or algorithm that transforms a given

    sequence of numbers into a second sequence that has some more desirable

    properties, such as less noise or distortion.

    n: an index typically, the set of index values consists of consecutive integers,

    which in same cases may take values from minus infinity to plus infinity.

    A digital filter consists of the interconnection of three simple elements:

    1- adders

    2-multiplier

    3-positive and negative delay

    A positive delay : is implemented by a memory register that stores the

    current value of a sequence for one sample interval, thus making it available

    for future calculations.

    A negative delay: (advance) is used to look ahead to the next value in the

    sequence.

    1Z 1Z 1Z

    Z

  • 24

    A digital filter design involves selecting and interconnecting a finite number

    of these elements and determining the multiplier coefficient values.

    Example : Digital filter used as a three-sample averager. consider the

    relationship between the values of the output sequence at time n, denoted by

    y(n), and the values of the input sequence, x(n-1), x(n) and x(n + 1), given

    by y(n) =1/3x(n + 1) + 1/3x(n) + 1/3x(n - I) As shown in Fig.

    Non recursive digital filter that acts as a three-sample averager (a second-

    order).

    Order: denoted the minimum number of delay.

    Non recursive: when the filter output is a function of only the input

    sequence.

    Recursive filter: when the out put is also a function of the previous output

    values.

    Example : First-order recursive filter. Consider the relationship between the input and output sequence values given by Y(n): aY(n - 1) + x(n) where a is a constant. As shown in Fig. the current value of the output is equal to the sum of the input and a times the value of the previous output. Since only one delay is necessary, this is a first-order filter.

  • 25

    Not : both positive and negative delay can de applied to the input sequence,

    only positive delays can be applied to the output sequence.

    Example : unit-sample response of the 3-sample averager.

    Let y(n)= 1/3x(n + 1) + 1/3x(n)+ 1/3x(n-1)

    To find the unit-sample response {h(n,0)}, we set {x(n)} = {d(n)} and solve

    for :

    For n= -2, y(-2)=1/3d(-1)+1/3d (-2)+1/3d(-3)=0.

    For n -2, y(n)=0, since d(n):0 for n 1 , y (n) = 0, since the nonzero value of {d(n)} has moved out of the

    memory of this filter. Since {d(n)} is the input, the output is defined to be

    {h(n,0)}. Hence

    h(n)=

    otherwiseonfor

    ..................11............3/1

    The unit-sample response is computed by stating at a point in time, n, for

    which all the previous inputs and the contends of the delays and advances

    are all equal to zero. This state of the filter is known as the zero initial

    condition.

  • 26

    Example: unit-sample response of a first-order recursive filter. Let

    To find {h(n,0)}, we let {x(n)}= {d(n)} and apply the zero initial condition.

    For n < 0, y(n)=0, because d(n) is zero, for n

  • 27

    impulse-response of the system

    one:-finite impulse response FIR

    Y(n) = 3x(n) + 2x(n-1) - 4x(n-3) x(n) unit-sample

    n x(n) y(n) if n ≤ -1 then y(n)=0

    0 1 3 h(n)=[3 2 0 -4]

    1 0 2 x(n) y(n)

    2 0 0 x(n-1) 3

    3 0 -4

    4 0 0 x(n-2) 2

    5 0 0

    its characteristic : x(n-3)

    1-finte response -4

    2-no feed back

    3-stable all the time

    4-all zero system

    Two:- infinite impulse response IIR

    Y(n)=x(n)-2x(n-1)+y(n-1) ,y(-1)=0, y(0)=1, y(1)=0

    n x(n) y(n) x(n) y(n) 0 1 1 x(n-1) 1 0 -1 2 0 -1 3 0 -1 4 0 -1 -2 y(n-1) 5 0 -1 h(n)=[1 -1 -1 -1 -1 …..]

    Element of h(n) is infinite because the feed back y(n-1)

    ×

    × 1Z

    1Z

    1Z

    ×

    1Z

    1Z ×

  • 28

    its characteristic :

    1-infinte response

    2-have feed back

    3-generaly unstable

    4-have no zero system

    Example: y(n) = x(n)-x(n-1)-2y(n-1)+y(n-2), y(-1)=1, y(-2)=-1

    x(n) y(n) x(n)=[3 1 -1]

    y(n-1)

    x(n-1) -2 y(n-2)

    -1

    n x(n) y(n)

    0 3 0 y(0)=x(0)-x(-1)-2y(-1)+y(-2)=3-0-2-1=0

    1 1 -1 y(1)=x(1)-x(o)-2y(0)+y(-1)=1-3-0+1=1

    2 -1 0 y(2)=x(2)-x(1)-2y(1)+y(0)=0

    3 0 0

    4 0 0

    THE STEP RESPONSE:

    just as the unit step function u[n]is the running sum of the unit impulse (n)

    so the step response of a LTI processor is the running sum of its impulse

    response. Therefore if we denote the step response by s[n] , we have:

    h[n] is the first-order difference of s[n]:

    h[n] = s[n] - s[n -1]

    ×

    1Z

    1Z

    1Z

    ×

  • 29

    example: find and sketch the first few sample value of the impulse and step

    responses of the system y[n] = 0.8 y[n -1] + x[n] also determine the final

    value of s(n) as - ∞.

    Solution:

    y[n] =0.8 y[n -1] + x[n]

    Its impulse response is therefore given by:

    h[n] = 0.8 h[n-1] + (n)

    h[0] =1,

    h[1] = o.8

    h[2] = 0.8^2=0.64

    h[3]=0.8^3=0.512

    the step response equals the running sum of h[n]

    s[0] = h[0] = 1, s[1] =h[0] + h[1]=1.8 ,

    s[2] = h[0] + h[1] + h[2]= s[1] + h[2] = 2.44

    s[3] =s[2]+h[3]=2.952, s[4] = s[3] + h[4] = 3.3616 and so on.

    s[∞] = 1 + 0.8 + 0.8^2 + 0.8^3 + ... = 1/1-0.8=5

  • 30

    The Discrete Fourier Transform (DFT) we will denote a discrete time signal as x[n] , and its discrete frequency

    transform as X[m] .

    Where N represents the number of points that are equally spaced in the

    interval 0 to 2π

    For m = 0,1,2,…….,N-1. the N-point DFT of X[m]

    The Inverse DFT is defined as

    For n = 0,1,2,….,N-1

    In general, the discrete frequency transform X[m] is complex, and thus we

    can express it as:

    X[m] = Re{X [m]}+ Im{X [m]}

    For m = 0,1,2,…,N-1

  • 31

    For n = 0, X[m] = x[0] ,

    Example : A discrete time signal is defined by the sequence x[0] = 1, x[1] =

    2, x[2] = 2, and x[3] = 1 and x[n] = 0 for all other . Compute the frequency

    components X[m]

    Solution:

    Since we are given four discrete values of x[n], we will use a -point DFT,

    that is, for this example, N=4

    N = 0,1, 2, 3

    For m = 0,1, 2, 3

    m=0 Re{X [0]}=1+2⋅ (1) +2⋅ (1) +1⋅ (1)=6

  • 32

    m=1 Re{X [1]}=1+2⋅ (0) +2⋅ (–1) +1⋅ (0)=-1

    m=2 Re{X [2]}=1+2⋅ (–1) +2⋅ (1) +1⋅ (–1)=0

    m=3 Re{X [3]}=1+2⋅ (0) +2⋅ (–1) +1⋅ (0)= -1

    M = 1, 2, 3

    m=0 Im{X [0]}=–2 ⋅ (0)–2 ⋅ (0)–1 ⋅ (0)=0

    m=1 Im{X [1]}=–2 ⋅ (1)–2 ⋅ (0)–1 ⋅ (–1)= –1

    m=2 Im{X [2]}=–2 ⋅ (0)–2 ⋅ (0)–1 ⋅ (0)=0

    m=3 Im{X [3]}=–2 ⋅ (–1)–2 ⋅ (0)–1 ⋅ (1)=1

    The discrete frequency components X[m] for m = 1, 2, 3 are found by

    addition of the real and imaginary components XRe[i] and XIm[i]

    X[0]=6+j0=6

    X[1] = – 1 – j

    X[2]=0+j0=0

    X[3] = – 1 + j

  • 33

    Example : Use the Inverse DFT, and the results of Example above to

    compute the values of the discrete time sequence x[n].

    sol.: we will use a 4 -point DFT, that is, for this example, N=4 for m= 0, 1,

    2, and 3 reduces to:

    The discrete frequency components x[n] for n = 0, 1, 2, 3 are,

  • 34

    Even and Odd Properties of the DFT

    Even Time Function f[N – n] = f [n]

    Odd Time Function f[N – n] = –f [n]

    Even Frequency Function F[N – m] = F[m]

    Odd Frequency Function F[N – m] = –F[m]

  • 35

    Properties and Theorems of the DFT

    X[m] = D{x[n]}

    x[n] 1D = {X[m]}

    1. Linearity ax1[n]+bx2[n]+… aX1[m]+bX2[m]+…

    where x1[n] X1[m] , x2[n] X2[m] , and a and b are arbitrary

    constants.

    2. Time Shift

    x[n – k] WN kmN X[m] ,

    3. Frequency Shift

    4. Time Convolution

    4. Frequency Convolution

  • 36

    The Fast Fourier Transform (FFT)

    The DFT introduced earlier is the only transform that is discrete in both the

    time and the frequency domains, and is defined for finite-duration

    sequences. Although it is a computable transform, the straightforward

    implementation is very inefficient, especially when the sequence length N is

    large.

    This led to the explosion of applications of the DFT, including in the digital

    signal processing area. Furthermore, it also led to the development of other

    efficient algorithms. All these efficient algorithms are collectively known as

    fast Fourier transform (FFT) algorithms.

    Consider an N-point sequence x(n). Its N-point DFT is given by:

    a. Decimation in Time

    If the DFT algorithm is developed in terms of the direct DFT , it is referred

    to as decimation in time,

    ,

    b. Decimation in Frequency

    If the DFT algorithm is developed in terms of the Inverse DFT, it is

    referred to as decimation in frequency.

    ,

  • 37

    Some additional properties of NW are given below.

    Example:

    Find the FFT for x(n)=[1 -1 0 2 1 3 -1 1]

    Solution:

  • 38

    n nW8 nW4 nW2

    0 1 1 1 n=0 , 1202

    2

    eW n

    1 2

    12

    1 j -j -1 n=3 , jeW

    4323

    4

    2 -j -1 1 n=6 , 1202

    2

    eW n

    3 2

    121 j j -1

    4 -1 1 1

    5 2

    121 j -j -1

    6 j -1 1

    7 2

    12

    1 j j -1 X(K)=[6 _ 3+J _ -4 _ 3-J _ ]

    x(0) 1 2 1 6 X(0)

    02W 0

    4W 0

    8W

    x(4) 1 12W 0 14W -j

    18W X(1)

    x(2) 0 -1 24W 3 3+j X(2)

    22W

    x(6) -1 32W 1 3

    4W j X(3)

    x(1) -1 2 5

    42W

    x(5) 3 52W -4 -4-j

    x(3) 2 3 -1

    62W

    x(7) 1 72W 1 -4+j

  • 39

    Decimation-in-tame FFT structure for N = 8

    The Inverse Fast Fourier Transform (IFFT)

    Ex: x(n)= [1 -1 2 1 ]

    FFT

    n bin. Inv. Ord. n nW4 nW2

    0 00 00 0 0 1 1

    1 01 10 2 1 -j -1

    2 10 01 1 2 -1 1

    3 11 11 3 3 j -1

  • 40

    x(0) 1 3 1 3

    02W

    x(2) 2 12W -1 -j -1+j2

    x(1) -1 0 -1 3

    22W

    x(3) 1 32W -2 j -1-j2

    X(K)=[3 -1+j2 3 -1-j2 ]

    IFFT

    n nW 4 nW 2

    0 1 1

    1 j -1

    2 -1 1

    3 -j -1

    X(0) 3 6 1 4

    X(2) 3 0 j -4

    X(1) -1+J2 -2 -1 8

    X(3) -1-J2 J4 -j 4

    x(n)=1/4[4 -4 8 4 ]

  • 41

    The Z Transform The Z transform performs the transformation from the domain of discrete

    time signals, to another domain which we call z – domain, The Z transform

    yields a frequency domain description for discrete time signals, and forms

    the basis for the design of digital systems, such as digital filters.

    The z-transform of a discrete-time signal x(n) is defined by:

    Where z = jre is a complex variable. The values of z for which the sum

    converges define a region in the z-plane referred to as the region of

    convergence (ROC).

    If x (n) has a z-transform X (z), we write

    Because the z-transform is a function of a complex variable, it is convenient

    to describe it using the complex z-plane. With z = Re (z) + j Im (z) = jre

    The contour corresponding to z = 1 is a circle of unit radius referred to as

    the unit circle.

    At z = l (ω = 0),

    z = j (ω = π/2),

    z = - 1 ( ),

    We obtain the values of X (je ) for 0 , the unit circle must be

    within the region of convergence of X (z).

  • 42

    The unit circle in the complex z-plane.

    EXAMPLE: Let us find the z-transform of the sequence x (n) = n u (n).

    Using the definition of the z-transform and the geometric series given in

    Table, we have

  • 43

    The regions of convergence and divergence for the sequence are shown in

    Figure

    Example:

    Find the Z transform of the discrete unit step function u0 [n] shown in Figure

    Solution:

  • 44

    Example: Let us find the z-transform of the sequence x (n) = - n u (-n - 1). Proceeding as in the previous example. We have

    1

    0

    11

    11

    )()()(

    z

    zzznxzX nnn

    nnn

    Example: Find the z-transform of x (n) = n)21( u (n) -

    n2 u (-n - l),

    We know that the z-transform of xl (n) = n)21( u (n) is

    And the z-transform of x2(n) = - n2 u (-n - 1) is

    Therefore, the z-transform of x (n) = x1 (n) + x2(n) is

  • 45

    Common z-transform Pairs

    PROPERTIES

    1 – Linearity

    The z-transform is a linear operator. Therefore, if x (n) has a z-transform

    X (z) , and if y(n) has a z-transform Y (z) .

    2- Shifting Property

    Shifting a sequence (delaying or advancing) multiplies the z-transform by a

    power of z. That is to say, if x (n) has a z-transform X (z),

  • 46

    3- Time Reversal

    If x (n) has a z-transform X (z), the z-transform of the time-reversed

    sequence x(-n) is

    4-Multiplication by an Exponential

    If a sequence x (n) is multiplied by a complex exponential n ,

    5-Convolution Theorem

    States that convolution in the time domain is mapped into multiplication in

    the frequency domain, that is,

    EXAMPLE: Consider the two sequences

    The z-transform of x (n) is

    And the z-transform of h (n) is

    The z-transform of the convolution of x (n) with h (n) is

  • 47

    6- Conjugation

    If X (z) is the z-transform of x (n), the z-transform of the complex conjugate

    of x (n) is

    If x (n) is real-valued, x (n) = x*(n), then

    7- Derivative

    If X (z) is the z-transform of x (n), the z-transform of n x(n) is

    EXAMPLE: find the z- transform of the second order recursive filter, given

    eothererwiso

    nnrnh

    n

    .........................0....).........cos(

    ][ 0

    Solution:

    0

    1

    0

    1

    000

    ])()([21

    2)cos()(

    00

    00

    n

    nj

    n

    nj

    n

    nnjnj

    n

    n

    nn

    zrezre

    zeerznrzH

    2210

    10

    11 )cos(21)cos(1

    11

    11

    21)(

    00

    zrzrzr

    zrezrezH jj

  • 48

    The Inverse Z Transform The Inverse Z transform enables us to extract f [n] from F[z] It can be found

    by any of the following three methods:

    a. Partial Fraction Expansion

    b. The Inversion Integral

    c. Long Division of polynomials

    Example: Use the partial fraction expansion method to compute the

    Inverse Z transform of

    Solution:

    We multiply both numerator and denominator by 3z to eliminate the negative powers of . Then,

    Next, we form f(z)/z, and we expand in partial fractions as

  • 49

    and multiplication of both sides by z yields

    We have:

  • 50

    Example : Use the partial fraction expansion method to compute the Inverse

    Z transform of

    Solution:

    We have:

    ,

  • 51

    Example

    Use the inversion integral method to find the Inverse Z transform of

    Solution:

    by Cauchy’s residue theorem, this integral can be expressed as where KP

    represents a pole of KPz

    nzzF 1)( and Res 1)( nzzF represents a residue at

    z= KP

    Multiplication of the numerator and denominator by 2z yields

  • 52

    Example Use the long division method to determine f(n) for n=0 ,1 ,2 ,

    given that

    Solution: we multiply by 3z

    By definition of the Z transform,

    We obtain f 0=1f 1=52 and f 2= 81 16

  • 53

    The Transfer Function of Discrete - Time Systems. The discrete - time system, can be described by the linear difference

    equation

    y [n] + b1y[n – 1]+b2y[n – 2]+..........+ bk y [n – k]

    = a0x [n]+a1x [n – 1]+a2x [n – 2]+....+ ak x [n – k]

    Where ai and bi are constant coefficients.

    Assuming that all initial conditions are zero, taking the Z transform of both

    sides

    We define the discrete - time system transfer function H[z] as

  • 54

    The discrete impulse response h [n ] is the response to the input x [n] = δ[n]

    , and since

    we can find the discrete - time impulse response h[n] by taking the Inverse Z

    transform of the discrete transfer function H[z], that is,

    Example :

    A discrete - time system is described by the difference equation

    Y [n] + y [n – 1] = x [n ] where y [n] = 0 for n < 0

    a. Compute the transfer function H(z)

    b. Compute the impulse response h[n]

    c. Compute the response when the input is x [n] = 10 for n ≥ 0

    Solution:

    a. y [n] + y [n – 1] = x [n]

    y [n] = 0 for n < 0

    Taking the Z transform of both sides we obtain

  • 55

    b.

    c. x [n] = 10 for n ≥ 0

  • 56

    Stability determination based z- Transform: A digital signal can always be describe using z – Transform as the ratio

    ...).........)((...).........)((

    )()()(

    21

    21

    pzpzzzzzK

    zDzNzX

    K : the system gain.

    ,.........,, 321 zzz :are called the “zeros” of X(z), because they are the values

    of (z) for which X(z) is zero.

    ,......., 32,1 ppp :are the poles of X(z). the poles and zeros are either real, or

    occur in complex conjugate pairs.

    The digital system is stable if and only if all the poles of the system lie

    inside the unit circle in the z –plane.

    Example: check the stability of the system given by:

    )5.0)(3.0()1()( 2

    2

    zzzzKzH

    Solution:

    )5.05.0)(5.05.0)(3.0()1()(

    2

    jzjzzzKzH

    Im z

    Re z

    The system is stable because all the poles lie inside

  • 57

    Example: find the impulse response and the transfer function of the

    following system.

    X[n] y[n]

    B

    Solution:

    Y[n]=B y[n-1] +x[n]

    For the impulse response x[n]=δ [n] → X(z)=1

    Y(z)=B 1Z Y(z)+1

    h [n]=y[n] when x[n]= δ[n]

    h[n]= 1Z y[z]= nB u[n]

    the transfer function H[n]=Z h[n] = 111

    BZ

    Example: implement the second order recursive filter

    Y[n]=2r cos( 0 ) y[n-1]-2r y[n-2]+x[n]- r cos ( 0 ) x[n-1]

    Solution:

    Y[z]=2r cos( 0 ) 1Z y[z] -2r 2Z y[z] + x[z]- r cos ( 0 ) 1Z x[z]

    X[z] Y[z]

    -rcos(w) 2rcos(w)

    2r

    1Z

    1Z

    1Z

    1Z

    ×

  • 58

    Frequency response of LTI system

    Since a sinusoidal signal can be expressed in terms of an exponential signal,

    the response of the LTI system to an exponential input is of practical

    interest. This leads to the concept of frequency response.

    A transform – domain representation of the LTI discrete – time system :

    n

    eznjj

    jzHenheH )(][)(

    Example: find and draw the frequency response of the system shown

    x[n] y[n] 2 0.9 Solution: Y(z) =2 x(z) + 0.9 1Z y(z) H(z) = y(z)/x(z) = 2/(1-0.9 1Z ) frequency response = H( je ) = H(z) jez

    H( je )= sin9.0cos9.012

    9.012

    je j

    1Z

  • 59

    Problems: 1-Use the partial fraction expansion to find f [n] = 1Z [F (z)] given that

    2-Use the Inversion Integral to compute the Inverse Z transform of

    3-Given a causal system y(n) = 0.9y(n-1)n - 1) + x(n)

    a. Find H(z) and sketch its pole-zero plot.

    b. Plot /H(je )l and ∟H(e'").

    c. Determine the impulse response h(n).

    4-A causal LTI system is described by the following difference equation:

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

    Determine

    a. the system function H(z),

    b. the unit impulse response h(n),

    c. the unit step response v(n), that is, the response to the unit step u(n),

    d. the frequency response function H(je ), and plot its magnitude and phase

    over 0 ≤ w ≤ π

    5-Determine the zero-state response of the system

    y(n) = 1/4y(n - 1) +x(n) +3x(n - 1), n 2≥ 0; y(-1) = 2 . to the input