ieaou_error_signal.m
来自「LPC分析是进行语音分析的有效技术之一」· M 代码 · 共 48 行
M
48 行
news = fopen('ieaou.pcm' ,'rb');
x = fread(news , 'short')/2^15;
fclose(news);
LENGTH=320 ; % length of x[n]
fs=8000; % sampling rate
n=0:1/fs:(LENGTH-1)/fs;
x_i=x(20001:20320);
x_e=x(32001:32320);
x_a=x(48001:48320);
x_o=x(64001:64320);
x_u=x(80001:80320);
x=[x_i x_e x_a x_o x_u];
% original speech signal %
subplot(5,2,1),plot(n*1000, x(:,1))
xlabel('time[msec]'), ylabel('/i/'),title('Signal')
subplot(5,2,3),plot(n*1000, x(:,2)),ylabel('/e/')
subplot(5,2,5),plot(n*1000, x(:,3)),ylabel('/a/')
subplot(5,2,7),plot(n*1000, x(:,4)),ylabel('/o/')
subplot(5,2,9),plot(n*1000, x(:,5)),ylabel('/u/')
order=12; % order
[a,g]=lpc(x_i,order); % predictor coefficients
est_x_i=filter([0 -a(2:end)],1,x_i); % Estimated signal
error_i=x_i-est_x_i; % Prediction error
subplot(5,2,2),plot(n*1000,error_i)
xlabel('time[msec]'),title('Prediction Error')
[a,g]=lpc(x_e,order); % predictor coefficients
est_x_e=filter([0 -a(2:end)],1,x_e); % Estimated signal
error_e=x_e-est_x_e;
subplot(5,2,4),plot(n*1000,error_e)
[a,g]=lpc(x_a,order); % predictor coefficients
est_x_a=filter([0 -a(2:end)],1,x_a); % Estimated signal
error_a=x_a-est_x_a;
subplot(5,2,6),plot(n*1000,error_a)
[a,g]=lpc(x_o,order); % predictor coefficients
est_x_o=filter([0 -a(2:end)],1,x_o); % Estimated signal
error_o=x_o-est_x_o;
subplot(5,2,8),plot(n*1000,error_o)
[a,g]=lpc(x_u,order); % predictor coefficients
est_x_u=filter([0 -a(2:end)],1,x_u); % Estimated signal
error_u=x_u-est_x_u;
subplot(5,2,10),plot(n*1000,error_u)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?