0% found this document useful (0 votes)
95 views15 pages

Implementation of Linear Predictive Coding (LPC) of Speech: Outline

This document summarizes the implementation of a linear predictive coding (LPC) algorithm for speech modeling and synthesis. It describes how speech is segmented into short frames and each frame is analyzed using the LPC algorithm to determine the linear predictive coefficients, gain, and voicing information. These parameters are then transmitted to an LPC synthesizer that can reconstruct the speech waveform. Key steps include frame blocking, autocorrelation analysis, the Levinson-Durbin algorithm to determine LPC coefficients, and pitch detection to determine voicing.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
95 views15 pages

Implementation of Linear Predictive Coding (LPC) of Speech: Outline

This document summarizes the implementation of a linear predictive coding (LPC) algorithm for speech modeling and synthesis. It describes how speech is segmented into short frames and each frame is analyzed using the LPC algorithm to determine the linear predictive coefficients, gain, and voicing information. These parameters are then transmitted to an LPC synthesizer that can reconstruct the speech waveform. Key steps include frame blocking, autocorrelation analysis, the Levinson-Durbin algorithm to determine LPC coefficients, and pitch detection to determine voicing.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

1

Implementation of Linear Predictive


Coding (LPC) of Speech
213A class project
Spring 2000
Jean Franois Frigon and Vladislav Teplitsky
Implementation of LPC
Outline
Introduction to
Speech Modeling
Introduction to
Speech Modeling
Architecture
Overview
Architecture
Overview
System
Demonstration
System
Demonstration
LPC
Algorithm
LPC
Algorithm
Pitch
Detection
Pitch
Detection
2
Speech Modeling Non-stationary
Implementation of LPC
Speech is a highly non-stationary signal
Dynamically changes over time
Changes occur very quickly
Speech Modeling Frame Blocking
Implementation of LPC
Need to analyze the signal over many short segments,
called frames
Apply a short-duration (usually 20-30 msec) overlapping
window (usually Hamming) to the speech signal in order
to segment into frames
A single frame of speech is stationary perform analysis
3
Implementation of LPC
Speech Modeling LTI Model
Source
Source
Transfer
Function
Transfer
Function
Radiation
Radiation sounds
LTI Model is valid for
moderately loud sounds
short speech segments frames (20 30 msec)
Speech Modeling Source (Voiced)
Implementation of LPC
Sounds are either voiced or unvoiced
Voiced (e.g. all vowels) sounds are
generated by vocal cords vibrations
These vibrations are periodic in time, thus
are approximated by an impulse train
Spacing between impulses is the pitch, F
0
F
0
Hz
4
Speech Modeling Source (Unvoiced)
Implementation of LPC
Unvoiced sounds (e.g. /sh/, /s/, /p/) are
generated without vocal cords vibrations
The excitation is modeled by a White
Gaussian Noise source
Unvoiced sounds have no pitch since they
are excited by a non-periodic signal
Implementation of LPC
Speech Modeling Transfer Function
Transfer function models the effects of the
vocal tract on the source signal
Transfer function is either all-pole (vowel
model) or pole-and-zero (consonant model)
Poles of the transfer function resonances
of the vocal tract - are called formants
Human auditory system is much more
sensitive to poles than to zeroes of the
transfer function
5
Speech Modeling Transfer Function
Implementation of LPC
We will consider only an all-pole transfer
function of the form:
where G is the gain, p is the order (number
of poles), and a
i
is the pole.
p 2Bandwidth of signal (in kHz)+[2,3,4]
e.g. BW=4 kHz, then
p = 24 + [2,3,4] [10,11,12]

=

