22
1 Linear Prediction

1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling Pitch Detection

Embed Size (px)

Citation preview

Page 1: 1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling  Pitch Detection

1

Linear Prediction

Page 2: 1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling  Pitch Detection

Outline Windowing LPC Introduction to Vocoders Excitation modeling

Pitch Detection

Page 3: 1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling  Pitch Detection

Short-Time Processing Speech signal is inherently non-stationary For continuant phonemes there are stationary periods of

at least 20-25ms The short-time speech frames are assumed stationary The frame length should be chosen to include just one

phoneme or allophone Frame lengths are usually chosen to be between 10-

50ms We consider rectangular and Hamming windows here

3

Page 4: 1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling  Pitch Detection

Rectangular Window

Page 5: 1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling  Pitch Detection

Hamming Window

Page 6: 1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling  Pitch Detection

Comparison of Windows

Page 7: 1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling  Pitch Detection

Comparison of Windows (cont’d)

Page 8: 1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling  Pitch Detection

Linear Prediction Coding (LPC) Based on all-pole model for speech production system:

In time domain, we get:

In other words, we can predict s[n] as a function of p previous signal samples (and the excitation).

The set of {ak} is one way of representing the time varying filter. There are many other ways to represent this filter (e.g., pole value, Lattice filter value, LSP, …).

p

k

kk za

AzH

1

.1)(

][][.][1

nAuknsans g

p

kk

Page 9: 1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling  Pitch Detection

LPC parameter estimation There are many methods to estimate the

LPC parameters:Autocorrelation method: results in the

optimization of a in a set of p linear equations. Covariance method

Procedures (such as Levinson-Durbin, Burg, Le Roux) obtain efficient estimation of these parameters.

Page 10: 1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling  Pitch Detection

LPC Parameters in Coding (vocoders)

DT impulse

generator

G(z)glottalfilter

whitenoise

generator

H(z)vocal tract

filter

R(z)lip radiation

filter

s(n)speechsignal

voiced

unvoiced

Θ0

gain

Θ0

gain

Pitch period, P

DT impulse

generator

whitenoise

generator

all-polefilter

s(n)speechsignal

voiced

unvoicedΘ0

gain

Pitch period, P

V

UV

V

UV

Page 11: 1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling  Pitch Detection

11

Linear Prediction (Introduction): The object of linear prediction is to

estimate the output sequence from a linear combination of input samples, past output samples or both :

The factors a(i) and b(j) are called predictor coefficients.

p

i

q

j

inyiajnxjbny10

)()()()()(ˆ

Page 12: 1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling  Pitch Detection

12

Linear Prediction (Introduction): Many systems of interest to us are describable

by a linear, constant-coefficient difference equation :

If Y(z)/X(z)=H(z), where H(z) is a ratio of polynomials N(z)/D(z), then

Thus the predictor coefficients give us immediate access to the poles and zeros of H(z).

q

j

p

i

jnxjbinyia00

)()()()(

p

i

iq

j

j ziazDzjbzN00

)()( and )()(

Page 13: 1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling  Pitch Detection

13

Linear Prediction (Types of System Model): There are two important variants :

All-pole model (in statistics, autoregressive (AR) model ) :

The numerator N(z) is a constant.All-zero model (in statistics, moving-average

(MA) model ) : The denominator D(z) is equal to unity.

The mixed pole-zero model is called the autoregressive moving-average (ARMA) model.

Page 14: 1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling  Pitch Detection

14

Linear Prediction (Derivation of LP equations): Given a zero-mean signal y(n), in the AR

model :

The error is :

To derive the predictor we use the orthogonality principle, the principle states that the desired coefficients are those which make the error orthogonal to the samples y(n-1), y(n-2),…, y(n-p).

p

i

inyiany1

)()()(ˆ

p

i

inyia

nynyne

0

)()(

)(ˆ)()(

Page 15: 1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling  Pitch Detection

15

Linear Prediction (Derivation of LP equations):Thus we require that

Or,

Interchanging the operation of averaging and summing, and representing < > by summing over n, we have

The required predictors are found by solving these equations.

p..., 2, 1,jfor 0)()( nejny

0)()()(0

p

i

inyiajny

p1,...,j ,0)()()(0

n

p

i

jnyinyia

Page 16: 1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling  Pitch Detection

16

Linear Prediction (Derivation of LP equations): The orthogonality principle also states that resulting

minimum error is given by

Or,

We can minimize the error over all time :

where

Eriap

ii

0

)(

)()()(2 nenyneE

Enyinyian

p

i

)()()(0

n

i inynyr )()(

, ...,p,jria ji

p

i

21 ,0)(0

Page 17: 1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling  Pitch Detection

17

Linear Prediction (Applications): Autocorrelation matching :

We have a signal y(n) with known autocorrelation . We model this with the AR system shown below :

)(nryy

p

i

ii za

zAzH

1

1)(

)(

)(neσ

1-A(z)

)(ny

Page 18: 1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling  Pitch Detection

18

Linear Prediction (Order of Linear Prediction): The choice of predictor order depends on

the analysis bandwidth. The rule of thumb is :

For a normal vocal tract, there is an average of about one formant per kilo Hertz of BW.

One formant requires two complex conjugate poles.

Hence for every formant we require two predictor coefficients, or two coefficients per kilo Hertz of bandwidth.

cBW

p 1000

2

Page 19: 1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling  Pitch Detection

19

Linear Prediction (AR Modeling of Speech Signal): True Model:

DTImpulse

generator

G(z)GlottalFilter

UncorrelatedNoise

generator

H(z)Vocal tract

Filter

R(z)LP

Filter

Voiced

Unvoiced

Pitch Gain

Gain

V

U

U(n)

Voiced

Volume

velocity

s(n)

Speech

Signal

Page 20: 1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling  Pitch Detection

20

Linear Prediction (AR Modeling of Speech Signal): Using LP analysis :

DTImpulse

generator

WhiteNoise

generator

All-PoleFilter(AR)

Voiced

Unvoiced

Pitch

Gain

estimate

V

U

H(z)

s(n)

Speech

Signal

Page 21: 1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling  Pitch Detection

Introduction to Vocoders

Beside the estimation of the vocal tract parameters, a vocoder needs excitation estimation.

In early vocoders, this has been achieved by the estimation of V/UV, pitch, and gain.

More modern vocoders involve more sophisticated estimation of the excitation, such as in CELP, where vector quantization is used.

vocoderanalysis

Channel(or storage)

vocodersynthesizer

ŝ(n)synthesized

speechsignal

V/UVpitch

filter parameterss(n)original speechsignal

Page 22: 1 Linear Prediction. Outline Windowing LPC Introduction to Vocoders Excitation modeling  Pitch Detection

Pitch Detection

Because speech signal in voiced frames is quasi-periodic (and not fully periodic), the pitch detection is not always easy.

Especially in some phonemes that manifest less periodic behavior, pitch detection is difficult.

Some pitch detection methods:AMDF (Average Magnitude Difference Function)Autocorrelation with center clipping