Intoductry Notes

download Intoductry Notes

of 24

Transcript of Intoductry Notes

  • 7/27/2019 Intoductry Notes

    1/24

    INTRODUCTION TO DIGITAL SIGNAL PROCESSINGAnd

    Review of Fourier Series, Fourier Transform

    WHAT IS DSP ?

    DSP, or Digital Signal Processing, as the term suggests, is theprocessing of signals by digital means. A signalin this context canmean a number of different things. Historically the origins of signalprocessing are in electrical engineering, and a signal here meansan electrical signal carried by a wire or telephone line, or perhaps

    by a radio wave. More generally, however, a signal is a stream ofinformation representing anything from stock prices to data from aremote-sensing satellite.

    ANALOG AND DIGITAL SIGNALS

    In many cases, the signal is initially in the form of an analogelectrical voltage or current, produced for example by amicrophone or some other type of transducer. In some situationsthe data is already in digital form - such as the output from thereadout system of a CD (compact disc) player. An analog signalmust be converted into digital (i.e. numerical) form before DSPtechniques can be applied. An analog electrical voltage signal, forexample, can be digitized using an integrated electronic circuit(IC) device called an analog-to-digital converter or ADC. Thisgenerates a digital output in the form of a binary number whosevalue represents the electrical voltage input to the device.

  • 7/27/2019 Intoductry Notes

    2/24

    SIGNAL PROCESSING

    Signals commonly need to be processed in a variety of ways. Forexample, the output signal from a transducer may well be

    contaminated with unwanted electrical "noise". The electrodesattached to a patient's chest when an ECG is taken measure tinyelectrical voltage changes due to the activity of the heart andother muscles. The signal is often strongly affected by "mainspickup" due to electrical interference from the mains supply.Processing the signal using a filter circuit can remove or at leastreduce the unwanted part of the signal. Increasingly nowadaysthe filtering of signals to improve signal quality or to extract

    important information is done by DSP techniques rather than byanalog electronics.

    DEVELOPMENT OF DSP

    The development of digital signal processing dates from the1960's with the use of mainframe digital computers for number-crunching applications such as the Fast Fourier Transform (FFT),which allows the frequency spectrum of a signal to be computedrapidly. These techniques were not widely used at that time,because suitable computing equipment was available only inuniversities and other scientific research institutions.

    DIGITAL SIGNAL PROCESSORS

    Introduction of microprocessors in 1970s and 80s resulted in awide range of applications of DSP.

    With increasing use of DSP techniques in industry and elsewhere,special purpose microprocessors with architectures designedspecifically for applications in the field of DSP were introduced.Such microprocessors were termed as Digital Signal Processors(DSPs).DSPs are programmable devices and are capable of

  • 7/27/2019 Intoductry Notes

    3/24

    carrying out millions of instruction per second making it possiblefor use in real time applications.

    APPLICATION OF DSP

    DSP technology nowadays find application in almost all spheresof life Some of the more important areas are; Telephony (particularly mobile phones) IC Technology Medicine Multimedia (Image and Speech Processing) Data Compression

    Entertainment Electronics

  • 7/27/2019 Intoductry Notes

    4/24

    WHAT ARE SIGNALS AND SYSTEMS?

    Signals and systems are the two most fundamental concepts indigital signal processing, as well as in many other disciplines.Signals are patterns of variation of physical quantities such as

    temperature, pressure, voltage, brightness, etc.

    Systems operate on signals to produce new signals. In fact theseare all examples of systems. For example, microphones convertair pressure to electrical current and speakers convert electricalcurrent to air pressure.

    Before going into the details of signals and systems we will review

    some mathematical tools that handle signals.

    A signal can be viewed from two different standpoints:

    1. The time domain.2. The frequency domain.

  • 7/27/2019 Intoductry Notes

    5/24

  • 7/27/2019 Intoductry Notes

    6/24

  • 7/27/2019 Intoductry Notes

    7/24

    Therefore anything that can break a signal down into itsconstituent parts would be very useful. One such tool is theFourier series

    With the exception of some mathematical curiosities, any periodicsignal of period T can be expanded into a trigonometric series ofsine and cosine functions, as long as it obeys the followingconditions:

    1. f(t) has finite number of maxima and minima within T2. f(t) has finite number of discontinuities within T, and

    3. It is necessary that

    T

    tdtf0

    )()(

    4. These three conditions mean that you are able to calculatethe area under the graph. If 1 isn't true then it's a powersignal going to infinity and isn't absolutely integrable. If 2 isn'ttrue then once again it isn't absolutely integrable, and 3. issimply reaffirming conditions 1 and 2.

    If all of these are true then the signal can be represented as:

    and the coefficients are:

    dtT

    nttf

    Ta

    Tt

    tn

    0

    0

    2cos)(

    2

    dtT

    nttf

    Tb

    Tt

    tn

    0

    0

    2sin)(

    2

    11

    2sin

    2cos

    2)(

    0

    n

    n

    n

    n

    T

    ntb

    T

    nta

    atf

  • 7/27/2019 Intoductry Notes

    8/24

    Tt

    tdttfa

    0

    00 )(

    In practice we do not have to have infinite number ofHARMONICS to construct the original signal f (t). We canconstruct f(t) with a finite number of HARMONICS with anacceptable error. Consider for example the reconstructed signalof a saw tooth waveform shown in figure

    The first signal has only two harmonics, part (a) The second signal has five harmonics, part (b) The third signal has ten harmonics, and (c)

    The original signal at the bottom. Part (d)

  • 7/27/2019 Intoductry Notes

    9/24

    As you can see by the time you have ten harmonics, the signal isvirtually identical to the original.

    The other snag is that the signal must be periodic, and few realworld signals are truly periodic. We can get around this byartificially changing a non-periodic signal (over time T) so that itbecomes periodic. e.g. a pulse signal can be repeatedto give theappearance of a periodic signal.

    e.g. From the non-periodic input signal

    We can produce this periodic signal of period T0

    The Fourier series can also be represented in a complex formwhich is more compact and is more convenient when dealing withcomplex signals.

    If we make the use of the trigonometric identity ejx = cos x + j sin x

    f(t)

    T0

    f(t)

  • 7/27/2019 Intoductry Notes

    10/24

    And we define2

    nnn

    jbac

    we get the complex form of the

    Fourier series to be

    n

    nn tjctf exp)( n= 2n/T

    FOURIER TRANSFORM

    The Fourier Transform is generalization of the Fourier Series.Strictly speaking it only applies to continuous and aperiodicfunctions, but the use of the impulse function allows the use ofdiscrete signals. The Fourier Transform is defined as

    -

    t)dtf(t)exp(-j)F(

    The inverse transform is defined as

    t)dt)exp(jF(2

    1f(t)

    The Fourier Transform F() of f(t) is also known as theSPECTRUM of f(t). Since the Spectrum of a real signal is

    complex the amplitude of F() i.e. F ( ) is called theAMPLITUDE SPECTRUM and the phase ofF() is called thePHASE SPECTRUM of f(t).

  • 7/27/2019 Intoductry Notes

    11/24

    If we take the Fourier transform of a square pulse (GateFunction) as shown in Figure

    and apply the Fourier Transform to it we get

    -

    t)dtf(t)exp(-j)F(

    But since the pulse is zero every where except in the rangeT/2 < t < T/2 we can write the equation as

    2/2/

    2/

    2/j

    t)exp(-jdt)tjexp()F( TT

    T

    T

    j

    T/2)exp(-jT/2)exp(j)F(

    Or)x(sincT)

    2

    T(sincT

    )2/(

    T/2)sin(T)F(

    T

    Where x = T/

    1

    f t

    T/2-T/2

    t

    0

    T

  • 7/27/2019 Intoductry Notes

    12/24

    Amplitude and Phase spectrum of the single Gate Function

    Consider now the rectangular pulse shown in figure

  • 7/27/2019 Intoductry Notes

    13/24

    f(t) = 1, for 0 < t < T and f(t) = 0 otherwise.The Fourier Transform is given by

    F() = T e-iT/2 sinc (T/2)The amplitude and phase spectrum are shown in figure.

    T

    1

    t

    f(t)

  • 7/27/2019 Intoductry Notes

    14/24

  • 7/27/2019 Intoductry Notes

    15/24

    DISCRETE TIME SIGNALS

    A discrete-time signal is a sequence of numbers (real or

    complex). such a sequence represents the variation of somephysical quantity as a function of a discrete-time index "n".For instance, the number sequence (0, 1, 2, 3, etc.) can bedescribed as x(n) = n for 0 < n

  • 7/27/2019 Intoductry Notes

    16/24

    voltage or current, volatile substances ignite or explode, etc. Asignal x(n) is called bounded if there exists a positive number Asuch that the absolute value of x of n does not exceed A for all n.

    From a mathematical standpoint it is sometimes convenient toextend the notions of finite energy and boundedness byintroducing a broader family of finite power signals. A signal x(n)has finite power when the limit as N goes to infinity, of the sumof squared magnitudes of x (n) for n ranging from minus N toplus N is finite.

    Every finite-energy signal is bounded, and every bounded signal

    has finite power.

    Finite energy signals represent transient phenomena: suchsignals have the property that x(n) converges to zero as n goes toeither plus or minus infinity. On the other hand, finite powersignals represent persistent phenomena, for which x(n) does not

    decay with time. Strictly speaking, persistent signals cannot existin our energy-bounded world. Nevertheless, they offer aconvenient mathematical model for many real life signals such asocean waves, air temperature, power line voltage, sunspotactivity, etc., all of which exhibit essentially constant power overprolonged periods of time.

  • 7/27/2019 Intoductry Notes

    17/24

    Finite energy = transient phenomenax(n) decays with time

    0x(n)limn

    Finite power signal = persistent phenomenax(n) does not decay with time

    EXAMPLES

    Finite Energy Finite Power

  • 7/27/2019 Intoductry Notes

    18/24

    A discrete time sinusoidal signal is always given by theexpression x(n) = A cos (2f0n + )

    where "A" is a positive number called amplitude, f0(with

    magnitude bounded by one half) is called frequency and (withmagnitude bounded by pi) is called phase-shift.

    The product 0 = 2f0 is known as radial frequency.

    ALIASING OF SINUSOIDAL SIGNALS

    If x1(n) = cos 2f0n and x2(n) = cos 2 (f0+k)n then it can beseen that

    x1(n) = x2(n)

    for all n .Where k is any integer (positive or negative). For thisreason, we always restrict the frequency of a sinusoid to valuesin the range magni tude of f0is less or equal to one half .

    Discrete time sinusoidalsignalAmplitudeFrequency

    Phase Shift

    Angular (Radial) Frequency

    A

    x(n) = A cos (2f0n +)

    < /2

  • 7/27/2019 Intoductry Notes

    19/24

    EULERS IDENTITY

    A very important analytical tool is Euler's identity, which relates

    sinusoids to complex exponentials, namely. Mathematically,

    Periodic and Aperiodic Signals

    Discrete signal x(n) is periodic if

    x(n + N) = x(n)for any integer N. Otherwise it is aperiodic.

    The Period of the periodic signal is the smallest integer N thatsatisfies this relation.

    Some Fundamental Sequences

    1, n = 0

    The Unit Sample (n) =0, otherwise

    1, n 0The Unit Step u(n) =

    0, otherwise

    The Exponential sequence is defined as

  • 7/27/2019 Intoductry Notes

    20/24

    x(n) = an

    We can write the unit sample in terms of unit step as

    n

    -k

    k)-(nu(n)

    Similarly a unit sample can be expressed as

    (n) = u(n) u(n-1)

    The Unit Impulse Sequence

    -10 -5 0 5 10 15 200

    0.2

    0.4

    0.6

    0.8

    1

    Time index n

    Amplitude

    Unit Sample Sequence

  • 7/27/2019 Intoductry Notes

    21/24

    The exponential sequence

    Periodic and Aperiodic Sequences

    A discrete signal x(n) is said to be periodic if for some positiveinteger N,

    x(n) = x(n+N)otherwise it is an Aperiodic Signal.

    If x1(n) is a periodic sequence with period N1 and x2(n) is asequence with period N2, then the sum sequence

    x(n) = x1(n) + x2(n)

    will always be periodic with the fundamental period

    N = (N1N2)/ gcd(N1,N2)where gcd(N1,N2) means the greatest common Divisor of N1 andN2.The same is true for the product but the fundamental periodmay be smaller.

    0 5 10 15 20 25 30 350

    20

    40

    60

    80

    100

    120

    Time index n

    Amplitude

  • 7/27/2019 Intoductry Notes

    22/24

    SIGNAL MANIPULATION

    1. Transformation of the independent variable

    Sequences are often altered by modifying the index n asfollows

    y(n) = x (f(n))where f(n) is some function of n.

    2. ShiftingThis is the transformation defined by f(n) = x(n-n0). x (n) is

    shifted to the right by n0 samples if n0 is positive (this is referredto as delay) and is shifted to the left if n0 is negative (referred toas advance.

    Thus y(n) = x(n n0)

    3. ReversalThis transformation is given by f(n) = -n and simply FLIPPSthe signal x(n) with respect to n. Thus

    y(n) = x(-n)

    4. Time ScalingThis transformation is defined by f(n) = Mn or f(n) = n/Nwhere M and N are positive integers. In the case of f(n) =Mn, the sequence is formed by taking every Mth sample ofx(n)(this operation is known as (Down Sampling). With f(n)= n/N the sequence y(n) = x(f(n)) is defined as

    x(n/N) n = 0, N, 2N, . . .y(n) =

    0 otherwise

    This operation is called Up-Sampling

  • 7/27/2019 Intoductry Notes

    23/24

  • 7/27/2019 Intoductry Notes

    24/24

    Signal Decomposition

    The unit sample function (n) may be used to decompose anarbitrary discrete signal x(n) into a sum of weigted and shifted unit

    sample function as follows

    x(n) = . . . + x(-1)(n+1)+x(0)(n) + x(1)(n-1) x(2)(n-2) + This may be written as

    -k

    k)-(nx(k)x(n)

    Where each term in the sum x(k) (n-k) is a signal that has theamplitude of x(k) at time n=k and a value of zero for all othervalues of n. This decomposition is the discrete version of theSIFTING property for continuous time signals.