Sei sulla pagina 1di 24

Fundamentals of digital signal processing

Fundamentals of digital signal processing 1
Sound modeling
Sound modeling

soundSound modeling symbols aims analysis synthesis processing classification: signal models source models abstract models 2

symbolsSound modeling sound aims analysis synthesis processing classification: signal models source models abstract models 2

aimsSound modeling sound symbols analysis synthesis processing classification: signal models source models abstract models 2

analysisSound modeling sound symbols aims synthesis processing classification: signal models source models abstract models 2

synthesisSound modeling sound symbols aims analysis processing classification: signal models source models abstract models 2

processingSound modeling sound symbols aims analysis synthesis classification: signal models source models abstract models 2

classification:Sound modeling sound symbols aims analysis synthesis processing signal models source models abstract models 2

signal modelsSound modeling sound symbols aims analysis synthesis processing classification: source models abstract models 2

source modelsSound modeling sound symbols aims analysis synthesis processing classification: signal models abstract models 2

abstract modelsSound modeling sound symbols aims analysis synthesis processing classification: signal models source 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
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 ec

sampling interval T-0.05 -0.05 0 500 0 10 20 0 10 20 0 500 t in µ s

sampling frequency f s = 1/T s = 1/T

x(n)

x(n)

x(n)

Digital signals: time representations
Digital signals: time representations

8000 samplesx(n) x(n) x(n) Digital signals: time representations 100 samples line with dots vertical quantization integer e.g.

100 samplesx(n) x(n) Digital signals: time representations 8000 samples line with dots vertical quantization integer e.g. -32768

line with dotssignals: time representations 8000 samples 100 samples vertical quantization integer e.g. -32768 32767 normalized

time representations 8000 samples 100 samples line with dots vertical quantization integer e.g. -32768 32767 normalized

vertical quantizationtime representations 8000 samples 100 samples line with dots integer e.g. -32768 32767 normalized e.g. -1

integersamples 100 samples line with dots vertical quantization e.g. -32768 32767 normalized e.g. -1 Q =

e.g. -32768

32767

normalizedwith dots vertical quantization integer e.g. -32768 32767 e.g. -1 Q = quantization step (1-Q) 0.5

e.g. -1

Q = quantization step

(1-Q)

0.5

0

-0.5

0.5

0

-0.5

0.05

0

-0.05

= quantization step (1-Q) 0.5 0 -0.5 0.5 0 -0.5 0.05 0 -0.05 0 1000 2000
0 1000 2000 3000 4000 5000 6000 7000 8000
0
1000
2000
3000
4000
5000
6000
7000
8000
0 100 200 300 400 500 600 700 800 900 1000 0 10 20 30
0
100
200
300
400
500
600
700
800
900
1000
0
10
20
30
40
50
60
70
80
90
100

n

Spectrum: analog vs. digital signal
Spectrum: analog vs. digital signal
Spectrum: analog vs. digital signal sampling leads to a replication of the baseband spectrum 5

sampling leads to a replication of the baseband spectrum

Spectrum: analog vs. digital signal sampling leads to a replication of the baseband spectrum 5

5

Spectrum: analog vs. digital signal
Spectrum: analog vs. digital signal

Sampling leads to a replication of the analog signal spectrumSpectrum: analog vs. digital signal Reconstruction of the analog signal: low pass filtering the digital signal

Reconstruction of the analog signal:vs. digital signal Sampling leads to a replication of the analog signal spectrum low pass filtering

a replication of the analog signal spectrum Reconstruction of the analog signal: low pass filtering the

low pass filtering the digital signal

a replication of the analog signal spectrum Reconstruction of the analog signal: low pass filtering the

6

Discrete Fourier Transform
Discrete Fourier Transform
Discrete Fourier Transform Magnitude Phase 7
Discrete Fourier Transform Magnitude Phase 7

MagnitudeDiscrete Fourier Transform Phase 7

Discrete Fourier Transform Magnitude Phase 7

PhaseDiscrete Fourier Transform Magnitude 7

Discrete Fourier Transform Magnitude Phase 7
Discrete Fourier Transform (example) FFT with 16 points 1 Cos ine s ignal x(n) cosine
Discrete Fourier Transform (example)
FFT with 16 points
1
Cos ine s ignal x(n)
cosine (16 points)
0
-1
0 2
4
6
8
10
12
14
16
n
magnitude (16 points)
1
Magnitude s pectrum |X(k)|
normalization:
0.5
0 dB for sinusoid ±1
0
0 2
4
6
8
10
12
14
16
magnitude
(frequency points)
k
1
Magnitude s pectrum |X(f)|
0.5
kfs / N
0
c)
b)
a)

step f s /N s /N

magnitude dB vs. Hzpectrum |X(f)| 0.5 kfs / N 0 c) b) a) step f s /N 0 0.5

