Lattice Formulations of LP - UCSB · Lattice Formulations of LP 1 where we can interpret the first...

15
1 Digital Speech Processing Digital Speech Processing— Lecture 14 Lecture 14 1 Linear Predictive Linear Predictive Coding (LPC) Coding (LPC)-Lattice Lattice Methods, Applications Methods, Applications Lattice Formulations of LP Lattice Formulations of LP both covariance and autocorrelation methods use two step solutions 1. computation of a matrix of correlation values 2. efficient solution of a set of linear equations another class of LP methods called lattice methods 2 another class of LP methods, called lattice methods, has evolved in which the two steps are combined into a recursive algorithm for determining LP parameters begin with Durbin algorithm--at the stage the set of th i 12 () coefficients { , , ,..., } are coefficients of the order optimum LP α = i th j j i i 1 1 () () define the system function of the order inverse filter (prediction error filter) as () if the input to this filter is the input segment ˆ ( ) ( ) ( α = = = + th i i i k k k i A z z s m sn mwm () () ˆ ) with output ( ) ( ) = + i i e m e n m Lattice Formulations of LP Lattice Formulations of LP 3 ˆ ( ) ( ) ( = + n s m sn mwm 1 1 ˆ () () () () ), with output ( ) ( ) ( ) ( ) ( ) ˆ where we have dropped subscript - the absolute location of the signal the z-transform gives () () () α α = = + = = = n i i i k k i i k e m e n m e m sm sm k n E z A zSz 1 () () = i i k k z Sz Lattice Formulations of LP Lattice Formulations of LP 1 1 () (-) (-) () - () using the steps of the Durbin recursion ( = , and ) we can obtain a recurrence formula for () α α α α = i i i i i i i j j ij i i k k A z 4 1 1 () ( ) ( of the form () () = i i i i i A z A z kz A 1 1 1 1 1 1 1 ) () ( ) ( ) () ( ) ( ) ( ) giving for the error transform the expression () ()() ( )() ( ) ( ) ( ) = = i i i i i i i i i z E z A zSz kz A z Sz e m e m kb m Lattice Formulations of LP Lattice Formulations of LP 1 where we can interpret the first term as the z-transform of the forward prediction error for an ( ) order predictor, and the second term can be similarly interpreted based on defining a ba st i 1 1 1 1 1 1 1 () () ( ) ( ) ( ) ( ) ckward prediction error () ( )() ( )() ()() = = i i i i i i i i i B z z A z Sz z A z Sz kA zSz 5 1 1 1 1 1 ( ) ( ) () () ( ) () () with inverse transform ( ) ( ) ( ) ( α = = = + = i i i i i i i k k z B z kE z b m sm i sm k i b m 1 1 ( ) () ) ( ) with the interpretation that we are attempting to predict ( ) from the samples of the input that follow ( ) => we are doing a prediction and ( ) is called the i i i ke m sm i i sm i b m backward backward prediction error sequence Lattice Formulations of LP Lattice Formulations of LP 6 same set of samples is used to forward predict s(m) and backward predict s(m-i)

Transcript of Lattice Formulations of LP - UCSB · Lattice Formulations of LP 1 where we can interpret the first...

Page 1: Lattice Formulations of LP - UCSB · Lattice Formulations of LP 1 where we can interpret the first term as the z-transform ... 11 1 111 () () () () ( ) ( ) ( ) 2 these −− ...

1

Digital Speech ProcessingDigital Speech Processing——Lecture 14Lecture 14

1

Linear Predictive Linear Predictive Coding (LPC)Coding (LPC)--Lattice Lattice

Methods, ApplicationsMethods, Applications

Lattice Formulations of LPLattice Formulations of LP both covariance and autocorrelation methods use

two step solutions 1. computation of a matrix of correlation values 2. efficient solution of a set of linear equations

another class of LP

• methods called lattice methods

2

another class of LP • methods, called lattice methods, has evolved in which the two steps are combined into a recursive algorithm for determining LP parameters

begin with Durbin algorithm--at the stage the set of • thi

1 2( ) coefficients { , , ,..., } are coefficients of the order

optimum LP

α =i thj j i i

1

1( ) ( )

define the system function of the order inverse filter (prediction error filter) as

( )

if the input to this filter is the input segment ˆ( ) ( ) (

α −

=

= −

= +

th

ii i k

kk

i

A z z

s m s n m w m ( ) ( ) ˆ) with output ( ) ( )= +i ie m e n m

Lattice Formulations of LPLattice Formulations of LP

3

ˆ ( ) ( ) (= +ns m s n m w m

1

1

( ) ( )ˆ

( ) ( )

( ) ( )

), with output ( ) ( )

( ) ( ) ( )

ˆ where we have dropped subscript - the absolute location of the signal the z-transform gives

( ) ( ) ( )

α

α

=

= +

= − −

= = −

∑n

ii i

kk

i ik

e m e n m

e m s m s m k

n

E z A z S z1

( ) ( )−

=

⎛ ⎞⎜ ⎟⎜ ⎟⎝ ⎠∑

ii k

k

z S z

Lattice Formulations of LPLattice Formulations of LP

1 1( ) ( - ) ( - ) ( )-

( )

using the steps of the Durbin recursion

( = , and )

we can obtain a recurrence formula for ( ) f th f

α α α α

− =

i

i i i ii ij j i j i

i

k k

A z

4

1 1( ) ( ) (

of the form

( ) ( )− − −= −i i i iiA z A z k z A 1

1 1 1

1 1 1

)

( ) ( ) ( )

( ) ( ) ( )

( ) giving for the error transform the expression

( ) ( ) ( ) ( ) ( )

( ) ( ) ( )

− − − −

− −

= −

= − −

i i i ii

i i ii

z

E z A z S z k z A z S z

e m e m k b m

Lattice Formulations of LPLattice Formulations of LP

1

where we can interpret the first term as the z-transform

of the forward prediction error for an ( ) order predictor, and the second term can be similarly interpreted based on defining a ba

− sti

1 1 1 1

1 1 1

( ) ( ) ( ) ( )

( ) ( )

ckward prediction error

( ) ( ) ( ) ( ) ( ) ( ) ( )− − − − − −= = −i i i i i ii

i i

B z z A z S z z A z S z k A z S z

