MATLAB: Power spectral density via LPC

lpcpowe spectral denstiyspectrum

Hello,
I have question about LPC spectrum. I would like to compute LPC of given signal and compare it with PSD
x=loadbin('ma004009.ils');
fs=16e3;
tt=(0:slen-1)./fs ;
slen=length(x);
NFFT=slen;
y=fft(x3,NFFT);
Pyy=y.*conj(y);
Pyy=10*log10(Pyy); % PSD of signal
LPC spectrum
[en,a]=lpc(x,10);
N2=fft(en,NFFT);
Puu=N2.*conj(N2)/NFFT;
Puu=10*log10(Puu);
this gives me PSD of signal via LPC but the curve is upside up. why? And how to fix it? Thanks for any ideas.
Tomas

Best Answer

You want to multiply by -1 because its 1/Puu. For example:
load mtlb;
x = mtlb.*hamming(length(mtlb));
a = lpc(x,12);
NFFT = 2^nextpow2(length(mtlb));
lpcDft = fft(a,NFFT);
lpcDft = lpcDft(1:NFFT/2+1);
plot(-20*log10(abs(lpcDft)))
Related Question