kfs / N 0 c) b) a) step f s /N magnitude dB vs. Hz 0
0 0.5 1 1.5 2 2.5 3 3.5 f in Hz x 10 4 20
0
0.5
1
1.5
2
2.5
3
3.5
f in Hz
x
10 4
20
Magnitude s pectrum |X(f)| in dB
0
-20
-40
0
0.5
1
1.5
2
2.5
3
3.5
f in Hz
x 10 4
|X(f)| in dB
Inverse Discrete Fourier Transform (DFT)
Inverse Discrete Fourier Transform (DFT)
Inverse Discrete Fourier Transform (DFT) if X(k) = X*(N-k) then IDFT gives N discrete-time real values
Inverse Discrete Fourier Transform (DFT) if X(k) = X*(N-k) then IDFT gives N discrete-time real values

if X(k) = X*(N-k) then IDFT gives N discrete-time real values x(n)

Frequency resolution
Frequency resolution
Frequency resolution Zero padding: to increase frequency resolution 8 s amples 8-point FFT 10 2 8

Zero padding: to increase frequency resolution

8 s amples

8-point FFT

10 2 8 1 6 4 0 2 -1 0 0 2 4 6 0
10
2
8
1
6
4
0
2
-1
0
0
2
4
6
0
2
4
6
8 s amples + zero-padding
16-point FFT
10
2
8
1
6
4
0
2
-1
0
0
5
10
15
0
5
10
15
n
k
x(n)
x(n)
|X(k)|
|X(k)|
Window functions to reduce leakage: weight audio samples by a window Hamming window w H
Window functions
to reduce leakage:
weight audio samples by
a window
Hamming window
w H (n) = 0.54 – 0.46 cos(2 n/N)

Blackman window w B (n) = 0.42 – 0.5cos(2 n/N) + 0.08(4 n/N) B (n) = 0.42 – 0.5cos(2 n/N) + 0.08(4 n/N)

Window
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.

zero-padding applied to z(n) w(n) up to length N = 16 The corresponding spectra are shown
Spectrograms
Spectrograms
1 3
1
3

x(n)

Waterfall representation S ignal x(n) 1
Waterfall representation
S ignal x(n)
1
x(n) Waterfall representation S ignal x(n) 1 0.5 0 -0.5 -1 0 1000 2000 3000 4000

0.5

0

-0.5

-1

0 1000 2000 3000 4000 5000 6000 7000 8000
0
1000
2000
3000
4000
5000
6000
7000
8000

n

Waterfall Repres entation of S hort-time FFTs

0 -50 0 2000 -100 4000 6000 0 5 10 15 20 n Magnitude in
0
-50
0
2000
-100
4000
6000
0
5
10
15
20
n
Magnitude in dB

f in Hz

Digital systems 1 5

Digital systems

Definitions
Definitions

Unit impulseDefinitions Impulse reponse h(n) = output to a unit impulse h(n) describes the digital sistem Discrete

Definitions Unit impulse Impulse reponse h(n) = output to a unit impulse h(n) describes the digital

Impulse reponse h(n) = output to a unit impulse h(n) describes the digital sistem h(n) = output to a unit impulse h(n) describes the digital sistem

reponse h(n) = output to a unit impulse h(n) describes the digital sistem Discrete convolution: y(n)=x(n)*h(n)

Discrete convolution:Unit impulse Impulse reponse h(n) = output to a unit impulse h(n) describes the digital sistem

y(n)=x(n)*h(n)

reponse h(n) = output to a unit impulse h(n) describes the digital sistem Discrete convolution: y(n)=x(n)*h(n)
reponse h(n) = output to a unit impulse h(n) describes the digital sistem Discrete convolution: y(n)=x(n)*h(n)
Algorithms and signal graphs
Algorithms and signal graphs

Delay e.g. y(n) = x(n-2) y(n) = x(n-2)

Algorithms and signal graphs Delay e.g. y(n) = x(n-2) Weighting factor e.g. y(n) = a x(n)
Algorithms and signal graphs Delay e.g. y(n) = x(n-2) Weighting factor e.g. y(n) = a x(n)

Weighting factorAlgorithms and signal graphs Delay e.g. y(n) = x(n-2) e.g. y(n) = a x(n) Addition e.g.

e.g. y(n) = a x(n) y(n) = a x(n)

Addition e.g. y(n) = a1 x(n) + a2 x(n) y(n) = a1 x(n) + a2 x(n)

signal graphs Delay e.g. y(n) = x(n-2) Weighting factor e.g. y(n) = a x(n) Addition e.g.
signal graphs Delay e.g. y(n) = x(n-2) Weighting factor e.g. y(n) = a x(n) Addition e.g.
signal graphs Delay e.g. y(n) = x(n-2) Weighting factor e.g. y(n) = a x(n) Addition e.g.
Simple digital system
Simple digital system
Simple digital system weighted sum over several input samples 1 8

weighted sum over several input samples

Simple digital system weighted sum over several input samples 1 8
Transforms
Transforms
Transforms Frequency domain desciption of the digital system Z transform Discrete time Fourier transform Transfer function

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)