5

1 1 1

1

1

( ) ( )

( ) ( ) ( )

( ) ( ) with inverse transform

( ) ( ) ( ) (α

− − −

=

= −

= − − + − = −∑

i ii

ii i i

kk

z B z k E z

b m s m i s m k i b m 11 ( )

( )

) ( )

with the interpretation that we are attempting to predict ( ) from the samples of the input that follow ( ) => we are doing a

prediction and ( ) is called the

−−

• −−

ii

i

k e m

s m ii s m i

b m

backwardbackward prediction error sequence

Lattice Formulations of LPLattice Formulations of LP

6

same set of samples is used to forward predict s(m)and backward predict s(m-i)

Page 2: Lattice Formulations of LP - UCSB · Lattice Formulations of LP 1 where we can interpret the first term as the z-transform ... 11 1 111 () () () () ( ) ( ) ( ) 2 these −− ...

2

Lattice Formulations of LPLattice Formulations of LP

1 1 1

1 1

( ) ( )

( ) ( ) ( )

( ) ( ) (

the prediction error transform and sequence ( ), ( ) can now be expressed in terms of forward and backward errors, namely

( ) ( ) ( )

( ) ( )

− − −

− −

= −

= −

i i

i i ii

i i ii

E z e m

E z E z k z B z

e m e m k b 1) ( ) 1

similarly we can derive an expression for the backward error transform andsequence at sample of the form

− ∗

m

m

7

1 1 1

1 11

( ) ( ) ( )

( ) ( ) ( )

( ) ( ) ( )

( ) ( ) ( ) 2

these

− − −

− −

= −

= − − ∗

i i ii

i i ii

B z z B z k E z

b m b m k e m

1

two equations define the forward and backward prediction error for

an order predictor in terms of the corresponding prediction errors of an

( ) order predictor, with the reminder that a zero−

th

th

i

i

0 0 0 1 3( ) ( )

( )

th order predictor does no prediction, so

( ) ( ) ( )

( ) ( ) ( ) / ( )

= = ≤ ≤ − ∗

= =p

e m b m s m m L

E z E z A z S z

Lattice Formulations of LPLattice Formulations of LP1

(1) (1)

(2) (2)

[ ] [ ][ ], 0

[ ] [ ]

Assume we know (from external computation): 1. we compute and from using Eqs. 1 and 2 2. we next compute and for

k

e m b ms m m L

e m b m≤ ≤ ∗ ∗

i

8

0 1 using Eqs. m L≤ ≤ + ∗

( ) ( )

( )

[ ] [ ] 0 1[ ] [ ]

1 and 2 3. extend solution (lattice) to sections giving and for 4. solution is at the output of the lattice section

p p

p

th

pe m b m m L p

e n e np

≤ ≤ + −

=

Lattice Formulations of LPLattice Formulations of LP

9

• lattice network with p sections—the output of which is the forward prediction error

• digital network implementation of the prediction error filter with transfer function A(z)

• no direct correlations

• no alphas

• k’s computed from forward and backward error signals

Lattice Filter for A(z)Lattice Filter for A(z)

10

0 0 0 1( ) ( )[ ] [ ] [ ]= = ≤ ≤ −e n b n s n n L1 1 1 1 2 0 1( ) ( ) ( )[ ] [ ] [ ] , ,..., ,− −= − − = ≤ ≤ − +i i i

ie n e n k b n i p n L i1 1 1 1 2 0 1( ) ( ) ( )[ ] [ ] [ ] , ,..., ,− −= − + − = ≤ ≤ − +i i i

ib n k e n b n i p n L i

0 1( )[ ] [ ],= ≤ ≤ − +pe n e n n L p( ) ( ) ( )=E z A z S z

AllAll--Pole Lattice Filter for H(z)Pole Lattice Filter for H(z)

1z − 1z −i i i

i i i( ) [ ]pe n ( 1) [ ]pe n− (1) [ ]e n ( 0 ) [ ]e n [ ]s n

pk

pk−

1pk −

1pk −−

1k

1k−

11

( )[ ] [ ]=pe n e n1 1 1

1 1 0 1 1

( ) ( ) ( )[ ] [ ] [ ], ,..., ,

− −= + −

= − ≤ ≤ − + −

i i iie n e n k b n

i p p n L i1 1 1

1 1 0 1

( ) ( ) ( )[ ] [ ] [ ], ,..., ,

− −= − + −

= − ≤ ≤ − +

i i iib n k e n b ni p p n L i

0 0 0 1( ) ( )[ ] [ ] [ ],= = ≤ ≤ −s n e n b n n L1( ) ( )( )

=S z E zA z

( ) [ ]pb n ( 1) [ ]pb n− (1) [ ]b n ( 0 ) [ ]b n

AllAll--Pole Lattice Filter for H(z)Pole Lattice Filter for H(z)( ) ( 1)

( 1) ( )

(0) (0) ( )

[ 1] 0, , [0], 1,...,1, [0] [0]

[0] [0] [0]1,2,...,

1. since we can first solve for for using the relationship:

2. since we can then solve for for using the equ

− = ∀

= − =

=

=

i i

i i

i

b i ei p p e e

b e bi p ( ) ( 1)

( 1)

[0] [0]

[1]

ation: 3 we can now begin to solve for as:

= −i ii

i

b k e

e

12

( 1) ( ) ( 1)

(0) (0) ( )

[1][1] [1] [0], , 1,...,1

[1] [1] [1]1,2,...,

3. we can now begin to solve for as:

4. we set and we can then solve for for using

− −= + = −

==

i i ii

i

ee e k b i p p

b e bi p

( ) ( 1) ( 1)

(0) (0)

[1] [1] [0], 1, 2,...,2,3,..., 1

[ ] [ ] [ ]

the equation:

5. we iterate for and end up with

− −= − + == −

= =

i i iib k e b i p

n Ns n e n b n

Page 3: Lattice Formulations of LP - UCSB · Lattice Formulations of LP 1 where we can interpret the first term as the z-transform ... 11 1 111 () () () () ( ) ( ) ( ) 2 these −− ...

3

Lattice Formulations of LPLattice Formulations of LP

the lattice structure comes directly out of the Durbin algorithm the parameters are obtained from the Durbin equations the predictor coefficients, , do not appear explicitly in the lattice stα

