Fundamentals of digital signal processing - unipd.itmusica/IM/slidesIintroDSP.pdf · 4 Digital...
Transcript of Fundamentals of digital signal processing - unipd.itmusica/IM/slidesIintroDSP.pdf · 4 Digital...
1
Fundamentals of digital signalprocessing
2
Sound modeling
soundsymbols
aimsanalysissynthesisprocessing
classification:signal modelssource modelsabstract models
3
0 500-0.05
0
0.05x(t)
t in µs ec →0 10 20
-0.05
0
0.05
n →
x(n)
0 10 20-0.05
0
0.05
n →
y(n)
0 500-0.05
0
0.05
t in µs ec →
y(t)
Digital signals
analogsamplingprocessingreconstruction
sampling interval Tsampling frequency fs= 1/T
4
Digital signals: time representations
8000 samples100 samplesline with dots
vertical quantizationintegere.g. -32768 .. 32767normalizede.g. -1 .. (1-Q)Q = quantization step
0 1000 2000 3000 4000 5000 6000 7000 8000-0.5
0
0.5
x(n)
0 100 200 300 400 500 600 700 800 900 1000-0.5
0
0.5
x(n)
0 10 20 30 40 50 60 70 80 90 100-0.05
0
0.05
x(n)
n →
5
Spectrum: analog vs. digital signal
sampling leads to a replication of the baseband spectrum
6
Spectrum: analog vs. digital signal
Sampling leads to a replication of the analog signal spectrumReconstruction of the analog signal:
low pass filtering the digital signal
7
Discrete Fourier Transform
Magnitude
Phase
8
0 0.5 1 1.5 2 2.5 3 3.5
x 104
-40
-20
0
20
|X(f)
| in
dB →
f in Hz →
Magnitude s pectrum |X(f)| in dB
Discrete Fourier Transform (example)
FFT with 16 pointscosine (16 points)
magnitude (16 points)normalization:0 dB for sinusoid ±1
magnitude (frequency points)
step fs/N
magnitude dB vs. Hz
0 2 4 6 8 10 12 14 16
-1
0
1
a)
n →
Cos ine s ignal x(n)
0 2 4 6 8 10 12 14 16
0
0.5
1
b)
k →
Magnitude s pectrum |X(k)|
0 0.5 1 1.5 2 2.5 3 3.5
x 104
0
0.5
1
c)f in Hz →
Magnitude s pectrum |X(f)|
Nkfs /
9
Inverse Discrete Fourier Transform (DFT)
if X(k) = X*(N-k)then IDFT gives N discrete-time real values x(n)
10
Frequency resolution
Zero padding: to increasefrequency resolution
0 2 4 6
-1
0
1
2
x(n)
→
8 s amples
0 2 4 6
0
2
4
6
8
10
|X(k
)| →
8-point FFT
0 5 10 15
-1
0
1
2
n →x(
n) →
8 s amples + zero-padding
0 5 10 15
0
2
4
6
8
10
k →
|X(k
)| →
16-point FFT
11
Window functions
to reduce leakage:weight audio samples bya window
Hamming windowwH(n) = 0.54 – 0.46 cos(2πn/N)
Blackman windowwB(n) = 0.42 – 0.5cos(2πn/N) + 0.08(4πn/N)
12
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.
13
Spectrograms
14
Waterfall representation
0 1000 2000 3000 4000 5000 6000 7000 8000-1
-0.5
0
0.5
1S ignal x(n)
x(n)
→
n →
0 5 10 15 20
02000
40006000
-100
-50
0
Waterfall Repres entation of S hort-time FFTs
f in Hz →n →
Mag
nitu
de in
dB
→
15
Digital systems
16
Definitions
Unit impulse
Impulse reponse h(n) = output to a unit impulseh(n) describes the digital sistem
Discrete convolution:y(n)=x(n)*h(n)
17
Algorithms and signal graphs
Delaye.g. y(n) = x(n-2)
Weighting factore.g. y(n) = a x(n)
Additione.g.y(n) = a1 x(n) + a2 x(n)
18
Simple digital system
weighted sum over several input samples
19
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)
20
Causal and stable systems
Causality: a discrete-time system is causalif the output signal y(n) = 0 for n <0 for a given input signalu(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
21
IIR systems
= system with infinte impulse responsee.g. second order IIR system
Difference equation
Transfer function
22
IIR systems
= system with infinte impulse response h(n)
Difference equation
Z transform of diff. eq.
Transfer function
23
FIR systems
= system with finite impulse response h(n)e.g. second order FIR system
Difference equation
Z transform of diff. eq.
Transfer function
24
Fir example
computation of frequency response
impulse responsemagnitude resp.pole/zero plotphase resp. 0 2 4
-0.1
0
0.1
0.2
0.3
(a) Impuls e Res pons e h(n)
n →
-1 0 1 2
-1
0
1
Re(z)
Im(z
)
(c ) P ole/Zero plot
4
0 10 20 30 400
0.2
0.4
0.6
0.8
f in kHz →
|H(f)
| →
(b) Magnitude Res pons e |H(f)|
0 10 20 30 40-2
-1.5
-1
-0.5
0
f in kHz →
∠ H
(f)/ π→
(d) P has e Res pons e ∠ H(f)