=
p
i
i i
a a
G
z H
1
*
) 1 )( 1 (
) (
Implementation of LPC
Speech Modeling Transfer Function
Example: a 10
th
order transfer function
model:
6
Speech Modeling Radiation
Implementation of LPC
Models how sound is radiated by the lips
Usually approximated by a digital
differentiator:
Radiation is not important for classification
of a sound
Thus, we will omit it from our
implementation
1
1 ) (

= z z R
Implementation of LPC
Architecture Overview
Voice
Voice
Segmentation
Segmentation
Pitch
Detection
Pitch
Detection
LPC
LPC
Parameters:
Silence
LPC Coeff.
Gain
Voiced/Unvoiced
Pitch Frequency
Parameters:
Silence
LPC Coeff.
Gain
Voiced/Unvoiced
Pitch Frequency
Channel
Channel
LPC
Synthesizer
LPC
Synthesizer
7
Implementation of LPC
Voice Segmentation
20 ms
30 ms
Overlap
8000 samples/sec
20 ms step size (160 samples)
30 ms window (240 samples)
Process 240 samples in 20 ms
Implementation of LPC
Voice Segmentation - Filtering and Windowing
z
-1
-0.98
Segment
Samples
Hamming
Window
Coefficients
To Silence Detection,
LPC and Pitch
Detection
0 50 100 150 200 250
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
1 0
)
1
2
cos( 46 . 0 54 . 0 ) (
=

=
N n
N
n
n w

8
Implementation of LPC
Voice Segmentation - Silence Detection
Compute R(0)
Compute R(0)
Is R(0) > R(0)
for Background
Noise
Is R(0) > R(0)
for Background
Noise
Yes
Yes
No
No
Compute LPC
and Pitch
Detection
Compute LPC
and Pitch
Detection
Silence
Period: Stop
Algorithm
and set G
2
=0
Silence
Period: Stop
Algorithm
and set G
2
=0
Implementation of LPC
LPC - Motivation
Speech Difference Equation for a p
th
order filter:

=
+ =
p
k
k
n Gu k n s a n s
1
) ( ) ( ) (
Want to minimize the mean-squared prediction error:

=
=
p
k
k
k n s n s n e
1
) ( ) ( ) (
For a single input impulse or stationary white noise,
the obtained coefficients are identical to the a
k
s
9
Implementation of LPC
LPC - Autocorrelation (1)
If we assume that s(n) is zero outside the interval 0 n N-1,
we then need to solve the following set of linear equations:
( ) p i i R k i R
p
k
k
=

=
1 ) (
1

Where:


=
+ =
k N
m
k m s m s k R
1
0
) ( ) ( ) (
Implementation of LPC
LPC - Autocorrelation (2)
In matrix form the set of linear equation can be expressed as:

) (
) 3 (
) 2 (
) 1 (
) 0 ( ) 3 ( ) 2 ( ) 1 (
) 3 ( ) 0 ( ) 1 ( ) 2 (
) 2 ( ) 1 ( ) 0 ( ) 1 (
) 1 ( ) 2 ( ) 1 ( ) 0 (
3
2
1
p R
R
R
R
R p R p R p R
p R R R R
p R R R R
p R R R R
p

10
Implementation of LPC
LPC - Levinson-Durbin Algorithm (1)
By exploiting
Toeplitz structure of the matrix;
Particular structure of the right-hand side of the linear system
of equation
We can use the efficient Levinson-Durbin recursive procedure
to solve this particular system of equations.
Implementation of LPC
LPC - Levinson-Durbin Algorithm (2)
The Levinson-Durbin recursive procedure is given by:
( )
) 1 ( 2 ) (
) 1 ( ) 1 ( ) (
) (
) 1 (
1
1
) 1 (
(0)
1
1 1 for
) ( ) (
1 for
) 0 ( E

=
=

=


=

=

i
i
i
i
j i i
i
j
i
j
i
i
i
i
i
j
i
j
i
E k E
k
i j
k
E
j i R i R
k
p i
R

The final solution is given by: p j


p
j j
= 1
) (

11
Implementation of LPC
LPC - Gain Coefficient
It can be shown that the gain coefficient is given by:

=
= =
p
k
n k
E k R R G
1
2
) ( ) 0 (
Where E
n
is the minimum mean squared error
prediction and is given by E
(p)
from Levinson-
Durbins Algorithm.
We will transmit G
2
.
Implementation of LPC
LPC Algorithm
From Segmentation:
s(n) and R(0)
From Segmentation:
s(n) and R(0)
Compute R(i) 1 i p
Compute R(i) 1 i p
Levinson-Durbins Algorithm:
Find
i
1 i p
and G
2
Levinson-Durbins Algorithm:
Find
i
1 i p
and G
2
Transmit
to decoder
Transmit
to decoder
12
Pitch Detection - Motivation
Implementation of LPC
Recall that source can be either a periodic
impulse train spaced by F
0
or random noise
Autocorrelation function of a speech frame:
If x(n) is periodic in N, then R(k) is also
periodic in N
Thus, we can compute R(k) and check if its
periodic


=
+ =
1
0
) ( ) ( ) (
k N
m
k m x m x k R
Implementation of LPC
Pitch Detection Motivation
First we clip the frame using 3-level center
clipping function:
That is:
C
L
-C
L
+1
-1
otherwise
C n x if
C n x if
n x C
L
L
<
>

+
= ) (
) (
0
1
1
)] ( [
x(n)
C[x(n)]
13
Implementation of LPC
Pitch Detection Motivation
Next we compute the modified
autocorrelation function:
where can have only 3
different values:


=
+ =
1
0
) ( ) ( ) (
k N
m
n
k m x m x k R
) ( ) ( k m x m x +
0 ) ( 0 ) (
) ( ) (
) ( ) (
0
1
1
) ( ) (
= + =
+
+ =

+
= +
k m x or m x if
k m x m x if
k m x m x if
k m x m x
Implementation of LPC
Pitch Detection Motivation
We dont need to compute for all
values of k (i.e. 0 k N)
Thus we only need to look in the range:
80 Hz F
0
350 Hz
) (k R
n
200 80 men
350 150 women
F
0
(Hz) max F
0
(Hz) min
14
Pitch Detection Algorithm
Speech
Frame
x(n)
Speech
Frame
x(n)
LPF
F
c
= 900 Hz
LPF
F
c
= 900 Hz
C
L
= 30% of
max{x(n)}
C
L
= 30% of
max{x(n)} Clip x(n)
Clip x(n)
Compute AC
R
n
(k) for
F
s
/350 k F
s
/80
Compute AC
R
n
(k) for
F
s
/350 k F
s
/80
Compute
R = max{R
n
(k)}
Compute
R = max{R
n
(k)}
Compute
R
n
(0)
Compute
R
n
(0)
if R 30% of R
n
(0) then frame is voiced,
output pitch period = k + F
s
/350
else frame is unvoiced,
output 0
if R 30% of R
n
(0) then frame is voiced,
output pitch period = k + F
s
/350
else frame is unvoiced,
output 0
Implementation of LPC
Implementation of LPC
LPC Synthesizer
Impulse
Train
Generator
Pitch
Period
Random
Noise
Generator
Voice/
Unvoiced
Switch
2
G
Time-Varying
IIR Filter
s '
i

15
References
Implementation of LPC
L. R. Rabiner and R. W. Schafer. Digital
Processing of Speech Signals. Prentice Hall,
Englewood Cliffs, New Jersey, 1978.
Douglas OShaugnessy. Speech
Communication Human and Machine.
Addison Wesley Books, 1978.
M. M. Sondhi. New Methods of Pitch
Extraction. IEEE Trans. Audio and
Electroacoustics, Vol. AU-16, No. 2, pp.
262-266, June 1968.

You might also like