Transfer function H(z) : Z transform of h(n) Frequency response : Discrete time Fourier transform of
Transfer function H(z) : Z transform of h(n) Frequency response : Discrete time Fourier transform of
Transfer function H(z) : Z transform of h(n) Frequency response : Discrete time Fourier transform of
Transfer function H(z) : Z transform of h(n) Frequency response : Discrete time Fourier transform of
Transfer function H(z) : Z transform of h(n) Frequency response : Discrete time Fourier transform of
Causal and stable systems
Causal and stable systems

Causality: a discrete-time system is causalCausal and stable systems if the output signal y(n) = 0 for n <0 u(n) =

if the output signal y(n) = 0 for n <0 y(n) = 0 for n <0

u(n) = 0 for n <0.

for a given input signal

This means that the system cannot react to an input before the input is applied to the systemn <0 u(n) = 0 for n <0. for a given input signal Stability: a digital

Stability: a digital system is stable ifreact to an input before the input is applied to the system stability implies that transfer

to the system Stability: a digital system is stable if stability implies that transfer function H(z)
to the system Stability: a digital system is stable if stability implies that transfer function H(z)

stability implies that transfer function H(z) and frequency response are related by

a digital system is stable if stability implies that transfer function H(z) and frequency response are
a digital system is stable if stability implies that transfer function H(z) and frequency response are

2 0

IIR systems
IIR systems
IIR systems = system with infinte impulse response e.g. second order IIR system Difference equation Transfer

= system with infinte impulse response

e.g. second order IIR systemIIR systems = system with infinte impulse response Difference equation Transfer function 2 1

IIR systems = system with infinte impulse response e.g. second order IIR system Difference equation Transfer
IIR systems = system with infinte impulse response e.g. second order IIR system Difference equation Transfer

Difference equationIIR systems = system with infinte impulse response e.g. second order IIR system Transfer function 2

IIR systems = system with infinte impulse response e.g. second order IIR system Difference equation Transfer
IIR systems = system with infinte impulse response e.g. second order IIR system Difference equation Transfer

Transfer functionIIR systems = system with infinte impulse response e.g. second order IIR system Difference equation 2

IIR systems = system with infinte impulse response e.g. second order IIR system Difference equation Transfer
IIR systems
IIR systems
IIR systems = system with infinte impulse response h(n) Difference equation Z transform of diff. eq.

= system with infinte impulse response h(n)

IIR systems = system with infinte impulse response h(n) Difference equation Z transform of diff. eq.

Difference equation

Z transform of diff. eq.

IIR systems = system with infinte impulse response h(n) Difference equation Z transform of diff. eq.

Transfer function

IIR systems = system with infinte impulse response h(n) Difference equation Z transform of diff. eq.

2 2

FIR systems
FIR systems
FIR systems = system with finite impulse response h(n) e.g. second order FIR system Difference equation

=

system with finite impulse response h(n) e.g. second order FIR system

finite impulse response h(n) e.g. second order FIR system Difference equation Z transform of diff. eq.
finite impulse response h(n) e.g. second order FIR system Difference equation Z transform of diff. eq.
finite impulse response h(n) e.g. second order FIR system Difference equation Z transform of diff. eq.

Difference equation

impulse response h(n) e.g. second order FIR system Difference equation Z transform of diff. eq. Transfer

Z transform of diff. eq.

Transfer function

impulse response h(n) e.g. second order FIR system Difference equation Z transform of diff. eq. Transfer
impulse response h(n) e.g. second order FIR system Difference equation Z transform of diff. eq. Transfer
Fir example
Fir example
Fir example computation of frequency response impulse response magnitude resp. pole/zero plot phase resp. (a) Impuls

computation of frequency response

impulse responseFir example computation of frequency response magnitude resp. pole/zero plot phase resp. (a) Impuls e Res

magnitude resp.example computation of frequency response impulse response pole/zero plot phase resp. (a) Impuls e Res pons

pole/zero plotof frequency response impulse response magnitude resp. phase resp. (a) Impuls e Res pons e h(n)

phase resp.response impulse response magnitude resp. pole/zero plot (a) Impuls e Res pons e h(n) 0.3 0.2

(a) Impuls e Res pons e h(n)

0.3

0.2

0.1

0

-0.1

phase resp. (a) Impuls e Res pons e h(n) 0.3 0.2 0.1 0 -0.1 0 2
0 2 4 n (c) P ole/Zero plot 1 4 0 -1 -1 0 1
0
2
4
n
(c) P ole/Zero plot
1
4
0
-1
-1
0
1
2
Im(z)

Re(z)

(b) Magnitude Res pons e |H(f)|

0.8 0.6 0.4 0.2 0 0 10 20 30 40 f in kHz (d) P
0.8
0.6
0.4
0.2
0
0
10
20
30
40
f in kHz
(d) P has e Res pons e H(f)
0
-0.5
-1
-1.5
-2
0
10
20
30
40
f
in kHz
H(f)/
|H(f)|