Basics of Speech Signal Processing

advertisement
Basics of Signal Processing
SOURCE
SIGNAL
RECEIVER
ACTION
describe waves in terms of their significant features
understand the way the waves originate
effect of the waves
will the people in the boat notice ?
frequency = 1/T
l = speed of sound × T, where T is a period
sine wave
• period (frequency)
• amplitude
• phase
f (t) = Asin( 2t /T  )
f (t) = Asin( t  )
Phase F

sine cosine

Asin( t   /2)
= Acos(t)
Sinusoidal grating of image
TO
• Fourier idea
– describe the
signal by a sum
of other well
defined signals
Fourier Series
A periodic function as an infinite weighted
sum of simpler periodic functions!

f (t) =  w i f i (t)
i= 0
A good simple function
Ti=T0 / i
f i (t) = sin(i 0 t  ),
where  0 = 2 / T0

f (t) =  k i sin( i 0   n )
i=1

= [bi sin( i 0 )  ai cos(i 0 )]
i=1

= Re  cˆ i  e
i= 0
 j 0 n
, cˆ  complex
e.t.c. ad infinitum


i=1
i=1
f (t) =  k i sin( i 0   n ) = [bi sin( i 0 )  ai cos(i 0 )]
T=1/f
T=1/f
e.t.c……
e.t.c……
Fourier’s Idea
period T
period T
Describe complicated function as a weighted sum of simpler functions!
-simpler functions are known
-weights can be found
Simpler functions
T
- sines and cosines are orthogonal on period T,
 f(mt ) f(nt ) dt = 0 for m  n
0
i.e.
0
+
-
+
0
-
x
0
x
+
-
0
+
-
=
+
+
-
=
+
0
area is positive (T/2)
0 + -
+
-
area is zero

2it
2it 
2t
2t
4t
4t
6t
6t
f(t) = DC   a i cos(
)  b1 sin(
) =DC  a1 cos(
)  b1 sin(
)  a 2 cos(
)  b2 sin(
)  a 3 cos(
)  b3 sin(
)  .........

T
T 
T
T
T
T
T
T
i=1

T
2t
 f(t)sin( T )dt =
0
T
 {DC sin(
0
2t
2t
2t
2t
2t
4t
2t
4t
2t
)  a1 cos(
)sin(
)  b1 sin(
)sin(
)  a 2 cos(
)sin(
)  b 2 sin(
)sin(
)  .........}dt
T
T
T
T
T
T
T
T
T
0
=
area=b1T/2
area=b2T/2
0
b1T/2
0
0 ……………
f(t) = DC  f1(t)  f2 (t) = DC  b1  sin t  b2  sin 2t
area = DC
area = b1T/2
f(t)
area = b2T/2
f(t) sin(4πt)
f(t) sin(2πt)
T=2
T
+
+
-
+
+
-
+

+
-
+
-
+
-
-
+
+
+
+
+
T
2 t
sin
(
)
dt
=

T
2
0
Magnitude spectrum
0 1/T0 2/T0
frequency
Phase spectrum
0 1/T0 2/T0
frequency
Spacing of spectral components is f0 =1/T0
Aperiodic signal
T0   frequency spacing f 0  0
Discrete spectrum becomes continuous (Fourier integral)

sampling
ts=1/fs
22 samples per 4.2 ms

0.19 ms per sample  5.26 kHz
Sampling
T = 10 ms (f = 1/T=100 Hz)
> 2 samples per period,
fs > 2 f
Sinusoid is characterized by three parameters
1. Amplitude
2. Frequency
3. Phase
We need at least three samples per the period
Undersampling
T = 10 ms (f = 1/T=100 Hz)
ts = 7.5 ms (fs=133 Hz < 2f )
T’ = 40 ms
(f’= 25 Hz)
Sampling of more complex signals
highest frequency
component
period
period
Sampling must be at the frequency which is higher than the
twice the highest frequency component in the signal !!!
fs > 2 fmax
Sampling
1. Make sure you know what is the highest
frequency in the signal spectrum fMAX
2. Chose sampling frequency fs > 2 fMAX
NO NEED TO SAMPLE ANY FASTER !
T
Magnitude spectrum
0 1/T 2/T
frequency
Periodicity in one domain implies discrete representation in the dual domain
Sampling in time implies periodicity in frequency !
T
F =1/ts
fs = 1/T
ts
frequency
time
DISCRETE FOURIER TRANSFORM
x ( n) =
N 1
1
N
 X (k )  e
n =0
j
2kn
N
X (k ) =
N 1
1
N
 x ( n)  e
j
2kn
N
n =0
Discrete and periodic in both domains (time and frequency)
Recovery of analog signal
Digital-to-analog converter (“sample-and-hold”)
Low-pass filtering
0.000000000000000
0.309016742003550
0.587784822932543
0.809016526452407
0.951056188292881
1.000000000000000
0.951057008296553
0.809018086192214
0.587786969730540
0.309019265716544
0.000000000000000
-0.309014218288380
-0.587782676130406
-0.809014966706903
-0.951055368282511
-1.000000000000000
-0.951057828293529
-0.809019645926324
-0.587789116524398
-0.309021789427363
-0.000000000000000
Quantization
11 levels
21 levels
111 levels
a part of vowel /a/
16 levels (4 bits)
32 levels (5 bits)
4096 levels (12 bits)
Quantization
• Quantization error = difference between the
real value of the analog signal at sampling
instants and the value we preserve
• Less error  less “quantization distortion”
Download