Lecture 1,2 Introduction to DSP

download Lecture 1,2 Introduction to DSP

of 36

Transcript of Lecture 1,2 Introduction to DSP

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    1/36

    INTRODUCTION T0 DSP

    1Lecture 1

    Class time table:

    Section I:

    Mon & Tue 9:00 to 11:00 PST

    Section II:

    Wed & Thu 9:00 to 11:00 PST

    1: 911

    2: 911

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    2/36

    THE TEACHING PLAN

    OTHER DETAILS

    INTRODUCTION TO DSP

    ANALOG TO DIGITAL CONVERSION

    SAMPLING SAMPLING THEOREM, ALIASING

    QUANTIZATION QUANTIZATION NOISE

    In todays class

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    3/36

    Teaching plan

    Introduction

    Preliminaries

    Review of Signals & Systems

    Analog to Digital Conversion

    Convolution

    Correlation

    Z-domain transformation

    Fourier transformation

    Discrete Fourier Transform (Review)

    Fast Fourier Transform

    2 lectures

    1 lecture

    1 lecture

    4 lectures

    7 lectures

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    4/36

    Contd

    Digital Filters

    Finite Impulse Response (FIR) filters

    Infinite Impulse Response (IIR) filters

    Realization of Digital Filters

    Multi-rate Signal Processing

    Adaptive Signal Processing

    Spectrum Estimation & Analysis

    11 lectures

    10 lectures

    5 lectures

    4 lectures

    2 lectures

    5 lectures

    Pre-requisite : Signals & Systems (Theory)

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    5/36

    Reading material

    Text book

    Digital Signal Processing:

    Principles, Algorithms and

    Applicationsby

    John Proakis,

    Dimitris Manolakis

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    6/36

    Reference books

    Discrete-time Signal Processing by Alan Oppenheim

    and Ronald Schaffer

    By Emmanuel Ifeacher

    Web based demos

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    7/36

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    8/36

    Submitting Assignments!

    Assignments will have to be submitted in the form of

    groups

    Each group can have 6 members max.

    Every group musthave at leastone person in the

    Top10 students of your class (section)

    Group leader will be the student among Top10

    Submit the name of your group members tomorrow!Mention roll nos

    Email address of group leader

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    9/36

    Digital Signal Processing: What is it?

    What is digital signal processing (DSP) anyway?

    The term DSP generally refers to the use of digital

    computers to process signals. Normally, these signalscan be handled by analog processors but, for a

    variety of reasons, we may prefer to handle them

    digitally

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    10/36

    Why Digital Signal Processing?

    Why Digital Signals & Digital Systems?

    Analog signals cant be stored properly

    Processing analog signals is not efficient

    e.g. An analogue filter with sharp cutoff has non-linearphase response

    Analog systems are usually implemented usingresistors, capacitors, inductors, op-amps, transistors etc

    Potentially consume a lot of power

    Analog systems can get very complex

    An analog system made for one task/purpose may notwork for another task/purpose

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    11/36

    Why Digital Signals & Digital Systems?

    Digital signals can be easily stored and processed Digital Signal Processing is implemented in processors

    Processors in your cell phones, mp3 players etc

    Same processor can be used for many applications

    Multi-purpose PC can be used for education, gaming, watching

    movies, listening to songs what else?

    Digital systems will always consume less power than their

    analogue counterparts!

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    12/36

    DSP for Telecom engineers: Why?

    DSP has made deep inroads in to Telecommunications

    All modern communication systems are based on

    digital communication principles, which makes them

    robust against noise, that is always present in thechannel

    Robustness is due to the signal processing algorithms

    that run in the digital system Regenerative repeaters

    Equalizers

    Error-correction codes and so on

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    13/36

    Contd

    Modern communication systems are based on Field

    Programmable Gate Array (FPGAs), Digital Signal

    Processors (DSPs) or Application Specific Integrated

    Circuits (ASICs)

    All these reallyimplement DSP algorithms

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    14/36

    DSP Applications

    Medical

    Diagnostic imaging (MRI, CT, ultrasound, etc.)

    Electrocardiogram (ECG) analysis

    Electroencephalogram (EEG) analysisMedical image storage and retrieval

    Scientific

    Data acquisitionData extraction (DIP)

    Simulation & modeling

    Spectral analysis

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    15/36

    Contd

    Commercial

    Sound Processing

    Its no fluke that suddenly every singer has a good voice!!

    MP3, WMA, RM etc Image Processing

    Adobe Photoshop

    JPEG, BMP, GIF etc

    Djvu (new compression format for scanned documents) Video Processing

    Better video formats that occupy less space

    Video stabilization

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    16/36

    Contd

    Military

    More secure information transfer (better encryption)

    Jammers

    RADAR

    GPS guided missiles?

    So many more applications!

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    17/36

    Need for A/D conversion

    We know by now the benefits of digital signals and

    systems

    But most signals of practical interest are still analog

    Voice, Video

    RADAR signals

    Biological signals etc

    So in order to utilize those benefits, we need toconvert our analog signals into digital

    This process is called A/D conversion

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    18/36

    Three step process

    Analog to Digital conversion is really a three stepprocess involving

    Sampling

    Conversion from continuous-time, continuous valuedsignal to discrete-time, continuous-valued signal

    Quantization

    Conversion from discrete-time, continuous valued signal

    to discrete-time, discrete-valued signal Coding

    Conversion from a discrete-time, discrete-valued signalto an efficient digital data format

    Represent as bit?

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    19/36

    SAMPLING QUANTIZATIO

    N

    CODING

    CT-CV DT-CV DT-DV DT-DV

    Analog signal Binary bits

    2 4 6 8 10

    -1

    -0.5

    0

    0.5

    1

    2 4 6 8 10

    -1

    -0.5

    0

    0.5

    1

    2 4 6 8 10

    -1

    -0.5

    0

    0.5

    1

    1 2 3 4 5 6 7 8 9 104.5

    5

    5.5

    6

    6.5

    7

    7.5

    Arbitrarily, Ive chosen Differential

    PCM. Can you re-create these graphs?

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    20/36

    Sampling

    A continuous-time signal has some value defined at every time instant

    So it has infinite number of sample points

    2 4 6 8 10

    -1

    -0.5

    0

    0.5

    1

    2 4 6 8 10

    -1

    -0.5

    0

    0.5

    1

    2 4 6 8 10

    -1

    -0.5

    0

    0.5

    1

    2 4 6 8 10

    -1

    -0.5

    0

    0.5

    1

    sample

    every

    1 sec

    sample

    every

    0.1 sec

    sample

    every

    1 sec

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    21/36

    It is impossible to digitize an infinite number of points

    because infinite points would require infinite amount

    of memory and infinite amount of processing power So we have to take some finite number of points

    Sampling can solve such a problem by taking samples

    at the fixed time interval

    If an analog signal is not appropriately

    sampled, aliasing will occur, where a discrete-time

    signal may be a representation (alias) of multiple

    continuous-time signals

    Aliasing:

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    22/36

    Shannons sampling theorem

    The sampling theorem guarantees that an analogue signal can be in theory perfectly

    recovered as long as the sampling rate is at least twice as large as the highest-frequency

    component of the analogue signal to be sampled

    max2FFs

    A signal with no frequency component above a certain maximum frequency is known as

    a band-limited signal (in our case we want to have a signal band-limited to Fs)

    Some times higher frequency components are added to the analog signal (practical signalsare not band-limited)

    In order to keep analog signal band-limited, we need a filter, usually a low pass that stops

    all frequencies above Fs. This is called an Anti-Aliasing filter

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    23/36

    In order to sample a voice signal containing

    frequencies up to 4 KHz, we need a sampling rateof 2*4000 = 8000 samples/second

    Similarly for sampling of sound with frequencies up

    to 20 KHz, we need a sampling frequency of2*20000 = 40000 samples/second

    What is the sampling rate for CDs?

    Isnt it more than the one we just calculated?

    E l 1 F th f ll i l i l fi d th N i t li

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    24/36

    Example 1: For the following analog signal, find the Nyquist sampling

    rate, also determine the digital signal frequency and the digital signal

    t)70cos(3)( tx

    The maximum frequency component is x(t) is

    Therefore according to Nyquist, we need a sampling rate of

    The digital signal would have a frequency

    The digital signal can be represented as

    HzF 352

    70max

    HzFFs 702 max

    70

    352w

    )cos(3][ nnx

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    25/36

    Anti-aliasing filters

    Anti-aliasing filters are analog filters as they process the signal

    before it is sampled. In most cases, they are also low-pass filters

    unless band-pass sampling techniques are used

    The ideal filter has a flat pass-band and the cut-off is verysharp, since the cut-off frequency of this filter is half of that of the

    sampling frequency, the resulting replicated spectrum of the

    sampled signal do not overlap each other. Thus no aliasing occurs

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    26/36

    Practical low-pass filters cannot achieve the ideal characteristics.

    What can be the implications?

    Firstly, this would mean that we have to sample the filtered signals at

    a rate that is higher than the Nyquist rate to compensate for the

    transition band of the filter

    Thats why the sampling rate of a CD is 44.1 KHz, much higher than

    the 40 KHz we calculated

    Go through the assignment it has some reading task along with

    some problems

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    27/36

    Example 2: Find the Nyquists rate for the following signal

    t)100cos(-t)300sin(10t)50cos(3)( tx

    This composite signal comprises three frequencies

    f1 = 25 Hz, f2 = 150 Hz, f3 = 50 Hz

    So, according to Nyquist we need to sample at 300 Hz

    However, for the sine term, the sampled signal has values

    sin(n), meaning the samples are taken at the zero crossings, so the

    sine term is not counted in the process

    Therefore, a solution is to sample at higher than twice the max. freq

    component

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    28/36

    Quantization

    Now that we have converted the continuous-

    time, continuous-valued signal into a discrete-

    time, continuous-valued signal, we STILL need to make

    it discrete valued This is where Quantization comes into picture

    The process of converting analog voltage with

    infinite precision to finite precision

    For e.g. if a digital processor has a 3-bit word, the

    amplitudes of the signal can be segmented into 8 levels

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    29/36

    Quanitization

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    30/36

    General rules for Quantization

    Important properties

    of the quantizer

    include

    Number ofquantization levels

    Quantization resolution

    Note the minimum &

    maximum amplitude of

    the input signal

    Ymin & Ymax

    0 1 2 3 4 5 6 7 8 9 10

    -1

    -0.5

    0

    0.5

    1

    Ymax = 1

    Ymin = -1

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    31/36

    Note the word-length of DSP

    m-bits

    Number of levels of quantizer is equal toL = 2m

    The resolution of the quantizer is given as

    Resolution of a quantizer is the distance between two

    successive quantization levels More quantization levels, better resolution!

    Whats the downside of more quantization levels?

    )(1

    )( minmax voltsL

    yy

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    32/36

    0 5 10 15 20 250

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1

    00

    09.0][

    n

    nnx

    n

    m = 4, L = 16Ymin = 0

    Ymax = 1

    = 1/15 = 0.0667

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    33/36

    Quantization error

    The error caused by representing a continuous-valued

    signal(infinite set) by a finite set of discrete-valued

    levels

    Suppose a quantizer operation given by Q(.) is

    performed on continuous-valued samples x[n] is given

    by Q(x[n]), then the quantization error is given by

    ][][][ nxnxne qq

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    34/36

    Lets consider the signal , which is to be

    quantized.

    In the figure (previous slide), we saw that there was a

    difference between the original signal and the quantized

    signal. This is the error produced while quantization

    It can be reduced, however, if the number of quantization

    levels is increased as illustrated on next slide

    00

    09.0][

    n

    nnx

    n

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    35/36

    0 5 10 15 20 250

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1

    0 5 10 15 20 250

    0.02

    0.04

    0.06

    0.08

    0.1

    0.12

    0.14

    0 5 10 15 20 250

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1

    0 5 10 15 20 250

    0.5

    1

    1.5

    2

    2.5

    3

    3.5

    4x 10

    -3

    3-bit ADC

    8-bit ADC

    Quant. error

    Quant. error

  • 8/8/2019 Lecture 1,2 Introduction to DSP

    36/36

    Signal-to-Quantization-noise ratio

    Provides the ratio of the signal power to the

    quantization noise (or quanitization error)

    Mathematically,

    where

    Px = Power of the signal x (before quantization)

    Pq = Power of the error signal xq

    q

    x

    P

    P

    dBSQNR 10log10

    1

    0

    21

    0

    2 11N

    n

    q

    N

    n

    q nxnxN

    neN

    Pq