••

•i

k

kructure

can relate the parameters to the forward and backward errors via• ik

13

11 1

01 2

1 11 2 1 2

0 0

14

1

( ) ( )

/

( ) ( )

( ) ( )

[ ( )] [ ( )]

wh

− +− −

=

− + − +− −

= =

= ∗⎧ ⎫⎡ ⎤ ⎡ ⎤⎪ ⎪−⎢ ⎥ ⎢ ⎥⎨ ⎬⎢ ⎥ ⎢ ⎥⎪ ⎪⎣ ⎦ ⎣ ⎦⎩ ⎭

∑ ∑

L ii i

mi

L i L ii i

m m

e m b mk

e m b m

ere is a normalized cross correlation between the forward and backward prediction error, and is therefore called a partial correlation or PARCOR coefficient can compute predictor coefficients re•

ik

cursively from the PARCOR coefficients

Direct Computation of Direct Computation of kk ParametersParameters0 1

( ) ( )

assume [ ] non-zero for assume chosen to minimize total energy of the forward

(or backward) prediction errorswe can then minimize prediction error as :

(

≤ ≤ −ii

i

i

i i

s n n Lk

E

forward21 12 1 1 1( ) ( )) ( ) ( )

− + − +

⎡ ⎤ ⎡ ⎤∑ ∑L i L i

i ik b

14

( ) ( ) (=i iforwardE e m 1 1

0 0

11 1 1

0

11 1

01 21

0

1

0 2 1 1

1

1

( ) ( )

( )( ) ( ) ( )

( ) ( )

( )

) ( ) ( )

( ) ( ) ( )

( ) ( )

( )

− −

= =

− +− − −

=

− +− −

=− +

=

⎡ ⎤ ⎡ ⎤= − −⎣ ⎦ ⎣ ⎦

∂ ⎡ ⎤= = − − − −⎣ ⎦∂

⎡ ⎤⋅ −⎣ ⎦=

⎡ ⎤−⎣ ⎦

∑ ∑

i ii

m mi L i

i i iforwardi

miL i

i i

forward mi L i

i

m

e m k b m

E e m k b m b mk

e m b mk

b m

Direct Computation of k ParametersDirect Computation of k Parameters

21 12 1 1

0 0

1

1( ) ( ) ( ) ( )

( )

we can also choose to minimize the prediction error

( ) ( ) ( )− + − +

− −

= =

− +

⎡ ⎤ ⎡ ⎤= = − + −⎣ ⎦ ⎣ ⎦

∑ ∑L i L i

i i i ibackward i

m m

i L i

E b m k e m b m

E

backward

15

11 1

0

0 2 1( )

( ) ( )( ) ( )+

− −

=

∂ ⎡ ⎤= = − − + −⎣ ⎦∂

i L ii ibackward

imi

E k e m b mk

1

11 1

01 21

0

1

( )

( ) ( )

( )

( )

( ) ( )

( )

− +− −

=− +

=

⎡ ⎤−⎣ ⎦=

⎡ ⎤⎣ ⎦

i

L ii i

backward mi L i

i

m

e m

e m b mk

e m

Direct Computation of k ParametersDirect Computation of k Parameters

2 21 11 1

0 01( ) ( )

if we window and sum over all time, then

( ) ( )

th f

− + − +− −

= =

⎡ ⎤ ⎡ ⎤= −⎣ ⎦ ⎣ ⎦∑ ∑L i L i

i i

m me m b m

16

11 1

0

1

1( ) ( )

(

therefore

( ) ( )− +

− −

=

= = =

−=

PARCOR forward backward forward backwardi i i i i

L ii i

m

i

k k k k k

e m b m

e1 21 12 21

0 01

/) ( )( ) ( )

− + − +−

= =

⎧ ⎫⎡ ⎤ ⎡ ⎤−⎨ ⎬⎣ ⎦ ⎣ ⎦⎩ ⎭∑ ∑

L i L ii

m mm b m

Direct Computation of Direct Computation of kk ParametersParameters

{ }1 2 2

0

211 1 1 1

0

1

( ) ( ) ( )

( ) ( ) ( ) (

minimize of forward and backward prediction errors over fixed interval (covariance method)

( ) ( )

( ) ( ) ( )

=

−− − − −

=

⎡ ⎤ ⎡ ⎤= +⎣ ⎦ ⎣ ⎦

⎡ ⎤= − − + − +⎣ ⎦

Li i i

Burgm

Li i i i

i im

E e m b m

e m k b m k e m b

sum

2

1)( )∞

=−∞

⎡ ⎤−⎣ ⎦∑m

m

17

11 1 1

0

11 1 1

0

11 1

0

2 21 1

0

0 2 1 1

2 1

2 1

1

( )( ) ( ) ( )

( ) ( ) ( )

( ) ( )

( ) ( )

( ) ( ) ( )

( ) ( ) ( )

( ) ( )

( ) ( )

−− − −

=

−− − −

=

−− −

=

− −

=

∂⎡ ⎤= = − − − −⎣ ⎦∂

⎡ ⎤− − + −⎣ ⎦

⎡ ⎤⋅ −⎣ ⎦=

⎡ ⎤ ⎡ ⎤+ −⎣ ⎦ ⎣ ⎦

i LBurg i i i

imi

Li i i

im

Li i

Burg mi L

i i

m

Ee m k b m b m

k

k e m b m e m

e m b mk

e m b m1 1

0

1 1

− −

=

• − ≤ ≤

∑ ∑L

m

Burgik always

Comparison of Autocorrelation and Burg Comparison of Autocorrelation and Burg SpectraSpectra

i ifi tl l

18

• significantly less smearing of formant

peaks using Burg method

Page 4: Lattice Formulations of LP - UCSB · Lattice Formulations of LP 1 where we can interpret the first term as the z-transform ... 11 1 111 () () () () ( ) ( ) ( ) 2 these −− ...

4

Summary of Lattice ProcedureSummary of Lattice Procedure

0 0

1

( ) ( )

steps involved in determining the predictor coefficients and the parameters for the lattice method are as follows

1. initial condition, ( ) ( ) ( ) from Eq. *3

2. compute

= =

k

e m s m b m

k 11

1 1

