41
Fakultät Informatik – Institut für Systemarchitektur – Professur Rechnernetze Introduction to Digital Signal Processing Waltenegus Dargie Waltenegus Dargie TU Dresden Chair of Computer Networks

Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

  • Upload
    others

  • View
    11

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Fakultät Informatik – Institut für Systemarchitektur – Professur Rechnernetze

Introduction to Digital Signal Processing

Waltenegus DargieWaltenegus DargieTU DresdenChair of Computer Networks

Page 2: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer
Page 3: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer
Page 4: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

In 45 Minutes

Page 5: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

References

• Discrete-Time Signal Processing. Alan V. O h i d R ld W S h fOppenheim and Ronald W. Schafer. McGraw Hill. Pearson Education. 3rd

diti (2009)edition (2009). • Understanding Digital Signal Processing.

Richard G. Lyons. Prentice Hall. 2nd Edition (2004).

• Digital Signal Processing. International Version. John G. Proakis John G. Proakis and Dimitris K Manolakis. Pearson Education. 4th edition (2009)( )

5

Page 6: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Useful Equations

• Euler’s formula/theorem

( ) ( )ωω

ωωω

22 sincos1)sin()cos(

+=

+= je j

• Even and odd sinusoidal functions( ) ( )

( ) ( )( ) ( )( ) ( )ωω

ωωsinsin

coscos−=−

=−

• Time domain convolution Frequency domain multiplication and vice versa

[ ] [ ] [ ]ΩΩ=Ω→−= ∑∞

∞−=

HXYknhkxnyk

][][][∞−=k

6

Page 7: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Useful Equations

• The geometric series:

11 )1(−

=+

∑ ααα

nni AA

1||:1

11

1

1)1(

0

lim ≤=−

−+

=

ααα

α

αn

i

• Partial fraction decomposition (expansion)11 −−∞→ ααn

BAaxax ++exdxexdxcbxx +

+−

=+−

=−− )()(2

7

Page 8: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Outline

• Motivation • Sampling • Discrete signals g• Discrete-time systems• The Z transform• The Z-transform• Digital filters• Discrete Fourier Transform

8

Page 9: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Motivation

• Why do we need signal processing?– Signal acquisition and propagation entails

signal distortions and corruptions at various stagesstages

9

Page 10: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Motivation

• Correct Distortion: De-blur• Signal Decomposition: Separating

messages or messages from noise• Feature Enhancement: Boost signal

components, sharpen images, etc.p , p g ,• Noise Reduction: Smoothing• Signal Analysis: Transitions patterns• Signal Analysis: Transitions, patterns,

peaks, frequency distribution, etc.Si l C i Si l E ti• Signal Compression: Signal Encryption

10

Page 11: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Motivation

• Analogue signal processing:– Long term drift (ageing) – Short term drift (temperature)– Sensitivity to voltage instability.

• Digital signal processing:– No short or long term drifts– Relative immunity to minor power supply y p pp y

variations. – Virtually identical components. – Software reconfigurable

11

Page 12: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Motivation

• A large number of naturally occurring and d i l i flmanmade signal influences are:

– Time invariant– Linear (obey the superposition theorem)

• These properties are called Linear Time Invariant Systems (LTI)

12

Page 13: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Motivation

• LTI systems can be fully characterised by l ticonvolution

• Convolution is greatly simplified by Fourier (harmonic) decomposition– The Fast Fourier Transform, which was

rediscovered by Cooley and Tukey in the 60's, enable the efficient analysis of spectral aspects of signals and systemsaspects of signals and systems

• In DSP, system analysis and synthesis are d b i l dditi dmade by simple additions and

multiplications

13

Page 14: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Sampling

∑∞

−= )()( nTtts δ

Conversion from

∞−

T

impulse train to discretetime sequence

X

)(tx )(txs ( )nTxnx s=][

∑∑∞

−∞=

−∞=

−=−==nn

s nTtnTxnTttststxtx )()()()()()()( δδt

( ) ( )=s

nn

jSjXjX *)(21 ωωπ

ω

( ) ( )( ) ( )∑∞

∞−=

−=k

s jXkjT

jS ;2 ωωωδπω

( ) ∑∞

∞−=

−=k

ss kXjX )( ωωω 14

Page 15: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Sampling

Xω(j) Fourier Transform of

ω

continuous function

ωN-ω N

XS(jω)ωS > 2 ωNFourier Transform of

sampled function

ωωN- ωN ωS-ωS 2ωS-2ωS ωNωN ωSωS 2ωS2ωS

XS(jω)ΩS < 2 ΩN(aliasing)

ω

( g)

15

ωS- ωS 2ωS-2 ωS

Page 16: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Sampling

• Given a band limited signal, x(t), such that X(j ) 0 f | | ≥ | | Th (t) bX(jω) = 0 for |ω| ≥ |ωN|. Then x(t) can be uniquely determined from its samples

[ ] ∞<<∞−= nnTxnx ),(

Nωπω 22≥= Ns T

ωω 2≥

• ωN is called the Nyquist frequency and• 2ωN Nyquist rateN yq

16

Page 17: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Basic Discrete Signals

• Delaying (Shifting) a sequence

• Unit sample (impulse) sequence]nn[x]n[y o−=

p ( p ) q

⎩⎨⎧ ≠

=δ0n10n0

]n[

• Unit step sequence⎩ = 0n1

⎩⎨⎧

≥<

=0n10n0

]n[u

• Exponential sequences:nAnx α=][

17

Page 18: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Basic Discrete Signals

• Sinusoidal sequence

• Suppose the exponential sequence has [ ] ( )φ+ω= ncosnx o

pp p qthe following components:

φωαα jj eAAe o ; φαα jj eAAe o == ;

[ ] ( )α=α=α= φ+ωωφ eAeeAAnx njnnjnjn oo

[ ] ( ) ( )φ+ωα+φ+ωα= nsinAjncosAnx on

on

• If x[n] becomes1=α

[ ] ( ) ( )φφ +++ AjA i18

[ ] ( ) ( )φωφω +++= nAjnAnx oo sincos

Page 19: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Basic Discrete Signals

• Consider a frequency ( )πω 20 +

njwnjnjwnj AeeAeAenx o 00 2)2(][ === + ππω

• More generally, for any integer k, ( ) kπω 20 +

njwknjnjwnkj AeeAeAenx o 00 2)2(][ === + ππω

• The same is true for sinusoidal sequences:

[ ] ( )[ ] ( )ϕωϕπω +=++= nAnkAnx oo cos2cos

19

Page 20: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Basic Discrete Signals

• So it is sufficient to consider frequencies i i t l f ≤ ≤ 0 ≤ ≤ 2in an interval of: -π ≤ ω0 ≤ π or 0 ≤ ω0 ≤ 2π

• However, discrete-time sinusoid signals are not necessarily periodic in n: y p

KNiffAeAeNnxnx njwNnj o πωω 2][][ 0)( 0 ===+= +

2 kN πshould be an integer

o

=

20

Page 21: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Discrete-Time Systems

• A discrete time system

]}n[x{T]n[y = T{.}x[n] y[n]

– Ideal Delay System

][][

– Moving (Running) Average

]nn[x]n[y o−=

Moving (Running) Average

]3n[x]2n[x]1n[x]n[x]n[y −+−+−+=

21

Page 22: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Discrete-Time Systems

• Memory-less System– The output y[n] at every value of n depends

only on the input x[n] at the same value of nS• Square

( )2]n[x]n[y =

• Counter example– Ideal Delay System

]nn[x]n[y o−= o

22

Page 23: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Discrete-Time Systems

• Linear discrete system: obeys scaling and th iti ththe superposition theorem

{ } { }{ } { }

][][]}[][{ 2121 nxTnxTnxnxT +=+

• If the system is time-invariant (shift-

{ } { } ][][ nxaTnaxT =

If the system is time invariant (shiftinvariant), a time shift at the input causes corresponding time-shift at the outputcorresponding time shift at the output

{ } ][][][T]}[{T]nn[x]nn[x]}n[x]n[x{T o2o121 −+−=+

{ }{ }{ } ]nn[ax]n[xaT

]nn[ax]n[axT]nn[x]nn[x]n[xT]}n[x{T

o1

o2o112

−=−+−=+

{ } ]nn[ax]n[xaT o1 −=23

Page 24: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Discrete-Time Systems

• A linear time invariant discrete system (LTI) l t l b h t i d b(LTI) can completely be characterised by its impulse response:

][][]}[{][ knkxTnxTnyk ⎭

⎬⎫

⎩⎨⎧

−== ∑∞

∞−=

δ

{ }][][ knTkxk

−=

⎭⎩

∑∞

∞−=

δ

][][ knhkxk

−= ∑∞

∞−=

][*][ nnnx=

24

Page 25: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Z-Transform• Often, one is confronted with questions

pertaining to a signal’s propertypertaining to a signal s property– Does it converge?

To which value does it converge?– To which value does it converge? – How fast does it converge?

• The Z-Transform• The Z-Transform– Is a mapping from a discrete signal to a

function of z

∑∞

−= ][)( nznxzX– Where: = 0n

( ) ( )[ ]ωωω sincos jAAez j +== ( ) ( )[ ]ωω sincos jAAez +25

Page 26: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Z-Transform• In most cases X(z) can be expressed as

followsfollows

∑n

ii za

∑== m

jj

i

zbzX 0)(

• ROC– Defines the poles and zeros for which the

t i t

=j 0

system is convergent

⎪⎫⎪⎧ ∞

⎪⎭

⎪⎬⎫

⎪⎩

⎪⎨⎧

∞<= ∑∞

=

0

][:n

nznxzROC

26

Page 27: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Z-Transform

• Unit impulse

( )nδ

X[0] = 1

X[1] = 0

X[2] = 0

1 · z0

+0 · z-1

+0 z-2X[2] = 0

X[3] = 0

X[4] = 0

+0 · z 2

+0 · z-3

+0 · z-4

… …

-1 0 1 2 3 4 5 6 7 8 90

0.5

1

1(z) =Δ1 0 1 2 3 4 5 6 7 8 9

27

Page 28: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Z-Transform

• Delayed Unit Impulse Signal

( )1−nδ

x[0] = 0

x[1] = 1

x[2] = 0

0 · z0

+1 · z-1

+0 z-2x[2] = 0

x[3] = 0

x[4] = 0

+0 · z 2

+0 · z-3

+0 · z-4

… …

1z(z) −=Δ

-1 0 1 2 3 4 5 6 7 8 90

0.5

1

1 0 1 2 3 4 5 6 7 8 9

28

Page 29: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Z-Transform

• Unit Step Signal

( ) ( )∑∞

=−=

0 00n

nnnu δ

x[0] = 1

x[1] = 1

x[2] = 1

1 · z0

+1 · z-1

+1 z-2x[2] = 1

x[3] = 1

x[4] = 1

+1 · z 2

+1 · z-3

+1 · z-4

… …

10

321

11...zzz1U(z) −

=

−−−−

−==++++= ∑ z

zi

i

-1 0 1 2 3 4 5 6 7 8 90

0.5

1

1 0 1 2 3 4 5 6 7 8 9

29

Page 30: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Z-Transform

• Exponential sequence

( ) nanx =

x[0] = 1

x[1] = a

x[2] = a2

1 · z0

+a· z-1

+a2 z-2x[2] = a2

x[3] = a3

x[4] = a4

+a2 · z 2

+a3 · z-3

+a4 · z-4

… …

33221

1...zzz1X(z)

=

++++= −−− aaa

2

3

4

5

6

a = 1 . 2

1-az-1=

- 1 0 1 2 3 4 5 6 7 8 90

1

30

Page 31: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Digital Filters

• Filters alter the spectral aspect of an input i lsignal

• Digital filters are software reconfigurable, and hence, will not drift with temperature or humidity and do not require precision components

31

Page 32: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Digital Filters

• There are four basic types– Lowpass, highpass, bandpass and bandstop

11

ffc fc

Lowpass Highpass

1 1

f1 f2 f1 f2

Bandpass BandstopBandpass32

Page 33: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Digital Filters

• In general, a filter can be characterised by it t f f tiits transfer function

( )( )

∑=== m

n

i

ii za

zYzH 0)( ( ) ∑=

m

j

jj zbzX

0

)(

33

Page 34: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Digital Filters

• In terms of realisation, they are classified i tinto– Finite impulse response (FIR):

• Operate on the input value• Perform a convolution of the filter coefficients with a

sequence of input values, producing an equallysequence of input values, producing an equally numbered sequence of output values.

– Infinite impulse response (IIR)• Operate on current and previous values of the input

as well as current and previous values of the output• Also called auto regressive moving average (ARMA)• Also called auto regressive moving average (ARMA)• The impulse response is infinite

34

Page 35: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Digital Filters

• FIR:

[ ] [ ] [ ] [ ]21 ++ bbb[ ] [ ] [ ] [ ]21 310 −+−+= nxbnxbnxbny2

∑=

−=2

0

][][k

k knxbny

∑ −

=

=2

0

)()( kk

k

zbzXzY ∑= 0

)()(k

k zbzXzY

35

Page 36: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Digital Filters

• IIR

[ ] [ ] [ ] ][21 b++[ ] [ ] [ ] ][21 021 nxbnyanyany +−+−=

( )( ) 21

0

1)( −−==

zazab

zXzYzH ( ) 211 −− zazazX

36

Page 37: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Digital Filters

• IIR

b0 +

Z-1

X[n]y[n]+

y[n-1]

a1

Z-1

[ 2]a2

y[n-2]

37

Page 38: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

DFT

• A sequence of N complex numbers x0, ..., i t f d i t f NxN−1 is transformed into a sequence of N

complex numbers X0, ..., XN−1

• Unlike the discrete-time Fourier transform (DTFT), it only evaluates enough frequency components to reconstruct the finite segment that was analyzed.

• The input to the DFT is a finite sequence of real or complex numbersp

38

Page 39: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

DFT

2N π

1...,,1,0,][][0

2

−== ∑−

NkenxkXN nk

Nj π

0=n

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

−== ∑ NnekXN

nxN kn

Nj π

0∑=N k

39

Page 40: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Summary

• Sampling is the beginning of everything– The Nyquist rate has to be respected

• A precondition for frequency sampling is

2 kN π=

Thi i l th b i f DFT d FFTo

=

• This is also the basis for DFT and FFT

40

Page 41: Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References • Discrete-Time Signal Processing. Alan V. Ohi dRldWShfOppenheim and Ronald W. Schafer

Thanks for ListeningThanks for Listening41