⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sp1.m

📁 自己写的关于lpc分析与合成的Demo程序
💻 M
字号:

randn('state',1);
noise = randn(50000,1);  % Normalized white Gaussian noise
s = filter(1,[1 1/2 1/3 1/4 ],noise);
x = s(45904:50000);


[a,E] = lpc(x,10);
est_x = filter([0 -a(2:end)],1,x);    % Estimated signal
e = x - est_x;                        % Prediction error
[acs,lags] = xcorr(e,'coeff');  


figure(1)
plot(1:97,x(4001:4097),1:97,est_x(4001:4097),'--');
title('Original Signal vs. LPC Estimate');
xlabel('Sample Number'); ylabel('Amplitude'); grid;
legend('Original Signal','LPC Estimate')

figure(2)
plot(lags,acs); 
title('Autocorrelation of the Prediction Error');
xlabel('Lags'); ylabel('Normalized Value'); grid;

acsFFT=fft(acs);
figure(3);
plot(1:length(acs),fftshift(abs(acsFFT)));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -