Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References •...
Transcript of Introduction to Digital Signal Processing - TU Dresdendargie/papers/dsp2010.pdf · References •...
Fakultät Informatik – Institut für Systemarchitektur – Professur Rechnernetze
Introduction to Digital Signal Processing
Waltenegus DargieWaltenegus DargieTU DresdenChair of Computer Networks
In 45 Minutes
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
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
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
Outline
• Motivation • Sampling • Discrete signals g• Discrete-time systems• The Z transform• The Z-transform• Digital filters• Discrete Fourier Transform
8
Motivation
• Why do we need signal processing?– Signal acquisition and propagation entails
signal distortions and corruptions at various stagesstages
9
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
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
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
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
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
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
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
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
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
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
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
Nω
=
20
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Digital Filters
• FIR:
[ ] [ ] [ ] [ ]21 ++ bbb[ ] [ ] [ ] [ ]21 310 −+−+= nxbnxbnxbny2
∑=
−=2
0
][][k
k knxbny
∑ −
=
=2
0
)()( kk
k
zbzXzY ∑= 0
)()(k
k zbzXzY
35
Digital Filters
• IIR
[ ] [ ] [ ] ][21 b++[ ] [ ] [ ] ][21 021 nxbnyanyany +−+−=
( )( ) 21
0
1)( −−==
zazab
zXzYzH ( ) 211 −− zazazX
36
Digital Filters
• IIR
b0 +
Z-1
X[n]y[n]+
y[n-1]
a1
Z-1
[ 2]a2
y[n-2]
37
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
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
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
Nω
=
• This is also the basis for DFT and FFT
40
Thanks for ListeningThanks for Listening41