Fundamentals of digital signal
processing
1
Sound modeling
sound
symbols
aims
analysis
synthesis
processing
classification:
signal models
source models
abstract models
2
Digital signals
x(t) x(n) y(n) y(t)
analog 0.05 0.05 0.05 0.05
sampling
processing 0 0 0 0
reconstruction
-0.05 -0.05 -0.05 -0.05
0 500 0 10 20 0 10 20 0 500
t in µs ec n n t in µs e c
sampling interval T
sampling frequency fs= 1/T
3
Digital signals: time representations
8000 samples 0.5
100 samples
x(n)
0
line with dots -0.5
0 1000 2000 3000 4000 5000 6000 7000 8000
0.5
x(n)
0
-0.5
0 100 200 300 400 500 600 700 800 900 1000
0.05
vertical quantization x(n)
0
integer
e.g. -32768 .. 32767 -0.05
0 10 20 30 40 50 60 70 80 90 100
normalized n
e.g. -1 .. (1-Q)
Q = quantization step
4
Spectrum: analog vs. digital signal
sampling leads to a replication of the baseband spectrum
5
Spectrum: analog vs. digital signal
Sampling leads to a replication of the analog signal spectrum
Reconstruction of the analog signal:
low pass filtering the digital signal
6
Discrete Fourier Transform
Magnitude
Phase
7
Discrete Fourier Transform (example)
FFT with 16 points 1
Cos ine s ignal x(n)
0
cosine (16 points)
a)
-1
0 2 4 6 8 10 12 14 16
n
magnitude (16 points) 1
Ma gnitude s pe ctrum |X(k)|
normalization: 0.5
b)
0 dB for sinusoid ±1 0
0 2 4 6 8 10 12 14 16
magnitude 1
k
Ma gnitude s pe ctrum |X(f)|
(frequency points) 0.5
c)
kfs / N 0
0 0.5 1 1.5 2 2.5 3 3.5
step fs/N f in Hz x 10
4
20
magnitude dB vs. Hz Magnitude s pe ctrum |X(f)| in dB
0
|X(f)| in dB
-20
-40
0 0.5 1 1.5 2 2.5 3 3.5
f in Hz x 10
4
8
Inverse Discrete Fourier Transform (DFT)
if X(k) = X*(N-k)
then IDFT gives N discrete-time real values x(n)
9
Frequency resolution
Zero padding: to increase 8 s amples
10
8-point FFT
2
frequency resolution 8
1 6
|X(k)|
x(n)
4
0
2
-1
0
0 2 4 6 0 2 4 6
8 s amples + ze ro-pa dding 16-point FFT
10
2
8
1 6
|X(k)|
x(n)
4
0
2
-1
0
0 5 10 15 0 5 10 15
n k
10
Window functions
to reduce leakage:
weight audio samples by
a window
Hamming window
wH(n) = 0.54 – 0.46 cos(2 n/N)
Blackman window
wB(n) = 0.42 – 0.5cos(2 n/N) + 0.08(4 n/N)
11
Window
Reduction of the leakage effect by
window functions:
(a) the original signal,
(b) the Blackman window function
of length N =8,
(c) product x(n)w(n) with 0 n N-i,
(d) zero-padding applied to z(n)
w(n) up to length N = 16
The corresponding spectra are
shown on the right side.
12
Spectrograms
13
Waterfall representation
S ignal x(n)
1
0.5
0
x(n)
-0.5
-1
0 1000 2000 3000 4000 5000 6000 7000 8000
n
Waterfall Repres entation of S hort-time FFTs
0
Magnitude in dB
-50 0
2000
-100 4000
0 6000
5 10 15 20 n
f in Hz
14
Digital systems
15
Definitions
Unit impulse
Impulse reponse h(n) = output to a unit impulse
h(n) describes the digital sistem
Discrete convolution:
y(n)=x(n)*h(n)
16
Algorithms and signal graphs
Delay
e.g. y(n) = x(n-2)
Weighting factor
e.g. y(n) = a x(n)
Addition
e.g.
y(n) = a1 x(n) + a2 x(n)
17
Simple digital system
weighted sum over several input samples
18
Transforms
Frequency domain desciption of the digital system
Z transform
Discrete time Fourier
transform
Transfer function H(z):
Z transform of h(n)
Frequency response:
Discrete time Fourier
transform of h(n)
19
Causal and stable systems
Causality: a discrete-time system is causal
if the output signal y(n) = 0 for n <0 for a given input signal
u(n) = 0 for n <0.
This means that the system cannot react to an input before the
input is applied to the system
Stability: a digital system is stable if
stability implies that transfer function H(z) and frequency
response are related by
20
IIR systems
= system with infinte impulse response
e.g. second order IIR system
Difference equation
Transfer function
21
IIR systems
= system with infinte impulse response h(n)
Difference equation
Z transform of diff. eq.
Transfer function
22
FIR systems
= system with finite impulse response h(n)
e.g. second order FIR system
Difference equation
Z transform of diff. eq.
Transfer function
23
Fir example
computation of frequency response
(a ) Impuls e Re s pons e h(n) (b) Magnitude Res pons e |H(f)|
0.8
0.3
impulse response 0.2 0.6
magnitude resp. 0.1 0.4
|H(f)|
0
pole/zero plot 0.2
-0.1
0
phase resp. 0 2 4 0 10 20 30 40
n f in kHz
(c ) P ole/Zero plot (d) P ha s e Res pons e H(f)
0
1
-0.5
Im(z) 4
H(f)/
0 -1
-1.5
-1
-2
-1 0 1 2 0 10 20 30 40
Re (z) f in kHz
24