lecture 2 signals & systems review marc moonen & toon van waterschoot dept. e.e./esat,...
TRANSCRIPT
Lecture 2
Signals & Systems Review
Marc Moonen & Toon van Waterschoot
Dept. E.E./ESAT, K.U.Leuven
www.esat.kuleuven.be/scd/
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 2
Signals & Systems Review
• Discrete-Time/Digital Signals sampling, quantization, reconstruction
• Discrete-Time SystemsLTI, impulse response, convolution, z-transform, frequencyresponse, frequency spectrum, IIR/FIR
• Discrete/Fast Fourier Transform(I)DFT, FFT
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 3
Introduction: Digital Signal Processing?
• Signal = a physical quantity that varies as a function of some independent variable(s), e.g. time, position, frequency, …– 1-dimensional: speech signal, audio signal,
electromagnetic/radio signal, …– 2-dimensional: image, …– N-dimensional
• Processing = `filtering’ (mostly) = noise reduction, equalization, signal separation, …
• Digital = …in `digital domain’
her
e…
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 4
Introduction: Digital Signal Processing?
Analog Signal
Processing Circuit
Analog Domain (Continuous-Time Domain)
Analog signal processing
Analog IN Analog OUT
)(tu
dtetufU tfj ..2).()(
(=Spectrum/Fourier Transform)
)(ty
dtetyfY tfj ..2).()(
Jose
ph
Fo
uri
er (
1768
-183
0)
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 5
Introduction: Digital Signal Processing?
Analog-to-
Digital
Conversion
DSP
Digital-to-
Analog
ConversionAnalog IN Analog OUTDigital IN
Digital OUT
0110100101
1001100010
Digital signal processing in an analog world
Analog domain
Digital
domainAnalog domain
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 6
Discrete-Time/Digital Signals 1/10
Analog-to-
Digital
Conversion
DSP
Digital-to-
Analog
ConversionAnalog IN Analog OUTDigital IN
Digital OUT
0110100101
1001100010
sampling& quantization
reconstruction
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 7
k
sD Tkttxtx ).().()(
Discrete-Time/Digital Signal 2/10 : Sampling
• Time-domain samplingamplitude amplitude
discrete-time [k]continuous-time (t)
impulse train
).(][ sTkxkx )(tx
sT
It will turn out (page 27) that a spectrum can be computed from x[k], which (remarkably) will be equal to the spectrum (Fourier transform) of the (continuous-time) sequence of impulses =
discrete-time
signal
continuous-time
signal
0 1 2 3 4
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 8
Discrete-Time/Digital Signals 3/10 : Sampling
• Spectrum replication– time domain:
– frequency domain:
magnitude
frequency (f)
magnitude
frequency (f)
k
sD Tkttxtx ).().()(
k ss
D T
kfX
TfX )(.
1)(
)( fX )( fX D
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 9
Discrete-Time/Digital Signals 4/10 : Sampling
• Sampling theorem– analog signal spectrum X(f) has a bandwidth of fmax Hz
– spectrum replicas are separated by fs =1/Ts Hz
– no spectral overlap if and only if
magnitude
frequency
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 10
Discrete-Time/Digital Signals 5/10 : Sampling
• Sampling theorem– terminology:
• sampling frequency/rate fs
• Nyquist frequency fs/2
• sampling interval/period Ts
– e.g. CD audio: fs = 44,1 kHz
• Anti-aliasing prefilters– if then frequencies above the Nyquist
frequency are ‘folded’ into lower frequencies (=aliasing)– to avoid aliasing, sampling is usually preceded by a low-
pass (=anti-aliasing) filtering
Har
ry N
yqui
st (
7 fe
brua
ri 18
89 –
4 a
pril
1976
)
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 11
Discrete-Time/Digital Signals 6/10 : Quantization
• B-bit quantization
amplitude
discrete time [k]
0Q
2Q3Q
-Q-2Q-3Q
R
)1on width quantizati
range(log bits ofnumber 2
Q
RB
amplitude
discrete time [k]
quantized discrete-time signal
=digital signaldiscrete-time signal
][kx ][kxQ
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 12
Discrete-Time/Digital Signals 7/10 : Quantization
• B-bit quantization:
– the quantization error can only
take on values between and– hence can be considered as a random noise
signal (see below) with range – the signal-to-noise ratio (SNR) of the B-bit quantizer can
then be defined as the ratio of the signal range and the quantization noise range :
= the “6dB per bit” rule
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 13
Discrete-Time/Digital Signals 8/10 : Reconstruction
• Reconstructor = – ‘fill the gaps’ between adjacent samples– e.g. staircase reconstructor (with `hold’ circuit):
amplitude
discrete time [k]
amplitude
continuous time (t)
reconstructed
analog signal
discrete-time/digital signal
][kx )(txR
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 14
Discrete-Time/Digital Signals 9/10 : Reconstruction
• Ideal reconstructor =– Ideal (rectangular) low-pass filter– no distortion
magnitude
frequency (f)
magnitude
frequency
• Staircase reconstructor =– sinc-like low-pass filter with sidelobes– distortion due to spurious high frequencies
magnitude
frequency (f)
)( fX D
)( fX D
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 15
Discrete-Time/Digital Signals 10/10 : Reconstruction
• Anti-image post-filter– low-pass filter succeeds reconstructor, to remove spurious
high frequency components due to non-ideal reconstruction
• Complete scheme is…
Digital OUT
Analog IN
DSPDigital
IN
sampler quantizeranti-
aliasing prefilter
anti-image
postfilterreconstructor
Analog OUT
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 16
Discrete-Time Systems 1/15
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],…
Example: `DSP’ block in previous slide
u[k] y[k]
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 17
Discrete-Time Systems 2/15
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]
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 18
Discrete-Time Systems 3/15
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
this is called a
`Toeplitz’ matrix
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 19
Discrete-Time Systems 4/15
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’
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 20
Discrete-Time Systems 5/15
Z-Transform of system h[k] and signals u[k],y[k]
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’
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 21
Discrete-Time Systems 6/15
Z-Transform• easy input-output relation:
• may be viewed as `shorthand’ notation (for convolution operation/Toeplitz-vector product)
• stability =bounded input u[k] leads to bounded output y[k] --iff
--iff poles of H(z) inside the unit circle (now z=complex variable) (for causal,rational systems, see below)
)().()( zUzHzY
k
kh ][
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 22
Discrete-Time Systems 7/15
Example-1 : `Delay operator’ Impulse response is …,0,0 ,0, 1,0,0,0,…
Transfer function is Pole at z=0
Example-2 : Delay + feedback Impulse response is …,0,0 ,0, 1,a,a^2,a^3…
Transfer function is
Pole at z=a
1)( zzH
u[k]
y[k]=u[k-1]
x
+
a
u[k]
y[k]
azza
zzH
zzHzazH
zazazazzH
1
.1)(
)(.)(
......)(
1
1
11
433221
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 23
Discrete-Time Systems 8/15
Will consider only rational transfer functions: • In general, these represent `infinitely long impulse response’ (`IIR’)
systems• N poles (zeros of A(z)) , N zeros (zeros of B(z))• corresponds to difference equation
• Hence rational H(z) can be realized with finite number of delay elements, multipliers and adders
NN
NN
NNN
NNN
zaza
zbzbb
zazaz
bzbzb
zA
zBzH
...1
...
...
...
)(
)()(
11
110
11
110
][....]1[.][....]1[.][.][ 110 NkyakyaNkubkubkubky NN
...)().()().()().()( zUzBzYzAzUzHzY
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 24
Discrete-Time Systems 9/15
Special case is
• N poles at the origin z=0 (hence guaranteed stability) • N zeros (zeros of B(z)) = `all zero’ filters• corresponds to difference equation
=`moving average’ (MA) filters• impulse response is
= `finite impulse response’ (`FIR’) filters
][....]1[.][.][)().()( 10 NkubkubkubkyzUzHzY N
,...0,0,0,,,...,,,0,0,0 110 NN bbbb
NNNzbzbb
z
zBzH ...
)()( 1
10
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 25
H(z) & frequency response:• given a system H(z)• given an input signal = complex sinusoid
• output signal : = `frequency response’ = complex function of radial frequency ω = H(z) evaluated on the unit circle
)sin(.)cos(
][
kjk
keku kj
)(].[][ ].[)(].[][].[ j
i
ijeihkj
ei
ikjeihi
ikuih eHkuky
)( jeH
Discrete-Time Systems 10/15
Re
u[0]=1
u[2] u[1]
Im
Im
Re
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 26
-4 -2 0 2 40
0.5
1
-4 -2 0 2 4-5
0
5
Discrete-Time Systems 11/15
H(z) & frequency response:• periodic : period = • for a real impulse response h[k]
Magnitude response is even function
Phase response is odd function
• example (`low pass filter’):
)( jeH
)( jeH
Nyquist frequency
,...1,1,1,1,1..., kje
2
)( jeH
(=2 samples/period)
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 27
Discrete-Time Systems 12/15
• H(z) & Fourier transform– the frequency response of an LTI system is equal to the
Fourier transform of the continuous-time impulse sequence (see p.7) constructed with h[k] :
– similarly, the frequency spectrum of a discrete-time signal (=its z-transform evaluated at the unit circle) is equal to the Fourier transform of the continuous-time impulse sequence constructed with u[k], y[k] :
• Input/output relation: )().()( jjj eUeHeY
k s
jsD f
feHTktkhth .2 , )(...)}.(].[{)}({ FF
k s
jsD f
feUTktkutu .2 , )(...)}.(].[{)}({ FF
)(),( jj eYeU
)( jeH
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 28
Discrete-Time Systems 13/15
• Example: All-pass filter– a (unity-gain) all-pass filter is a filter that passes all input
signal frequencies without gain or attenuation
– hence a (unity-gain) all-pass filter preserves signal energy
– an all-pass filter may have any phase response
kk
kyku22
][][
1)( jeH
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 29
Discrete-Time Systems 14/15
• Example: Biquadratic (=2nd order) all-pass filter– it can be shown that for the unity-gain constraint to hold,
the denominator coefficients must equal the numerator coefficients in reverse order, i.e.,
– the poles and zeros are then related as follows
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 30
Discrete-Time Systems 15/15
• PS: – So far have only considered single-input/single-output
(SISO) systems
– Similar equations for multiple-input/multiple-output (MIMO) systems
– Example : 2-inputs, 3 outputs
)().()( zUzHzY
)().()( zzz UHY
)(
)(.
)()(
)()(
)()(
)(
)(
)(
2
1
3231
2221
1211
3
2
1
zX
zX
zHzH
zHzH
zHzH
zY
zY
zY
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 31
Discrete/Fast Fourier Transform 1/5
• DFT definition:– the frequency spectrum/response of a discrete-time
signal/system x[k] is a (periodic) continuous function of the radial frequency ω
– The `Discrete Fourier Transform’ (DFT) is a discretized version of this, obtained by sampling ω at N uniformly spaced frequencies (n=0,1,..,N-1) and by truncating x[k] to N samples (k=0,1,..,N-1)
= DFT
jez
k
k
j zkxeX
].[)(
Nnn /2
kN
njN
k
N
nj
ekxeX 21
0
2
].[)(
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 32
Discrete/Fast Fourier Transform 2/5
• Inverse discrete Fourier transform (IDFT):– an -point DFT can be calculated from an -point time
sequence:
– vice versa, an -point time sequence can be calculated from an -point DFT:
= IDFT
= DFT
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 33
Discrete/Fast Fourier Transform 3/5
• DFT/IDFT in matrix form– Using shorthand notation..
– ..the DFT can be rewritten as
– an -point DFT requires complex multiplications
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 34
Discrete/Fast Fourier Transform 4/5
• DFT/IDFT in matrix form– Using shorthand notation..
– ..the IDFT can be rewritten as
– an -point IDFT requires complex multiplications
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 35
Discrete/Fast Fourier Transform 5/5
• Fast Fourier Transform (FFT) (1805/1965)
– divide-and-conquer approach: • split up N-point DFT in two N/2-point DFT’s• split up two N/2-point DFT’s in four N/4-point DFT’s• …• split up N/2 2-point DFT’s in N 1-point DFT’s• calculate N 1-point DFT’s• rebuild N/2 2-point DFT’s from N 1-point DFT’s• …• rebuild two N/2-point DFT’s from four N/4-point DFT’s• rebuild N-point DFT from two N/2-point DFT’s
– DFT complexity of multiplications is reduced to
FFT complexity of multiplications
Jam
es W
. Coo
ley
John
W.T
ukey
Car
l Frie
dric
h G
auss
(17
77-1
855
DSP-IIVersion 2009-2010 Lecture-2: Signals & Systems Review p. 36
Need more?
• Introductory books– S. J. Orfanidis, “Introduction to Signal Processing”, Prentice-Hall
Signal Processing Series, 798 p., 1996– J. H. McClellan, R. W. Schafer, and M. A. Yoder, “DSP First: A
Multimedia Approach”, Prentice-Hall, 1998– P. S. R. Diniz, E. A. B. da Silva and S. L. Netto, “Digital Signal
Processing: System Analysis and Design”, Cambridge University Press, 612 p., 2002
• Online books– Smith, J.O. Mathematics of the Discrete Fourier Transform (DFT),
http://ccrma.stanford.edu/~jos/mdft/, 2003, ISBN 0-9745607-0-7. – Smith, J.O. Introduction to Digital Filters, August 2006 Edition,
http://ccrma.stanford.edu/~jos/filters06/.