exa4_21.m
来自「matlab应用实例。如:FIR、IIR数字滤波器设计等。」· M 代码 · 共 25 行
M
25 行
% exa4-21_lpc.m , for example 4-21
% Design lpc DF
clear all;
randn('state',0);
noise = randn(50000,1); % Normalized white Gaussian noise
x = filter(1,[1 1/2 1/3 1/4],noise);
x = x(45904:50000);
a = lpc(x,3);
est_x = filter([0 -a(2:end)],1,x); % Estimated signal
e = x - est_x; % Prediction error
[acs,lags] = xcorr(e,'coeff'); % ACS of prediction error
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;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?