2

( )

( ) ( )

( )

from Eq. *4

3. determine forward and backward prediciton errors ( ), ( ) from Eqs. *1 and *2 4. set

α=

=i

e m b mi

19

( )

( )

5. determine from Eq. *4

6. determine for

α

α

= ii i

ij

k

j 1 2 1

1

( ) ( )

, ,..., from Durbin iteration

7. determine ( ) and ( ) from Eqs. *1 and *2 8. set 9. if is less than or equal to , go to step 5 10. procedure is terminated

= −

= +

i i

i

e m b mi i

i p

predictor coefficients obtained directly from speech samples => without calculation of autocorrelation function method is guaranteed to yield stable filters ( <1) without using window• ik

Summary of Lattice ProcedureSummary of Lattice Procedure

20

1−z 1−z 1−z1k−1k−

2k−2k−

pk−pk−

][ns ][)1( ne

][)1( nb

][)2( ne

][)2( nb

][)( ne p

][)( nb p

][)0( ne

][)0( nb

][ne

Summary of Lattice ProcedureSummary of Lattice Procedure

0 0 3( ) ( )( ) ( ) ( )= = ∗e m b m s m

21

3( ) ( ) ( ) ( ) ( )= = ∗e m b m s m

11 1

01 2

1 11 2 1 2

0 0

14

1

( ) ( )

/

( ) ( )

( ) ( )

[ ( )] [ ( )]

− +− −

=

− + − +− −

= =

= ∗⎧ ⎫⎡ ⎤ ⎡ ⎤⎪ ⎪−⎢ ⎥ ⎢ ⎥⎨ ⎬⎢ ⎥ ⎢ ⎥⎪ ⎪⎣ ⎦ ⎣ ⎦⎩ ⎭

∑ ∑

L ii i

mi

L i L ii i

m m

e m b mk

e m b m

1 1

1 1

1

1

( ) ( ) ( )

( ) ( ) ( )

( ) ( ) ( ) 1

( ) ( ) ( ) 2

− −

− −

= − − ∗

= − − ∗

i i ii

i i ii

e m e m k b m

b m b m k e m

Prediction Error SignalPrediction Error Signal

H(z)Gu(n) s(n)1

11

1. Speech Production Model

( ) ( ) ( )

( )( )( )

2. LPC Model:

=

=

= − +

= =−

p

kk

pk

kk

s n a s n k Gu n

S z GH zU z a z

22

1

11

1 1

1

( ) ( ) ( ) ( ) ( )

( )( )( )

3. LPC Error Model:( )

( ) ( )

α

α

α

=

=

= − = − −

= = −

= =−

p

kk

pk

kk

k

e n s n s n s n s n k

E zA z zS z

S zA z E z

1

1( ) ( ) ( )α

=

=

= + −

pk

kp

kk

z

s n e n s n k

A(z)s(n) e(n)

1/A(z)e(n) s(n)

Perfect reconstruction even if ak not equal to αk

LPC ComparisonsLPC ComparisonsLfile:ah, ss:3000, L:300, p:12

23

LPC ComparisonsLPC Comparisonsfile:test_16k, ss:3000, L:300, p:12

24

Page 5: Lattice Formulations of LP - UCSB · Lattice Formulations of LP 1 where we can interpret the first term as the z-transform ... 11 1 111 () () () () ( ) ( ) ( ) 2 these −− ...

5

LPC ComparisonsLPC Comparisonsfile:test_16k, ss:1000, L:400, p:12

25

Comparisons Between LP Comparisons Between LP MethodsMethods

• the various LP solution techniques can be compared in a number of ways, including the following:

26

g– computational issues– numerical issues– stability of solution– number of poles (order of predictor)– window/section length for analysis

LP Solution ComputationsLP Solution Computations

27

• assume L1≈ L2>>p; choose values of L1=300, L2=300, L3=300, p=10

• computation for

• covariance method ≈ L1p+p3 ≈ 4000 *,+

• autocorrelation method ≈ L2p+p2 ≈ 3100 *,+

• lattice method ≈ 5L3p ≈ 15000 *,+

LP Solution ComparisonsLP Solution Comparisons• stability

– guaranteed for autocorrelation method– cannot be guaranteed for covariance method; as

window size gets larger, this almost always makes the system stable

t d f l tti th d

28

– guaranteed for lattice method• choice of LP analysis parameters

– need 2 poles for each vocal tract resonance below Fs/2

– need 3-4 poles to represent source shape and radiation load

– use values of p ≈ 13-14

The Prediction Error SignalThe Prediction Error Signal

29

LP Speech AnalysisLP Speech AnalysisTop panelTop panel: speech signal

Second Second panelpanel: error signal

Third panelThird panel: l

file:s5, ss:11000, frame size (L):320, lpc order (p):14, cov method

30

log magnitude spectra of signal and LP model

Fourth Fourth panelpanel: log magnitude spectrum of error signal

Page 6: Lattice Formulations of LP - UCSB · Lattice Formulations of LP 1 where we can interpret the first term as the z-transform ... 11 1 111 () () () () ( ) ( ) ( ) 2 these −− ...

6

LP Speech AnalysisLP Speech AnalysisTop panelTop panel: speech signal

Second Second panelpanel: error signal

Third panelThird panel: log

file:s5, ss:11000, frame size (L):320, lpc order (p):14, ac method

31

gmagnitude spectra of signal and LP model

Fourth Fourth panelpanel: log magnitude spectrum of error signal

LP Speech AnalysisLP Speech AnalysisTop panelTop panel: speech signal

Second Second panelpanel: error signal

Third panelThird panel: l

file:s3, ss:14000, frame size (L):160, lpc order (p):16, cov method

32

log magnitude spectra of signal and LP model

Fourth Fourth panelpanel: log magnitude spectrum of error signal

LP Speech AnalysisLP Speech AnalysisTop panelTop panel: speech signal

Second Second panelpanel: error signal

Third panelThird panel: log

file:s3, ss:14000, frame size (L):160, lpc order (p):16, ac method

33

gmagnitude spectra of signal and LP model

Fourth Fourth panelpanel: log magnitude spectrum of error signal

Variation of Prediction Error with LP OrderVariation of Prediction Error with LP Order

34

• prediction error flattens at around p=13-14

• normalized prediction error for unvoiced speech larger than for voiced speech => model isn’t quite as accurate

LP Solution ComparisonsLP Solution Comparisons

• choice of LP analysis parameters– use small values of L for reduced computation– use l order of several pitch periods for reliable

prediction-especially when using tapered window

35

prediction especially when using tapered window– use l from 100-400 samples at 10 kHz for

autocorrelation– for lattice and covariance methods, L as small as 2 p

has been used (within pitch periods); however if pitch pulse occurs within window, bad prediction results => use much larger values of L

Prediction Error Signal BehaviorPrediction Error Signal Behavior

1

- the prediction error signal is computed as

( ) ( ) ( ) ( )

- ( ) should be large at the beginning of

α=

= − − =∑p

kk

e n s n s n k Gu n

e n

36

( ) s ou d be a ge at t e beg g o each pitch period (voiced speech) => good signal for pitch detection- can

e

perform autocorrelation on ( ) and detect largest peak- error spectrum is approximately flat-so effects of formants on pitch detection are minimized

e n

Page 7: Lattice Formulations of LP - UCSB · Lattice Formulations of LP 1 where we can interpret the first term as the z-transform ... 11 1 111 () () () () ( ) ( ) ( ) 2 these −− ...

7

Normalized MeanNormalized Mean--Squared ErrorSquared Error

12

01

2

ˆ

ˆ

- for autocorrelation method

( )

( )

+ −

=−

=∑

L p

nm

n L

e mV

s m0

10

ˆ ˆ

- the prediction error sequence (defining ) is

( ) ( )

- giving many forms for the normalized error

α

α=

= −

= − −∑p

kn nk

e m s m k

37

0

12

01

2

0

ˆ

ˆ

ˆ

ˆ

( )

- for covariance method

( )

( )

=

=−

=

=

nm

L

nm

n L

nm

s m

e mV

s m

0 0

0

2

0 0

00 0

1

ˆˆ

ˆ

ˆˆ

ˆ

ˆ

g g y

( , )

( , )

( , )( , )

( )

φα α

φ

φα

φ

= =

=

=

= −

= −

∑∑

p pn

i jnni j

pn

inni

ini

i jV

iV

V k1=∏

p

Experimental Evaluations of Experimental Evaluations of LPC ParametersLPC Parameters

38

Normalized MeanNormalized Mean--Squared ErrorSquared Error

39

• Vn versus p for synthetic vowel, pitch period of 83 samples, L=60, pitch synchronous analysis

• covariance method-error goes to zero at p=11, the order of the synthesis filter

• autocorrelation method, Vn≈0.1 for p≥7 since error dominated by prediction at beginning of interval

Normalized MeanNormalized Mean--Squared ErrorSquared Error

40

• normalized error versus p for pitch asynchronous analysis, L=120, normalized error falls to 0.1 near p=11 for both covariance and autocorrelation methods

Normalized MeanNormalized Mean--Squared ErrorSquared Error

41

• normalized error versus L, p=12

• for L < pitch period (83 samples), covariance method gives smaller normalized error than autocorrelation method

• for values of L at or near multiples of pitch period, normalized error jumps due to large prediction error in vicinity of pitch pulse

• when L > 2 * pitch period, normalized error same for both autocorrelation and covariance methods

Normalized MeanNormalized Mean--Squared ErrorSquared Error

42

• results for natural speech

Page 8: Lattice Formulations of LP - UCSB · Lattice Formulations of LP 1 where we can interpret the first term as the z-transform ... 11 1 111 () () () () ( ) ( ) ( ) 2 these −− ...

8

Normalized MeanNormalized Mean--Squared ErrorSquared Error• variability of normalized error with positioning of frame

• sample-by-sample LP analysis of 40 msec of vowel /i/

• signal energy in part a; normalized error in part b for p=14 pole analysis using 20 msec frame size for covariance method; normalized error in part c for autocorrelation method using HW; normalized error

43

in part d for autocorrelation method using RW

• average pitch period of 84 samples => 2.5 pitch periods in 20 msec window

• substantial variations in normalized error for covariance method-especially peaked when pitch pulses enter window => longer windows give larger normalized errors

• substantial high frequency variations in normalized error for autocorrelation method with some pitch modulations

Properties of the LPC Properties of the LPC PolynomialPolynomialyy

44

MinimumMinimum--Phase Property of Phase Property of AA((zz))( ) has all its zeros inside the unit circleA z

2 1: Assume that ( ) is a zero (root) of P ( )roof >o oz z A z11( ) ( ) ( )− ′= − oA z z z A z

2 2 21

The minimum mean-squared error is

[ ] | ( ) | | ( ) |π

ω ω ω∞

= =∑ ∫ j jE e m A e S e d

45

12

22 2 2

1 0

ˆ ˆ ˆ

ˆ

[ ] | ( ) | | ( ) |

( ) ( )

π

π

ωπ

π ω ω ω ωπ

=−∞ −

= =

− ′= − >∫−

∑ ∫n n nm

o n

E e m A e S e d

j j jz e A e S e d

2 221 1 1( / )ω ω− ∗ −=− −j j

o o oz e z z e

1Thus, ( ) could not be the optimum filter becausewe could replace by ( / ) and decrease the error.∗

o o

A zz z

PARCORs and StabilityPARCORs and Stability1 1( )prove that for some • ≥ ⇒ ≥i

i jk z j

1 1 1 1

1

1( ) ( ) ( ) ( )( ) ( ) ( ) ( )− − − − −

=

= − = −∏i

i i i i ii j

jA z A z k z A z z z

( ) ( )

It is easily shown that is the coefficient

f i ( ) i Th f

− ii i i

k

A k

46

1

1

( ) ( )

( )

of in ( ), i.e., . Therefore,

If , then either all the roots must be theunit circle or at least one of

α−

=

=

=

∏on

i i ii i

pi

i jj

i

z A z k

k z

kthem must be

the unit circle.outside

PARCORs and StabilityPARCORs and Stability1

1 2

( )

if , then either all the roots must be the unit circle or at least one of them must be the unit circle. Since this is true for all ( ),

, ,..., , a necessary condition for th

• ≥

=

on

outsidei

i

k

A zi p

( )

e roots of( ) to be inside the unit circle is:pA z

47

2 1 2 0

1

1 1 2

1 1 0

1

( ) ( ) ( )

( ) , , ,...,

for the -order optimum linear predictor,

( ) ( )

so and t

=

< =

= − = − >

<

i

th

ii i

i jj

i

k i p

i

E k E k E

k ( )herefore ( ) has all its roots inside the unit circle.

pA z

Root Locations for Optimum LP Root Locations for Optimum LP ModelModel

( )( ) 1

pi

i

G GH zA z zα −

= =−∑

48

1

1

1 1

(1 ) ( )

ip

p p

i ii i

G Gz

z z z z

=

= =

= =− −

∏ ∏

Page 9: Lattice Formulations of LP - UCSB · Lattice Formulations of LP 1 where we can interpret the first term as the z-transform ... 11 1 111 () () () () ( ) ( ) ( ) 2 these −− ...

9

PolePole--Zero Plot for ModelZero Plot for ModelWhich polescorrespond toformantfrequencies?

49

Pole LocationsPole Locations

50

Pole Locations (FPole Locations (FSS=10,000 Hz)=10,000 Hz)

51

( /180) ( / 2)SF Fθ= ⋅

Estimating Formant FrequenciesEstimating Formant Frequencies

• compute A(z) and factor it.• find roots that are close to the unit circle.

52

• compute equivalent analog frequencies from the angles of the roots.

• plot formant frequencies as a function of time.

Spectrogram with LPC RootsSpectrogram with LPC Roots

53

Spectrogram with LPC RootsSpectrogram with LPC Roots

54

Page 10: Lattice Formulations of LP - UCSB · Lattice Formulations of LP 1 where we can interpret the first term as the z-transform ... 11 1 111 () () () () ( ) ( ) ( ) 2 these −− ...

10

Comparison to ABS MethodsComparison to ABS Methods2

2

2

error measure for ABS methods is log ratio of power spectra, i.e.,

| ( ) | log

| ( ) |

thus for ABS minimization of is equivalent to minimizing mean squ

π ω

ωπ

ω−

⎧ ⎫⎡ ⎤⎪ ⎪′ = ⎢ ⎥⎨ ⎬⎢ ⎥⎪ ⎪⎣ ⎦⎩ ⎭

′•

∫j

nj

S eE d

H e

E ared error between two log spectra comparing and we see the following:• LPC ABSE E

55

both error measures related to ratio of signal to model spectra both tend to perform uniformly over whole frequency range both are suitable to selective error minimization over specified frequency ranges error criterion for LP modeling places higher weight on frequency regions

where | (nS 2 2) | | ( ) | , whereas the ABS error criterion places equal weight on both regions

for unsmoothed signal spectra (as obtained by STFT methods), LP error criterion yields better spectral m

ω ω<

j je H e

atches than ABS error criterion for smoothed signal spectra (as obtained at output of filter banks), both error criteria

will perform well⇒

Relation of LP Analysis to Relation of LP Analysis to Lossless Tube ModelsLossless Tube Models

56

DiscreteDiscrete--Time Model Time Model -- II

57

• Make all sections the same length with delay

/ whereτ = Δ = Δx c N x

DiscreteDiscrete--Time Model Time Model -- IIII

2

-section lossless tube model corresponds to discrete-time system when:

where is the velocity of sound, is the number oftube sections, is the sampling frequency, and is

S

S

N

cNF

c NF

=

i

58

the total

1

1

{ , 1 1}length of the vocal tract.

The reflection coefficients are relatedto the areas of the lossless tubes by:

Can find transfer function of digital system subject tocon

k

k kk

k k

r k N

A ArA A

+

+

≤ ≤ −

−=

+

i

i1,

//

straints of the form G

N LN L

N L

rc A Zr rc A Z

ρρ

=

−= =

+

DiscreteDiscrete--Time Model Time Model -- IIIIII

59

DiscreteDiscrete--Time Model Time Model -- IVIV2

1

0 5 1 1 /. ( ) ( )( )( )( ) ( )

=

+ += =

∏N

NG k

L k

G

r r zU zV zU z D z

11 1 reflection coefficient+⎛ ⎞−− ≤ = ≤⎜ ⎟+⎝ ⎠

k kk

A ArA A

Given the system function:

60

01

1 1

11 2

( ) ( ) ( ) ( ) , , ,( ) ( )

− −− −

== + ==

…kk k k k

N

D zD z D z r z D z k ND z D z

1+ +⎝ ⎠k kA A

1 / if (i.e., ) and /

then ( ) satisties the recursion

ρρ

−= = ∞ = =

+i N L

G G N LN L

c A Zr R r rc A Z

D z

Page 11: Lattice Formulations of LP - UCSB · Lattice Formulations of LP 1 where we can interpret the first term as the z-transform ... 11 1 111 () () () () ( ) ( ) ( ) 2 these −− ...

11

AllAll--Pole Lattice Filter for H(z)Pole Lattice Filter for H(z)

1−z 1−z 1−z

1k1k−

1−pk1−− pk

pk

pk−

][ne ][ns

0 1( )( ) =A z

61

1( ) ( )( )

=S z E zA z

1 1 1 1 2( ) ( ) ( )

( )

( ) ( ) ( ) , , ,( ) ( )

− − − −= − ==

…i i i ii

p

A z A z k z A z i pA z A z

If and , then ( ) ( ).= − = =i ir k N p D z A z

Tube Areas from PARCORSTube Areas from PARCORS• Relation to areas:

• Solve for Ai+1 in terms of Ai

1 1

1 1

11 11

( / )( / )

+ +

+ +

⎛ ⎞ ⎛ ⎞− −− ≤ − = = = ≤⎜ ⎟ ⎜ ⎟+ +⎝ ⎠ ⎝ ⎠

i i i ii i

i i i i

A A A Ak rA A A A

62

i+1 i

• Log area ratios (good for quantization)

11 01+

⎛ ⎞−= >⎜ ⎟+⎝ ⎠

ii i

i

kA Ak

1 1 01

+ ⎛ ⎞−= >⎜ ⎟+⎝ ⎠

i i

i i

A kA k

1 11

log log+⎛ ⎞ ⎛ ⎞−= =⎜ ⎟ ⎜ ⎟+⎝ ⎠ ⎝ ⎠

i ii

i i

A kgA k

Minimizes spectralsensitivity under uniform quantization

Estimating Tube Areas from Speech Estimating Tube Areas from Speech (Wakita)(Wakita)

11 2

21

3

. Sample speech [ [ ] ( )] at samplingrate / / ( ).. Remove effects of glottal source and radiation by

pre-emphasis [ ] [ ] [ ].Compute the PARCOR coefficients on a short

ρ=

= =

= − −

a

s

s n s nTF T c

x n s n s n

63H. Wakita, IEEE Trans. Audio and Electroacoustics,October, 1973.

3. Compute the PARCOR coefficients on a short-time ba

1

1 24 1

sis: , , ,..., .. Assuming (arbitrary), compute

=

=ik i pA

11 1 2 11

, , ,...,+

⎛ ⎞−= = −⎜ ⎟+⎝ ⎠

ii i

i

kA A i pk

Estimation of Tube AreasEstimation of Tube Areas

Analysis of syllable /IY/ /B/ /AA/• /IY/ sound in part (a)• /B/ sound in parts (b) and (c)• /AA/ sound in part (d)

64

Using Wakita method to estimate tube areas from the speech waveform as shown in lower plot.

Estimations of Tube AreasEstimations of Tube Areas

Use of Wakita method to estimate tube areas for the five vowels, /IY/, /EH/, /AA/, /AO/, /UW/

65

, ,

Alternative Representations Alternative Representations of the LP Parametersof the LP Parameters

66

Page 12: Lattice Formulations of LP - UCSB · Lattice Formulations of LP 1 where we can interpret the first term as the z-transform ... 11 1 111 () () () () ( ) ( ) ( ) 2 these −− ...

12

LP Parameter SetsLP Parameter Sets

67

PARCORs to Prediction CoefficientsPARCORs to Prediction Coefficients

1 2( )

for , , ,α

=

=

…i

i i

i pk

1 2assume that , , , , are given. Then we can skip the computation of in the Levinson recursion.• = …i

i

k i pk

68

1 1

1 1 2 1

1 2

( ) ( ) ( )

( )

if , then for , , ,

endend

, , ,

α α α

α α

− −−

> = −

= −

= =

i i ij j i i j

pj j

i j ik

j p

Prediction Coefficients to PARCORsPrediction Coefficients to PARCORs

1 2

1 2

( )

( )

for , , ,

for , , ,

α α

α

= =

=

= −

pj j

pp p

j p

k

i p p

1 2assume that , , , , are given. Then we

can work backwards through the Levinson Recursion.

α• = …j j p

69

12

11 1

1 2 1

1

( ) ( )( )

( )

o , , ,for , , ,

end

end

α αα

α

−−

−− −

= −

+=

=

……

i ij i i ji

ji

ii i

p pj i

kk

k

LP Parameter TransformationsLP Parameter Transformations

( )1

1 1

1 1

roots of the predictor polynomial

( )

where each root can be expressed as a z-plane or s-planeroot i e

α − −

= =

= − = −

∑ ∏pp

kk k

k k

A z z z z

70

root, i.e., ;

σ= + = + Ω

=k kr ki k k k

k

z z j z s j

z

( )1 2 21 12

giving

tan ; log

important for formant estimation

σ− ⎡ ⎤Ω = = +⎢ ⎥

⎣ ⎦•

ks T

kik k kr ki

kr

e

zz z

T z T

LP Parameter TransformationsLP Parameter Transformations

1

1

1

cepstrum of IR of overall LP system from predictor coefficients

ˆ ˆ ( ) ( )

predictor coefficients from cepstrum of IR

α α−

−=

⎛ ⎞= + ≤⎜ ⎟⎝ ⎠

∑n

n n kk

kh n h k nn

71

1

1

1ˆ ˆ ( ) ( )α α−

−=

⎛ ⎞= − ≤⎜ ⎟⎝ ⎠

∑n

n n kk

kh n h k nn

0

1

1

where

( ) ( )α

∞−

= −

=

= =

−∑

∑n

pn k

kk

GH z h n z

z

LP Parameter TransformationsLP Parameter Transformations

1

0

IR of all pole system

( ) ( ) ( )

autocorrelation of IR

α δ=

= − + ≤

∑p

kk

h n h n k G n n

72

0

1

2

1

1

0

( ) ( ) ( ) ( )

( ) (| |)

( ) ( )

α

α

=

=

=

= − = −

= − ≤

= +

np

kk

p

kk

R i h n h n i R i

R i R i k i

R R k G

Page 13: Lattice Formulations of LP - UCSB · Lattice Formulations of LP 1 where we can interpret the first term as the z-transform ... 11 1 111 () () () () ( ) ( ) ( ) 2 these −− ...

13

LP Parameter TransformationsLP Parameter Transformations

1

1

autocorrelation of the predictor polynomial

( )

with IR of the inverse filter

α −

=

= −∑p

kk

k

A z z

73

1

0

( ) ( ) ( )

with autocorrelation

( ) ( ) ( )

δ α δ=

= − −

= + ≤ ≤

∑p

kk

ak

a n n n k

R i a k a k i i p0

=∑p i

LP Parameter TransformationsLP Parameter Transformations

1 11

1

log area ratio coefficients from PARCOR coefficients

log log+

⎡ ⎤ ⎡ ⎤−= = ≤ ≤⎢ ⎥ ⎢ ⎥+⎣ ⎦ ⎣ ⎦

i ii

i i

A kg i p

A k

74

1 11

with inverse relation

−= ≤ ≤

+

i

i

g

i gek i pe

Quantization of LP Parameters

2

2

1

consider the magnitude-squared of the model frequency response

( ) ( , )| ( ) |

h i t th t ff t

jjH e P g

A eP

ωω ω

= =

75

where is a parameter that affects . spectral sensitivity can be defined as

g P

Sg

∂∂ 0

1 12

( , )lim log( , )

which measures sensitivity to errors in the parameters

i

ig

i i i i

i

P g dg P g g

g

π

π

ω ωπ ω→Δ

⎡ ⎤= ⎢ ⎥Δ + Δ⎣ ⎦

Quantization of LP Parameters

76

• spectral sensitivity for kiparameters; low sensitivity around 0; high sensitivity

around 1

• spectral sensitivity for log area ratio

parameters, gi – low sensitivity for virtually entire range is seen

Line Spectral Pair ParametersLine Spectral Pair Parameters1 2

1 2

1 1 1 1 12 1

1

1

( ) ( )

( ) ...

all-zero prediction filter with all zeros, , inside the unit circle

( ) ( ) ...

reciprocal polynomial with inverse zeros, / c

α α α

α α α

− − −

− + − − − + − − +

= + + + +

=

= = + + + +

=

i

pp

k

p p p pp

k

A z z z z

z

A z z A z z z z z

zonsider the following:

77

1 1

1

1( )

( ) ( ) allpass system ( ) , all ( )

form the symmetric polynomial ( ) as:

( ) ( ) ( ) ( ) ( ) ( ) has zeros for ( ) ; ( ( )

ω ω

− + −

= = ⇒ =

= + = + ⇒ = − = −

i

j

p

A zL z L eA z

P z

P z A z A z A z z A z P z L z A z

{ }

{ }1 1

1 2 2 0 1 1

1

2 0 1

( )

( ))

arg ( ) ( / ) , , ,...,

form the anti-symmetric polynomial ( ) as:

( ) ( ) ( ) ( ) ( ) ( ) has zeros for ( ) ; ( ( ) ( ))

arg ( ) , , ,...,

ω

ω

π

π

− + −

⇒ = + ⋅ = −

= − = − ⇒ = + =

⇒ = ⋅ = −

i

k

k

j

p

j

A z

L e k k p

Q z

Q z A z A z A z z A z Q z L z A z A z

L e k k p 1

Line Spectral Pair ParametersLine Spectral Pair Parameters

{ } zeros of ( ) and ( ) fall on unit circle and are interleaved with

each other set of called Line Spectral Frequencies (LSF) LSFs are in ascending order

t bilit f ( ) t d b

ω⇒

i

ik

P z Q z

H ti i LSF t

78

stability of ( ) guaranteed by quani H z

2 22

2

4

tizing LSF parameters( ) ( ) ( )

( ) ( )( )

ω ωω

ω ωω

+=

+=

j jj

j jj

P e Q eA e

P e Q eA e

Page 14: Lattice Formulations of LP - UCSB · Lattice Formulations of LP 1 where we can interpret the first term as the z-transform ... 11 1 111 () () () () ( ) ( ) ( ) 2 these −− ...

14

Line Spectrum Pair (LSP) ParametersLine Spectrum Pair (LSP) Parameters

1 1 properties of LSP parameters

1. ( ) corresponds to a lossless tube, open at the lips and open ( )

at the glottis 2. ( ) corresponds to a lossless tube, open at the lips and clos

+

•=pP z k

Q z 1 1ed ( )

at the glottis+ = −pk

79

11

3. all the roots of ( ) and ( ) are on the unit circle 4. if is an even integer, then ( ) has a root at and ( ) has a root at 5. a

= += −

P z Q zp P z z Q zz

1 1 2necessary and sufficient condition for , , ,..., is that the roots of ( ) and ( )alternate on the unit circle 6. the LSP frequencies get close together when roots of ( ) are close

< =ik i pP z Q z

A z to the unit circle 7. the roots of ( ) are approximately equal to the formant frequenciesP z

LSP ExampleLSP Example

( ) rootso ( ) rootsx ( ) roots

P zQ zA z

12p =

80

Line Spectrum Pair (LSP) ParametersLine Spectrum Pair (LSP) Parameters

81

LPC SynthesisLPC Synthesis

1

the basic synthesis equation is

( ) ( ) ( )

need to update parameters every 10 msec or so pitch synchronous mode works best

α=

= − +

••

∑p

kk

s n s n k Gu n

82

LPC AnalysisLPC Analysis--SynthesisSynthesis

1. Extract αk parameters properly

2. Quantize αk parameters properly so that there is little quantization error

83

• Small number of bits go into coding the αk coefficients

3. Represent e(n) via:

• Pitch pulses and noise—LPC Coding

• Multiple pulses per 10 msec interval—MPLPC Coding

• Codebook vectors—CELP

• Almost all of the coding bits go into coding of e(n)

LPC VocoderLPC Vocoder

• bit rates of 72 FSwhere FS=100, 67, and 33 for bit rates of 7200 bps 4800

header

84

of 7200 bps, 4800 bps and 2400 bps

3600 bps

2400 bps

VEV LPC

Page 15: Lattice Formulations of LP - UCSB · Lattice Formulations of LP 1 where we can interpret the first term as the z-transform ... 11 1 111 () () () () ( ) ( ) ( ) 2 these −− ...

15

LPC BasicsLPC Basics

A(z) H(z)sn(m) en(m) sn(m)

11 1 ( ) ( ) ( ) ; prediction error filter

( )α −= − = − =∑

pk

kk

E zA z z P zS z

85

[ ]

1

1

1

2

1 1 111

ˆ ˆ ˆ

ˆ ˆ ˆ

( )

( ) ( ) ( ); prediction error

( ) ; all pole model( ) ( )

( ) ( )

α

α

=

=

=

=−∞

= − −

= = =−−

= = −

k

p

kn n nk

pk

kk

n n nm

S z

e m s m s m k

H zA z P zz

E e m s m2

1ˆ ( )α

=−∞ =

⎛ ⎞−⎜ ⎟

⎝ ⎠∑ ∑

p

k nm k

s m k

LPC BasicsLPC Basics--Speech ModelSpeech Model

P(z)

+e(n)=Gu(n) s(n)

( )G G S

86

1

1

11

1

( ) ( )( ) ( )

( )ω

ω

α

α

=

=

= = =−−

=−

pk

kk

jp

j kk

k

G G S zH zP z U zz

GH ee

SummarySummary• the LP model has many interesting and useful properties

that follow from the structure of the Levinson-Durbin algorithms

• the different equivalent representations have different properties under quantization– polynomial coefficients (bad)

87

polynomial coefficients (bad)– polynomial roots (okay)– PARCOR coefficients (okay)– lossless tube areas (good)– LSP root angles (good)

• almost all LPC representations can be used with a range of compression schemes and are all good candidates for the technique of Vector Quantization