dsp

Post on 12-May-2015

719 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

EXPERT SYSTEMS AND SOLUTIONS

Email: expertsyssol@gmail.comexpertsyssol@yahoo.comCell: 9952749533

www.researchprojects.info PAIYANOOR, OMR, CHENNAI

Call For Research Projects Final year students of B.E in EEE, ECE, EI, M.E (Power Systems), M.E (Applied

Electronics), M.E (Power Electronics)Ph.D Electrical and Electronics.

Students can assemble their hardware in our Research labs. Experts will be guiding the

projects.

DIGITAL SIGNAL PROCESSING(DSP)FUNDAMENTALS

WHAT IS DSP?

Converting a continuously changing waveform (analog) into a series of discrete levels (digital)

WHAT IS DSP?

The analog waveform is sliced into equal segments and the waveform amplitude is measured in the middle of each segment

The collection of measurements make up the digital representation of the waveform

WHAT IS DSP?

00.

22 0.44 0.

64 0.82 0.

98 1.11 1.

21.

241.

271.

241.

21.

110.

980.

820.

640.

440.

220

-0.2

2-0

.44

-0.6

4-0

.82

-0.9

8-1

.11

-1.2

-1.2

6-1

.28

-1.2

6-1

.2-1

.11

-0.9

8-0

.82 -0.6

4 -0.4

4 -0.2

20

-2

-1.5

-1

-0.5

0

0.5

1

1.5

21 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37

DSP IS EVERYWHERE Sound applications

Compression, enhancement, special effects, synthesis, recognition, echo cancellation,…

Cell Phones, MP3 Players, Movies, Dictation, Text-to-speech,… Communication

Modulation, coding, detection, equalization, echo cancellation,…

Cell Phones, dial-up modem, DSL modem, Satellite Receiver,… Automotive

ABS, GPS, Active Noise Cancellation, Cruise Control, Parking,… Medical

Magnetic Resonance, Tomography, Electrocardiogram,… Military

Radar, Sonar, Space photographs, remote sensing,… Image and Video Applications

DVD, JPEG, Movie special effects, video conferencing,… Mechanical

Motor control, process control, oil and mineral prospecting,…

SIGNAL PROCESSING Humans are the most advanced signal processors

speech and pattern recognition, speech synthesis,… We encounter many types of signals in various

applications Electrical signals: voltage, current, magnetic and electric

fields,… Mechanical signals: velocity, force, displacement,… Acoustic signals: sound, vibration,… Other signals: pressure, temperature,…

Most real-world signals are analog They are continuous in time and amplitude Convert to voltage or currents using sensors and

transducers Analog circuits process these signals using

Resistors, Capacitors, Inductors, Amplifiers,… Analog signal processing examples

Audio processing in FM radios Video processing in traditional TV sets

LIMITATIONS OF ANALOG SIGNAL PROCESSING Accuracy limitations due to

Component tolerances Undesired nonlinearities

Limited repeatability due to Tolerances Changes in environmental conditions

Temperature Vibration

Sensitivity to electrical noise Limited dynamic range for voltage and currents Inflexibility to changes Difficulty of implementing certain operations

Nonlinear operations Time-varying operations

Difficulty of storing information

9

DIGITAL SIGNAL PROCESSING Represent signals by a sequence of numbers

Sampling or analog-to-digital conversions Perform processing on these numbers with a digital processor

Digital signal processing Reconstruct analog signal from processed numbers

Reconstruction or digital-to-analog conversion

A/D DSP D/Aanalogsignal

analogsignal

digital signal

digital signal

• Analog input – analog output – Digital recording of music

• Analog input – digital output– Touch tone phone dialing

• Digital input – analog output– Text to speech

• Digital input – digital output– Compression of a file on computer

PROS AND CONS OF DIGITAL SIGNAL PROCESSING Pros

Accuracy can be controlled by choosing word length Repeatable Sensitivity to electrical noise is minimal Dynamic range can be controlled using floating point

numbers Flexibility can be achieved with software

