lpcsynth.m

来自「非常好的数字处理教程」· M 代码 · 共 49 行

M
49
字号
function d = lpcsynth(a,g,e,h)% d = lpcsynth(a,g,e,h)   Resynthesize from LPC representation%    Each row of a is an LPC fit to a h-point (non-overlapping) %    frame of data.  g gives the overall gains for each frame and %    e is an excitation signal (if e is empty, white noise is used; %    if e is a scalar, a pulse train is used with that period).%    Return d as the resulting LPC resynthesis.% 2001-02-25 dpwe@ee.columbia.eduif nargin < 3  e = [];endif nargin < 4  h = 128;end[nhops,p] = size(a);npts = nhops*h;if length(e) == 0  e = randn(1,npts);elseif length(e) == 1  pd = e;  e = sqrt(pd) * (rem(1:npts,pd) == 0);else	if (length(e) < npts)		ptsdif = npts - length(e);		while (ptsdif > 0)			e = repmat(e,2,1);			ptsdif = npts - length(e);		end	endendd = 0*e;for hop = 1:nhops  hbase = (hop-1)*h;  aa = a(hop,:);  G = g(hop);  newbit = G*filter(1, aa, e(hbase + [1:h]));  d(hbase + [1:h]) = newbit;end% De-emphasis (must match pre-emphasis in lpcfit)pre = [1 -0.9];d = filter(1,pre,d);

⌨️ 快捷键说明

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