11895611 digital signal processing

36
DIGITAL SIGNAL PROCESSING (DSP) SIGNAL PROCESSING

Upload: joshua-duffy

Post on 16-Dec-2015

38 views

Category:

Documents


1 download

DESCRIPTION

Intro to DSP

TRANSCRIPT

  • DIGITAL SIGNAL PROCESSING (DSP)

    SIGNAL PROCESSING

  • TopicsContinuous time (CT) and Discrete time (DT) signalsPeriodic and pulse signalsEnergy and power in signalsStandard CT and DT signalsImpulse, step, pulse, ramp, sine and exponentialAnalysis of CT signalsFourier Series and Fourier TransformsConvolution and CorrelationAnalysis of DT signalsDiscrete Fourier Transform of DT signalsFast Fourier TransformZ TransformDigital filtering in time domainLinear FiltersFIR FiltersIIR Filters

  • SIGNALA signal is defined as any physical quantity that varies with time, space or any other independent variable or variables. Mathematically, a signal can be represented as a function of one or more independent variables. S1(t) = 7t S2(t) = 18t2. Here S1(t) and S2(t) represents two signals- one that varies linearly with time t and the other varies quadratically with t.Complex signals are there which cannot be expressed by simple mathematical equations. (eg: speech signal, ECG , EEG)

  • Analog signalsAnalog signals are continuous function of an independent variable, such as time, space etc. Analog SystemIt is defined for every instant of independent variable, so the magnitude is continuous in the specified range for analog signals.Both magnitude of signal and independent variable are continuous.Signals can be easily processed directly by appropriate analog systems.

  • DIGITAL SIGNAL PROCESSING (DSP)The Digital Signal processing is the processing of signals by digital systems. The digital systems are either software, hardware or firmware.In digital processing of signal on a digital computer, the operation performed on a signal consists of a number of mathematical operations as specified by a software program.Program represents an implementation of system in softwareDigital hardware (logic circuits) also can be used as system in hardware to perform the desired operations.A / D Converter Digital Signal ProcessorD / A Converter Analog Input SignalDigital Input SignalDigital Output SignalAnalog Output Signal

  • Advantages of DSP:Flexibility:Digital programmable system allow flexibility in reconfiguring the DSP operations by simply changing the programAccuracy:DSP provides better control of accuracy requirements, while tolerance limits has to be met in the analog counterpartEasy Storage:Digital signals can be easily stored in magnetic media without deterioration or loss of signal fidelity. They can also be easily transported and processed off-time in remote laboratories.Processing:DSP allows for the implementation of more sophisticated signal processors than its analog counterparts.Cost effective:With advancement in VLSI technology the digital implementation of the signal processing system is cheaper.Limitations of DSP:The conversion speed of ADC and the processing speed of signal processors should be very high to perform all real time processingSignals of high bandwidth require fast sampling rate ADCs and fast processors.

  • Applications of DSP:Speech Processing:Speech compression & decompression for voice storage system and for transmission & reception of voice signals. Speech synthesis in message warning systems.Communication:Elimination of noise by filtering and echo cancellation by adaptive filtering in transmission channels.Biomedical:Spectrum analysis of ECG signals to identify various disorders in heart. Spectrum analysis of EEG signals to study the malfunctions or disorders in the brain.Consumer electronics:Music synthesis, Karoake systems, Surround sound systems, Digital audio & video.Seismology:Spectrum Analysis of seismic signals (I.e. signals generated by movement of rocks) can be used to predict the Earthquake, Volcanic eruptions, Nuclear explosions and Earth movement.Image processing:Two different filtering on images for image enhancement, finger print matching, identifying hidden images in the signals received by radars etc.

  • DISCRETE TIME SIGNALSA discrete time signal x(n) is a function of an independent variable where the independent variable is an integer.Signal x(n) is not defined for non-integer values of n.A discrete time signal is defined for every integer value of n in the range - < n < Methods of representing Discrete Time signalFunctional representation x(n) = -1 ; n = -2 2 ; n = -1 1.5 ; n = 0 -0.9 ; n = 1 1.4 ; n = 2 1.6 ; n = 3 0 ; other n 2. Graphical representation x(n)- 1-2-1012321.51.41.60.9

  • 3. Tabular representation 4. Sequence representation Some Elementary Discrete Time signals1. Digital impulse signal or unit sample sequence Impulse signal, (n) =1 ; n 00 ; n 0(n)n10

    n-2 -1 0 1 2 3x(n)-1 2 1.5 -0.9 1.4 1.6

  • Delayed impulse 1(n) = (n n0) =1 ; n 00 ; n 01(n)n1n0Delayed impulse signal 2. Unit Step signalUnit step signal, u(n) =1 ; n 00 ; n < 0u(n)n10Unit step signal The unit step signal is related to digital impulse by the summation relation

    u(n) = ( n k ) summation limit is k = 0 to infinity

  • 3. Ramp signalRamp signal, ur(n) =n ; n 00 ; n < 0ur(n)nRamp signal 4. Exponential signalExponential signal, g(n) =an ; n 00 ; n < 0g(n)nExponential signal 0 < a < 1

  • Mathematical operations on Discrete Time signals1. Shifting in timeA signal x(n) may be shifted in time by replacing the independent variable n by n-k, where k is an integer. If k is positive integer, the time shift results in a delay by k units of time. If k is negative integer, the time shift results in an advance of the signal by mod(k) units in time. The delay results in shifting each sample of x(n) to right. The advance results in shifting each sample of x(n) to left.

    Eg:- Let x(n) = 1 ; n = 2 2 ; n = 3 3 ; n = 4x(n)0123456123

  • Let x1(n) = x(n-2), where x1 is delayed signal of x(n) when n = 4; x1(4) = x(4-2) = x(2) = 1 when n = 5; x1(5) = x(5-2) = x(3) = 2 when n = 6; x1(6) = x(6-2) = x(4) = 3 x1(n)0123451236 Let x2(n) = x(n+2), where x2 is advanced signal of x(n) when n = 0; x2(0) = x(0+2) = x(2) = 1 when n = 1; x2(1) = x(1+2) = x(3) = 2 when n = 2; x2(2) = x(2+2) = x(4) = 3 x2(n)0123456123nn

  • 2. Folding or reflection or TransposeThe folding of a signal x(n) is performed by changing the sign of the time base n in the signal x(n). The folding operation produces a signal x(-n) which is mirror of x(n) with respect to time origin n = 0.Eg:- Let x(n) = n; -3 n 3. Now folded signal x1(n) = x(-n) = -n; -3 k 33. Amplitude scaling or scalar multiplicationAmplitude scaling of a signal by a constant A is accomplished by multiplying the value of every signal sample by A.Let y(n) be amplitude scaled signal of x(n), then y(n) = Ax(n)

  • Let x(n) = 20 ; n = 0 and A = 0.1, then y(n) = 2.0 ; n = 0 36 ; n = 1 3.6 ; n = 1 40 ; n = 2 4.0 ; n = 2 -15 ; n = 3 -1.5 ; n = 3 4. Time scaling or down samplingIn a signal, x(n), if n is replaced by n, where is an integer, then it is called the scaling or down sampling.Eg:- If x(n) = an; n 0; then x1(n) = x(2n) = an for even values of n 012345x(n)n012345x1(n)n

  • 5. Signal (vector) additionThe sum of two signals x1(n) and x2(n) is a signal y(n), whose value at any instant is equal to the sum of the samples of these two signals at that instant.i.e. , y(n) = x1(n) + x2(n) ; - < n <

    Eg:- Let x1(n) = {1, 2, -1, 2} and x2(n) = {-2, 1, 3, 1} When n = 0; y(0) = x1(0) + x2(0) = 1 + (-2) = -1When n = 1; y(1) = x1(1) + x2(1) = 2 + 1 = 3When n = 2; y(2) = x1(2) + x2(2) = -1 + 3 = 2When n = 3; y(3) = x1(3) + x2(3) = 2 + 1 = 3y(n) = x1(n) + x2(n) = {-1, 3, 2, 3} 6. Product or vector multiplicationSignal multiplication results in the product of two signals on a sample by sample basis. The product of two signals x1(n) and x2(n) is a signal y(n), whose value at instant is equal to the product of the samples of these two signals at that instant. The product is also called modulation.

  • Eg:- Let x1(n) = {1, 2, -1, 2} and x2(n) = {-2, 1, 3, 1} When n = 0; y(0) = x1(0) x x2(0) = 1 x (-2) = -2When n = 1; y(1) = x1(1) x x2(1) = 2 x 1 = 2When n = 2; y(2) = x1(2) x x2(2) = -1 x 3 = -3When n = 3; y(3) = x1(3) x x2(3) = 2 x 1 = 2y(n) = x1(n) x x2(n) = {-2, 2, -3, 2} Classification of Discrete Time signalsThe discrete time signals are classified depending on their characteristics. Some ways of classifying discrete time signals are :Energy signals and power signalsPeriodic and aperiodic signalsSymmetric and antisymmetric signals

  • 1. Energy signals and power signalsThe energy E of a signal x(n) is defined asE = |x(n)|2 , summation over n= - to

    The energy of a signal may be finite or infinite, and can be applied to complex valued and real-valued signals. If E is finite (0 < E < ), then x(n) is called an energy signal.

    The average power of a discrete time signal x(n) is defined as P = lim (1/ (2N+1)) |x(n)|2 limit is as n tends to infinity; .. 1the summation is over n = -N to N

    If we define the signal of x(n) over the finite interval N n N asEN = |x(n)|2 ; Where summation is over n = -N to N. 2Then we can express the signal energy E as, E = lim EN ; as N tends to 3 1

  • Then average power of the signal is P = lim (1 / 2N+1) EN . 4

    If E is finite, then P = 0. If E is infinite, then P may be finite or infinite. If P is finite and non-zero, then the signal is called power signal.

  • Fourier transformIn mathematics, the continuous Fourier transform is one of the specific forms of Fourier analysis. As such, it transforms one function into another, which is called the frequency domain representation of the original function (where the original function is often a function in the time-domain). In this specific case, both domains are continuous and unbounded. The term Fourier transform can refer to either the frequency domain representation of a function or to the process/formula that "transforms" one function into the other.There are several common conventions for defining the Fourier transform of a complex-valued Lebesgue integrable function, x In communications and signal processing, for instance, it is often the function:

    for every real number f

    When the independent variable f represents time (with SI unit of seconds), the transform variable represents ordinary frequency (in hertz). If is Hlder continuous, then it can be reconstructed from X by the inverse transform:

    for every real number t

  • FOURIER TRANSFORM OF DISCRETE TIME SIGNALSThe Fourier transform (FT) of discrete time signals is called discrete time fourier transform (DTFT).

    Let x(n) = Discrete-time signal X() or X(ei) = Fourier transform of x(n)

    The fourier transform of a finite energy discrete time signal, x(n) is defined as

    X() = e-jn , summation is over n = -infinity to +infinity

    The Fourier transform is one of the several mathematical tools that is useful in the analysis and design of LTI (Linear Time Invariant) system. Another one is the Fourier Series. These signal representations basically involve the decomposition of the signals in terms of sinusoidal components. In such a decomposition, the signal is said to be represent in the frequency domain.

  • To obtain the Fourier Transform representation, we shall start by finding the Fourier transformation of sampled Analog signal.

    Let the sampled analog signal = xa*(t)Its Fourier transform is given by ,F{xa*(t)} = - xa*(t) e-jt dt (limit is from infinity to +infinity)

    Again this can be written as , = xa (nT) (t-nT) e-j(nT) dt (limit is from infinity to +infinity)

    = xa(nT) e-j(nT) (t-nT) dt

    Using the shifting property of the impulse function,

    F{xa*(T)} = xa(nT) e-j(nT)

    Let x(n) = xa(nT)

    We define the Fourier transform to be, F{xa*(t)} when T = 1i.e., X(ej) = F{x(n)} = x(n) e-jn at T = 1

  • From the above equation, we find that X(ej) is a complex no., and it consists of real part and imaginary part.

    i.e., X(ej) = XReal(ej) + XImag(ej)

    | X(ej) | = [ (XReal(ej))2 + (XImag(ej))2]

    Phase angle, = tan-1[ XImag(ej) / XReal(ej) ]

    1. LinearityFourier Transform Theorems and PropertiesIf x1(n) is Fourier transformed to X1(ej)

    and x2(n) ----------------- X2(ej)

    Then , ax1(n) + bx2(n) ----------------- aX1(ej) + bX2(ej)

    Proof:F{ax1(n) + bx2(n)} = (ax1(n) + bx2(n)) e-jn

  • = ax1(n) e-jn + bx2(n) e-jn

    = a x1(n) e-jn + b x2(n) e-jn

    = a X1(ej) + b X2(ej)

    2. Time Shifting PropertyIf x(n) ----------------- X(ej)

    Then , x(n-k) ----------------- e-jk X(ej)

    Proof:

    Let n-k = p

    Then Fourier function, F{x(n-k)} = F{x(p)}

    F{x(p)} = x(p) e-j(p+k)

    F{x(p)} = x(p) e-jp e-jk

    F{x(p)} = e-jk x(p) e-jp = e-jk X(ej) (limit is from p=-infinity to + infinity). Hence proved.

  • 3. Time ReversalIf x(n) ----------------- X(ej)

    Then , x(-n) ----------------- X(e-j)

    Proof:

    Let -n = p

    Then Fourier function, F{x(-n)} = F{x(p)}

    F{x(p)} = x(p) ejp

    F{x(p)} = X (e-j) (limit is from p=-infinity to + infinity). Hence proved.

    4. Convolution TheoremIf x1(n) ----------------- X1(ej)

    x2(n) ----------------- X2(ej)

  • Then , x1(n) * x2(n) ----------------- X1(ej) * X2(ej)

    Proof:

    x1(n) * x2(n) ----------------- x1(k) * x2(n-k)(summation is from k=-infinity to + infinity)Fourier transform,

    x1(n) * x2(n) ----------------- x1(n) * x2(n) e-jn(summation is from n=-infinity to + infinity)

    = x1(k) * x2(n-k) e-jn(first summation is from k=-infinity to + infinity, second is over the same limit for n.)

    = x1(k) x2(n-k) e-jnPut n-k = p

    = x1(k) x2(p) e-j(p+k)(limit is for p = -infinity to + infinity)

    = x1(k) e-jk x2(p) e-jp

    = X1(ej) * X2(ej)

  • 5. Differentiation in frequency domainIf x(n) ----------------- X(ej)

    Then,

    nx (n) ----------------- j d/d {X2(ej)}

    Proof:

    X (ej) = x (n) e-jn

    d/d {X (ej)} = - j n x (n) e-jn

    j d/d {X (ej)} = n x (n) e-jn

    Results:

    X (ej) = x (n) e-jn

    Inverse Fourier Transform, x (n) = 1 / 2 X (ej) ejn d

  • linear time-invariant system are, of course, linearity and time invarianceLinear Time Invariant Systems

  • Time invariance means that whether we apply an input to the system now or T seconds from now, the output will be identical, except for a time delay of the T seconds. If the output due to input x(t) is y(t), then the output due to input x(t T) is y(t T). More specifically, an input affected by a time delay should effect a corresponding time delay in the output, hence time-invariant.

    The fundamental result in LTI system theory is that any LTI system can be characterized entirely by a single function called the system's impulse response. The output of the system is simply the convolution of the input to the system with the system's impulse response. This method of analysis is often called the time domain point-of-view. The same result is true of discrete-time linear shift-invariant systems, in which signals are discrete-time samples, and convolution is defined on sequences. Relationship between the time domain and the frequency domain

  • Impulse ResponseThe impulse response of a system is its output when presented with a very brief input signal, an impulse. An impulse represents the limiting case of a pulse made very short in time while maintaining its area or integral (thus giving an infinitely high peak). While this is impossible in any real system, it is a useful concept as an idealization.A system in the class known as LTI systems (linear, time-invariant systems) is completely characterized by its impulse response. The Impulse response from a simple audio system. Showing the original impulse, with high frequencies boosted, then with low frequencies boosted.

  • Practical applications of Impulse response LoudspeakersA very useful real application that demonstrates this idea was the development of impulse response loudspeaker testing in the 1980s which led to big improvements in loudspeaker design. Loudspeakers suffer from phase inaccuracy, a defect unlike normal measured properties like frequency response. Digital FilteringImpulse response is a very important concept in the design of digital filters for audio processing, because these differ from 'real' filters in often having a pre-echo, which the ear is not accustomed to.Impulse response analysis is a major facet of radar, ultrasound imaging, and many areas of digital signal processing. An interesting example would be broadband internet connections. Where once it was only possible to get 4 kHz speech signal over a local telephone wire, or data at 300 bit/s using a modem, it is now commonplace to pass 2 Mb/s over these same wires, largely because of 'adaptive equalisation' which processes out the time smearing and echoes on the line. Electronic processing

  • FIR Systems

  • IIR SystemsIn IIR (Infinite duration Impulse Response) systems, the impulse response has infinite number of samples. The convolution formula for IIR systems is given by,

    y(n) = h(k) x(n-k)Since, this sum involves the present and all the past input sample, we can say that the system has an infinite memory.

    In general, an IIR system is described by the difference equation,

    y(n) = - ak y(n-k) + bk y(n-k)

    Where the first summation is from k=1 to N and the second summation is over k=0 to M. 4

  • Let Z{y(n)} = Y(z) ; Z{y(n-k)} = z-k Y(z)Let Z{x(n)} = X(z) ; Z{x(n-k)} = z-k X(z)

    On taking Z-transform of eqn 4, we get,

    Y(z) = - ak z-k Y(z) + bk z-k X(z)Y(z) + ak z-k Y(z) = bk z-k X(z)(1 + ak z-k) Y(z) = bk z-k X(z)

    Y(z) / X(z) = bk z-k / (1 + ak z-k)

    H(z) = Y(z) / X(z) = bk z-k / (1+ ak z-k) = (b0 + b1 z-1 + b2 z-2 + .. + bM z-M) / (1 + a1 z-1 + a2 z-2 + .. + aN z-N)

    The eqn 5 is the general form of transfer function of IIR System.. 5

  • Infinite Impulse Response (IIR)Infinite impulse response (IIR) is a property of signal processing systems. Systems with that property are known as IIR systems or when dealing with electronic filter systems as IIR filters. They have an impulse response function which is non-zero over an infinite length of time. This is in contrast to finite impulse response filters (FIR) which have fixed-duration impulse responses.

    The simplest analog IIR filter is an RC filter made up of a single resistor (R) feeding into a node shared with a single capacitor (C). This filter has an exponential impulse response characterized by an RC time constant.Finite Impulse Response (FIR)A finite impulse response (FIR) filter is a type of a digital filter. The impulse response, the filter's response to a Kronecker delta input, is 'finite' because it settles to zero in a finite number of sample intervals. This is in contrast to infinite impulse response filters which have internal feedback and may continue to respond indefinitely. An Nth order FIR filter has a response to an impulse that is N+1 samples in duration.

  • Z - transformIn mathematics and signal processing, the Z-transform converts a discrete time-domain signal, which is a sequence of real or complex numbers, into a complex frequency-domain representation.

    The Z-transform and advanced Z-transform were introduced (under the Z-transform name) by E. I. Jury in 1958 in Sampled-Data Control Systems (John Wiley & Sons). The idea contained within the Z-transform was previously known as the "generating function method".The Z-transform, like many other integral transforms, can be defined as either a one-sided or two-sided transform.Bilateral Z-transform

    The bilateral or two-sided Z-transform of a discrete-time signal x[n] is the function X(z) defined as

    where n is an integer and z is, in general, a complex number:z = Aej where A is the magnitude of z, and is the complex argument (also referred to as angle or phase) in radians.

    *