No BSD License  

Highlights from
speech processing tool

image thumbnail
from speech processing tool by MEKHMOUKH Abdenour
speech processing tool

lpc_spectrum(x,LPC_ORDER)
% [H] = lpc_spectrum(x,LPC_ORDER)
%  where x is input speech, and LPC_ORDER is the order of LPC analysis.
function [H] = lpc_spectrum(x,LPC_ORDER)

if nargin < 2, LPC_ORDER = 18; end
l=length(x);
w= 0:2*pi/l:(l-1)/l*pi;  %%%FREQUENCY BINS
w_matrix=ones(LPC_ORDER,1)*w;      
one=ones(size(w));
exp_term = exp(-j*([1:LPC_ORDER]'*ones(1,l/2)).*w_matrix);  %%%exp(jkw) terms in Ps(w)
R=autocorr(x(1:l),LPC_ORDER);
a=durbin(R);
denom_Ps_w = one ./ (abs(one - a'*exp_term).^2);
noise_gain = R(1) - sum(a.*R(2:LPC_ORDER+1));
H = noise_gain / l * denom_Ps_w;   %%%Noise spectrum from AR model

Contact us at files@mathworks.com