implementations Non-linear and time-varying operations are easier to

implement Digital storage is cheap Digital information can be encrypted for security Price/performance and reduced time-to-market

Cons Sampling causes loss of information A/D and D/A requires mixed-signal hardware Limited speed of processors Quantization and round-off errors

DSP APPLICATIONS

Image Processing – Robotic vision, FAX, satellite weather

Instrumentation – Spectrum analysis, noise reduction

Speech & Audio – Speech recognition, equilization

Military – Radar processing, missile guidance Telecommunications – Echo cancellation,

video conferencing, VoIP Biomedical – ECG analysis, patient

monitoring Consumer Electronics – Cell phones, set top

box, video cameras

DSP APPLICATIONS

ANOTHER LOOK AT DSP APPLICATIONS High-end

Wireless Base Station - TMS320C6000 Cable modem gateways

Mid-end Cellular phone - TMS320C540 Fax/ voice server

Low end Storage products - TMS320C27 Digital camera - TMS320C5000 Portable phones Wireless headsets Consumer audio Automobiles, toasters, thermostats, ...

Incr

easi

ngC

ost

Increasingvolum

e

ADVANTAGES OF DSP

Guaranteed Accuracy – Accuracy only limited by bit length

Perfect Reproducibility – No component tolerances, no component drift due to temperature or age

Greater Flexibility – Functions and algorithms can be changed through software

Superior Performance – Adaptive filtering, linear phase response

Some Data Naturally Digital – Images, computer files

DISADVANTAGES OF DSP

Speed and Cost – ADC/DAC, uProc Design Time – Can be tricky Finite Word Length Issues

KEY DSP OPERATIONS

Convolution Correlation Filtering Transformations Modulation

CONVOLUTION

Many uses but a common use is determining a system’s output if system input and system impulse response is known. For continuous system:

