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

📄 fpostfilter.m

📁 ITU-T G.723.1 Speech Coder: Matlab implementation This package implements the speech coder and de
💻 M
字号:
function [y, PFmem] = FPostFilter (x, a, PFmem, PFpar)% Formant postfilter (subframe)% x:  Input signal% a:  LP coefficients% $Id: FPostFilter.m 1.3 2004/08/03 G.723.1-v2r1a $% LP weightingNCof = a .* PFpar.ECWinN;DCof = a .* PFpar.ECWinD;[y1, PFmem.FMem] = PZFilter (NCof, DCof, x, PFmem.FMem);% First order correlationEx = x' * x;r1 = x(1:end-1)' * x(2:end);% Correlation coefficientif (Ex > PFpar.EThr)  CCofN = r1 / Ex;else  CCofN = 0;end% Smooth the correlation coefficient (tilt compensation)PFmem.CCof = (1 - PFpar.a) * PFmem.CCof + PFpar.a * CCofN;Cpre = PFpar.Tp * PFmem.CCof;[y2, PFmem.TMem] = PZFilter ([1 Cpre], 1, y1, PFmem.TMem);% Scaling[y, PFmem.Gain] = Scale_Signal (y2, Ex, PFmem.Gain, PFpar);return% -------------function [yS, Gain] = Scale_Signal (y, Et, Gain, PFpar)% Scale the energy of the output to match a target energyalpha = PFpar.alpha;AScale = PFpar.AScale;% Find the gain required to equalize the energiesEy = y' * y;if (Ey > PFpar.EThr)  G = sqrt (Et / Ey);else  G = 1;end% Sample-by-sample update of the gainN = length (y);for (i = 1:N)  Gain = (1 - alpha) * Gain + alpha * G;  yS(i,1) = AScale * y(i) * Gain;endreturn

⌨️ 快捷键说明

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