IPB

Welcome Guest ( Log In | Register )

LPC spectra estimate
hyeewang
post Feb 6 2009, 03:26
Post #1





Group: Members
Posts: 99
Joined: 2-August 07
From: Shanghai,China
Member No.: 45817



LPC spectra should correspond with the envelope of DFT spectra.

I plot LPC spectra with matlab. The LPC spectra keep the same shape with the envelope of DFT spectra.

But it is larger with a offset than the DFT envelope.

Why? Where it go wrong?

Here is the matlab script which illustrate it.

N = 2560;
[x,fs] = wavread('lpc.wav',N); % any speech signal can be used

p=12;
a = lpc(x,p);

X =fft(x);
X = X(1:N/2+1)';
X = 10*log10(abs(X).^2);

Z = fft(a,N);
Z = 1./Z(1:N/2+1);
Z = 10*log10(abs(Z).^2);

figure;
plot(X');
hold on;
plot(Z,'r');
grid;
offset = 10;
figure;
plot(X+offset);
hold on;
plot(Z,'r');
grid;
Go to the top of the page
+Quote Post
 
Start new topic
Replies
hyeewang
post Feb 7 2009, 15:51
Post #2





Group: Members
Posts: 99
Joined: 2-August 07
From: Shanghai,China
Member No.: 45817



QUOTE (hyeewang @ Feb 7 2009, 10:26) *
QUOTE (SebastianG @ Feb 7 2009, 07:10) *
QUOTE (hyeewang @ Feb 6 2009, 03:26) *
LPC spectra should correspond with the envelope of DFT spectra.
I plot LPC spectra with matlab. The LPC spectra keep the same shape with the envelope of DFT spectra.
But it is larger with a offset than the DFT envelope.
Why? Where it go wrong?

What you call "LPC spectra" (by which you probably mean the LPC synthesis filter response) is independent of the input signal's level. If I remember correctly Matlab's LPC function can return more than the set of filter coefficients -- one of those return values gives you a hint about the scaling of the input.

Cheers!
SG


Thank you.

Great job.
It must be here that lpc coefficients were scaled. I would confirm it soon.



LPC function in matlab return LPC coefficients and prediction error variance sigma^2. And LPC coefficients lost important signal energy

information.

But I still do not get the exact scale factor from returned value of lpc function.

Cheers
Go to the top of the page
+Quote Post
SebastianG
post Feb 7 2009, 16:54
Post #3





Group: Developer
Posts: 1318
Joined: 20-March 04
From: Göttingen (DE)
Member No.: 12875



QUOTE (hyeewang @ Feb 7 2009, 15:51) *
QUOTE (SebastianG @ Feb 7 2009, 07:10) *

What you call "LPC spectra" (by which you probably mean the LPC synthesis filter response) is independent of the input signal's level. If I remember correctly Matlab's LPC function can return more than the set of filter coefficients -- one of those return values gives you a hint about the scaling of the input.

LPC function in matlab return LPC coefficients and prediction error variance sigma^2.

Bingo!

Guess what happens to this sigma^2 if you scale your input by factor two...

Cheers!
SG
Go to the top of the page
+Quote Post
hyeewang
post Feb 8 2009, 02:58
Post #4





Group: Members
Posts: 99
Joined: 2-August 07
From: Shanghai,China
Member No.: 45817



QUOTE (SebastianG @ Feb 7 2009, 23:54) *
QUOTE (hyeewang @ Feb 7 2009, 15:51) *
QUOTE (SebastianG @ Feb 7 2009, 07:10) *

What you call "LPC spectra" (by which you probably mean the LPC synthesis filter response) is independent of the input signal's level. If I remember correctly Matlab's LPC function can return more than the set of filter coefficients -- one of those return values gives you a hint about the scaling of the input.

LPC function in matlab return LPC coefficients and prediction error variance sigma^2.

Bingo!

Guess what happens to this sigma^2 if you scale your input by factor two...

Cheers!
SG


Thank you.

It cause sigma^2 to rise 4 times by scaling the input by factor two preceding lpc computation,.

but I still can not get the corresponding input signal power from prediction error variance sigma^2.

N = 25600;
[x,fs] = wavread('origsign.wav',N); % any speech signal can be used
y = 2*x;
p=20;
[a,ae] = lpc(x,p);
[b,be] = lpc(y,p);
be/ae

This post has been edited by hyeewang: Feb 9 2009, 06:53
Go to the top of the page
+Quote Post
SebastianG
post Feb 10 2009, 09:44
Post #5





Group: Developer
Posts: 1318
Joined: 20-March 04
From: Göttingen (DE)
Member No.: 12875



QUOTE (hyeewang @ Feb 8 2009, 02:58) *
but I still can not get the corresponding input signal power from prediction error variance sigma^2.

If you still havn't figured out the details try

Z = fft(a,N);
Z = sqrt(e*N) ./ Z(1:N/2+1); % <--- changed
Z = 10*log10(abs(Z).^2);

instead -- where 'e' is this sigma^2.

Cheers!
SG
Go to the top of the page
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 19th December 2014 - 03:42