dhtxdthxthtxty )()()(

tx th thtxty

DISCRETE CONVOLUTION

We may however have a computer sampling a signal so that we have discrete data.

So instead of continuous integration process we have discrete summation.

,2,1,0

nknxkhnhnxnyk

Practically speaking though we would have finite sequences x(n) and h(n) of lengths N1 and N2 respectively, so this is then:

1

1,,1,0

21

1

0

NNMwith

MnknxkhnhnxnyM

k

CORRELATION

Correlation is essentially the same as convolution (from a computational standpoint). You just don’t “flip” anything.

Instead of describing system output, correlation tells us information about the signals.

Cross-correlation function Tells you a measure of similarities between two

signals. Application: Identifying radar return signals

Signals

• What is a signal?– A signal is a function of independent

variables such as time, distance, position, temperature, pressure, etc.

– Most signals are generated naturally but a signal can also be generated artificially using a computer

– Can be in any number of dimensions (1D, 2D or 3D)

Lecture 1 CE804 Autumn 2007/8 (copyright R. Palaniappan, 2008)

CLASSIFICATION OF SIGNALS

Signals can be classified into various types by Nature of the independent variables Value of the function defining the signals

Examples: Discrete/continuous function Discrete/continuous independent variable Real/complex valued function Scalar (single channel)/Vector (multi-channels) Single/Multi-trial (repeated recordings) Dimensionality based on the number of independent variables

(1D/2D/3D) Deterministic/random Periodic/aperiodic Even/odd Many more….

Lecture 1 CE804 Autumn 2007/8 (copyright R. Palaniappan, 2008)

CLASSIFICATION - DISCRETE/CONTINUOUS SIGNALS

Normally, the independent variable is time

Continuous time signal Time is continuous Defined at every instant of time

Discrete time signal Time is discrete Defined at discrete instants of time - it is a sequence of

numbers

Four classifications based on time/amplitude - continuous/discrete: Analogue, digital, sampled, quantised boxcar

CONTINUOUS AND DISCRETE SIGNALS

Continous signal

xa(t)

Discrete signal (sequence)

x[n]

x[n] = xa(nT) T : sampling period

fs = 1/T : sampling rate

Lecture 1 CE804 Autumn 2007/8 (copyright R. Palaniappan, 2008)

CLASSIFICATION - DISCRETE/CONTINUOUS SIGNALS (CONT)

Amplitude- continuous

Time-continuous

Amplitude- continuous

Time-discrete

Amplitude- discrete

Time-discrete

Amplitude- discrete

Time-continuous

25

RANDOM VS DETERMINISTIC SIGNAL

Deterministic signal A signal that can be predicted using some methods like a

mathematical expression or look-up table Easier to analyse

Random (stochastic) A signal that is generated randomly and cannot be

predicted ahead of time Most biological signals fall in this category More difficult to analyse

Lecture 1 CE804 Autumn 2007/8 (copyright R. Palaniappan, 2008)

CLASSIFICATION – PERIOD/APERIODIC

Periodic Continuous time-signal is

periodic if it exhibits periodicity, i.e. x(t+T)=x(t), -<t< where T=period of the signal

The smallest value of T is called the fundamental period, T0

A periodic signal has a definite pattern that repeats over and over with a repetition period of T0

For discrete-time signals, x(n+N0)=x(n),-<n<

A signal, which does not have a repetitive pattern is aperiodic

Periodic signal (discrete-time)

Periodic signal (continuous-time)

Lecture 1 CE804 Autumn 2007/8 (copyright R. Palaniappan, 2008)

SINGULAR FUNCTIONS Singular functions

Important non-periodic signals Delta/unit-impulse function is the most basic and all other singular

functions can be derived from it

Unit impulse functions

Unit step functions

Unit ramp functions

Unit pulse function

1)(;0,0)( dtttt 0

0

,0

,1{)(

n

nn

0

0

,1

,0{)(

t

ttu

0

0

,1

,0{)(

n

nnu

0

0

,

,0{)(

t

t

ttr

0

0

,

,0{)(

n

n

nnr

2

1

2

1)( tutut

CLASSIFICATION –EVEN/ODD Even signal

Signal exhibit symmetry in the time domain

x(t)=x(-t) or x(n)=x(-n)

Odd signal Signal exhibit anti-symmetry

in the time domain x(t)=-x(-t) or x(n)=-x(-n)

A signal can be expressed as a sum of its even and odd components x(t)=xeven(t)+xodd(t) where xeven(t)=1/2[x(t)+x(-t)], xodd(t)=1/2[x(t)-x(-t)]

CLASSIFICATION OF SIGNALS

SIGNAL DESCRIPTION EXAMPLE

1 – D Signal is a function of a single independent variable

Speech

2 - D Signal is a function of 2 independent variables

Image

M - D Signal has more than 2 independent variables

Video signal

DIMENSIONALITY

CLASSIFICATION OF SIGNALS

Continuous-time signals The signal is defined

for every instant of time in a defined range

Discrete-time signal The independent

variable (time) is discrete. The signal is defined at discrete instants of time

CLASSIFICATION OF SIGNALS

Analog signal A continuous-time

and a continuous amplitude

x(t)

t

xq(t) t

A Quantized Signal discrete in

amplitude but continuous in time

CLASSIFICATION OF SIGNALS Sampled data signal

has a continuous amplitude. Amplitude can take any value within a specified range.

• Digital signal is a discrete-time signal with discrete-valued amplitudes

CLASSIFICATION OF SIGNALS A deterministic

Signal is one that is uniquely determined by a well defined process such as a mathematical expression or a look-up table

• A random signal is one that is generated in a random fashion and cannot be predicted or reproduced

Copyrig

ht ©

20

01

, S. K

. Mitra

CLASSIFICATION OF SIGNALS

Dimension Type Symbol Independent variable

1 - D Continuous-time v(t) t

1 - D Discrete - time {v(n)} n

2 - D Continuous-spatial v(x,y) x,y

2 - D Discrete - spatial {v(m,n)} m,n

3 - D Continuous-time and spatial

v(x,y,t) x,y,t

3 - D Continuous-time and spatial

x,y,t

),,(

),,(

),,(

),,(

tyxb

tyxg

tyxr

tyxu

DISCRETE-TIME SIGNALS:DISCRETE-TIME SIGNALS:TIME-DOMAIN REPRESENTATIONTIME-DOMAIN REPRESENTATION

Graphical representation of a discrete-time signal with real-valued samples is as shown below:

DISCRETE-TIME SIGNALS:DISCRETE-TIME SIGNALS:TIME-DOMAIN REPRESENTATIONTIME-DOMAIN REPRESENTATION

)(txa

•In some applications, a discrete-time sequence {x[n]} may be generated by sampling a continuous-time signal at uniform intervals of time

DISCRETE-TIME SIGNALS:DISCRETE-TIME SIGNALS:TIME-DOMAIN REPRESENTATIONTIME-DOMAIN REPRESENTATION

Here, n-th sample is given by

The spacing T between two consecutive samples is

called the sampling interval or sampling period

Reciprocal of sampling interval T, denoted as , is called the sampling frequency:

),()(][ nTxtxnx anTta ,1,0,1,2, n

TF

TFT

1

DISCRETE-TIME SIGNALS:DISCRETE-TIME SIGNALS:TIME-DOMAIN REPRESENTATIONTIME-DOMAIN REPRESENTATION Unit of sampling frequency is cycles per

second, or hertz (Hz), if T is in seconds

Whether or not the sequence {x[n]} has been obtained by sampling, the quantity x[n] is called the n-th sample of the sequence

{x[n]} is a real sequence, if the n-th sample x[n] is real for all values of n

Otherwise, {x[n]} is a complex sequence

DISCRETE-TIME SIGNALS:DISCRETE-TIME SIGNALS:TIME-DOMAIN REPRESENTATIONTIME-DOMAIN REPRESENTATION

A complex sequence {x[n]} can be written as

where

and

are the real and imaginary parts of x[n]

The complex conjugate sequence of {x[n]} is given by

Often the braces are ignored to denote a sequence if there is no ambiguity

][nxre

][nxim

]}[{]}[{]}[{ nxjnxnx imre

]}[{]}[{]}[*{ nxjnxnx imre

DISCRETE-TIME SIGNALS:DISCRETE-TIME SIGNALS:TIME-DOMAIN REPRESENTATIONTIME-DOMAIN REPRESENTATION

Two types of discrete-time signals: - Sampled-data signals in which samples are continuous-valued- Digital signals in which samples are discrete-valued

Signals in a practical digital signal processing system are digital signals obtained by quantizing the sample values either by rounding or truncation

DISCRETE-TIME SIGNALS:DISCRETE-TIME SIGNALS:TIME-DOMAIN REPRESENTATIONTIME-DOMAIN REPRESENTATION

A discrete-time signal may be a finite-length or an infinite-length sequence

Finite-length (also called finite-duration or finite-extent) sequence is defined only for a finite time interval:where and with

Length or duration of the above finite-length sequence is

21 NnN 1N 2N 21 NN

112 NNN

DISCRETE-TIME SIGNALS:DISCRETE-TIME SIGNALS:TIME-DOMAIN REPRESENTATIONTIME-DOMAIN REPRESENTATION

A length-N sequence is often referred to as an N-point sequence

The length of a finite-length sequence can be increased by zero-padding, i.e., by appending it with zeros

A right-sided sequence x[n] has zero-valued samples for

If a right-sided sequence is called a causal sequence

1Nn

,01 N

DISCRETE-TIME SIGNALS:DISCRETE-TIME SIGNALS:TIME-DOMAIN REPRESENTATIONTIME-DOMAIN REPRESENTATION

A left-sided sequence x[n] has zero-valued samples for

If a left-sided sequence is called a anti-causal sequence

A right-sided sequence

A left-sided sequence

2Nn ,02 N

nN1

2Nn

OPERATIONS ON SEQUENCES: OPERATIONS ON SEQUENCES: BASIC OPERATIONSBASIC OPERATIONS

Product (modulation) operation:

Modulator

An application is in forming a finite-length sequence from an infinite-length sequence by multiplying the latter with a finite-length sequence called a window sequence

Process called windowing

x[n] y[n]

w[n] ][][][ nwnxny

BASIC OPERATIONSBASIC OPERATIONS

Addition operation: Adder

Multiplication operation Multiplier

][][][ nwnxny

A

x[n] y[n]

][][ nxAny

x[n] y[n]

w[n]

BASIC OPERATIONSBASIC OPERATIONS

Time-shifting operation:where N is an integer

(i)If N > 0, it is delaying operation

Unit delay

(ii)If N < 0, it is an advance operation

Unit advance

][][ Nnxny

y[n]x[n] z

1z y[n]x[n] ][][ 1 nxny

][][ 1 nxny

BASIC OPERATIONSBASIC OPERATIONS

Time-reversal (folding) operation:

Branching operation: Used to provide multiple copies of a sequence

][][ nxny

x[n] x[n]

x[n]

ALIASING

Aliasing: If you sample too slow, the high frequency components will

become irregular noise at the sampling frequency They are noises that are in the same frequency range of your

signal!!!

• Look at the samples alone

• Can you tell which of the two frequencies the sampled series represents?

• Either of the two signals could produce the samples, i.e., the signals are “aliases” of each other

CLASSIFICATION OF SEQUENCES:CLASSIFICATION OF SEQUENCES:ENERGY AND POWER SIGNALSENERGY AND POWER SIGNALS

Power SignalPower Signal An infinite energy signal with finite average

power is called a power signalExample - A periodic sequence which has a finite

average power but infinite energy

Energy Signals Energy Signals

A finite energy signal with zero average power is called an energy signal

Example - a finite-length sequence which has finite energy but zero average power

3( 1) ,[ ]

0, 0, 10

n othersx n

n n

OTHER TYPES OF CLASSIFICATIONSOTHER TYPES OF CLASSIFICATIONS

A sequence x[n] is said to be bounded if

A sequence x[n] is said to be absolutely summable if

A sequence x[n] is said to be square-summable if

xBnx ][

nnx ][

nnx 2][

BASIC SEQUENCES

Unit impulse Unit step

Exponential

Periodic

Sinusoidal

Random

BASIC SEQUENCESBASIC SEQUENCES

Unit sample sequence -

Unit step sequence -

0,0

0,1][

n

nn

1

–4 –3 –2 –1 0 1 2 3 4 5 6n

0,0

0,1][

n

nn

–4 –3 –2 –1 0 1 2 3 4 5 6

1

n

BASIC SEQUENCESBASIC SEQUENCES Real sinusoidal sequence -

where A is the amplitude, is the angular frequency, and is the phase of x[n]Example -

)cos(][ nAnx o

o

0 10 20 30 40-2

-1

0

1

2

Time index n

Am

plitu

de

o = 0.1

INTRO. TO DISCRETE-TIME SYSTEMS The difference equation, the impulse response and the

system function are equivalent characterization of the input/output relation of a LTI Discrete-time systems.

LTI system can be modeled using :

1. A Difference/Differential equation, y(n) = x[n] + x[n-1] + …

2. Impulse Response, h(n)

3. Transfer Function, H(z) The systems that described by the difference equations

can be represented by structures consisting of an interconnection of the basic operations of addition, multiplication by a constant or signal multiplication, delay and advance.

DISCRETE-TIME SYSTEMS

DISCRETE-TIME SYSTEMS

The Adder, Multiplier, Delay & Advance is shown below:

1. Adder :1. Adder :

2. Multiplier : 2. Multiplier : Modulator:Modulator:

3. Delay :3. Delay :

4. Advance :4. Advance :

Time In-variant & Time-variant block diagram :

=> Time-Invariant

=> Time-variant

=> Time-variant

=> Time-variant

Aliasing Unable to distinguish two continuous signals with

different frequencies based on samples Frequencies higher than Nyquist frequency

Anti-aliasing Low-pass filter the frequencies above Nyquist

frequency

DISCRETE-TIME SYSTEM

Discrete-time system has discrete-time input and output signals

DIGITAL SYSTEM

A discrete-time system is digital if it operates on discrete-time signals whose amplitudes are quantized

Quantization maps each continuous amplitude level into a number

The digital system employs digital hardware1. explicitly in the form of logic circuits2. implicitly when the operations on the

signals are executed by writing a computer program

Discrete-time (DT) system is `sampled data’ system:

Input signal u[k] is a sequence of samples (=numbers)

..,u[-2],u[-1],u[0],u[1],u[2],…

System then produces a sequence of output samples y[k]

..,y[-2],y[-1],y[0],y[1],y[2],…

Will consider linear time-invariant (LTI) DT systems: Linear :

input u1[k] -> output y1[k]

input u2[k] -> output y2[k]

hence a.u1[k]+b.u2[k]-> a.y1[k]+b.y2[k]

Time-invariant (shift-invariant)

input u[k] -> output y[k], hence input u[k-T] -> output y[k-T]

u[k] y[k]

Causal systems: iff for all input signals with u[k]=0,k<0 -> output y[k]=0,k<0

Impulse response: input …,0,0,1,0,0,0,...-> output …,0,0,h[0],h[1],h[2],h[3],...

General input u[0],u[1],u[2],u[3]: (cfr. linearity & shift-invariance!)

]3[

]2[

]1[

]0[

.

]2[000

]1[]2[00

]0[]1[]2[0

0]0[]1[]2[

00]0[]1[

000]0[

]5[

]4[

]3[

]2[

]1[

]0[

u

u

u

u

h

hh

hhh

hhh

hh

h

y

y

y

y

y

y

`Toeplitz’ matrix

Convolution:

]3[

]2[

]1[

]0[

.

]2[000

]1[]2[00

]0[]1[]2[0

0]0[]1[]2[

00]0[]1[

000]0[

]5[

]4[

]3[

]2[

]1[

]0[

u

u

u

u

h

hh

hhh

hhh

hh

h

y

y

y

y

y

y

u[0],u[1],u[2],u[3] y[0],y[1],...

h[0],h[1],h[2],0,0,...

][*][][.][][ kukhiuikhkyi

= `convolution sum’

Z-Transform:

i

izihzH ].[)(

]3[

]2[

]1[

]0[

.

]2[000

]1[]2[00

]0[]1[]2[0

0]0[]1[]2[

00]0[]1[

000]0[

.1

]5[

]4[

]3[

]2[

]1[

]0[

.1

3211).()(

5432154321

u

u

u

u

h

hh

hhh

hhh

hh

h

zzzzz

y

y

y

y

y

y

zzzzz

zzzzHzY

i

iziyzY ].[)(

i

iziuzU ].[)(

)().()( zUzHzY H(z) is `transfer function’

Z-Transform : input-output relation may be viewed as `shorthand’ notation (for convolution operation/Toeplitz-vector

product) stability bounded input u[k] -> bounded output y[k] --iff

--iff poles of H(z) inside the unit circle (for causal,rational systems)

)().()( zUzHzY

k

kh ][

Example-1 : `Delay operator’ Impulse response is …,0,0,0, 1,0,0,0,…

Transfer function is

Example-2 : Delay + feedback Impulse response is …,0,0,0, 1,a,a^2,a^3…

Transfer function is

1)( zzH

u[k]

y[k]=u[k-1]

x

+

a

u[k]

y[k]

1

1

11

433221

.1)(

)(.)(

......)(

za

zzH

zzHzazH

zazazazzH

LINEAR TIME-INVARIANT (LTI) SYSTEM

Discrete-time system is LTI if its input-output relationship can be described by the linear constant coefficients difference equation

The output sample y() might depend on all input samplesthat can be represented as

))(()( kxy

top related