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

📄 interpolate.m

📁 the implement of the encoder and the decoder of the CELP
💻 M
字号:
function [ x, y ] = interpolate( x, start, n, d, m )

global TRUE FALSE nfrac

global dfrac twelfth wsinc FirstComp dlysize dlyml dlymh szsubf

y = zeros( 1, szsubf );
kmin = dlyml;
kmax = kmin + dlysize - 1;

% Get hamming windowed sinc interpolating function for each fraction.
if FirstComp == TRUE
    hwin = hamming( (12*dlysize) + 1 )';
    for i = 1:nfrac
        wsinc( i,1:dlysize ) = sinc( dfrac(i) + (kmin:kmax) ) .* ...
                                  hwin( 12*(0:dlysize-1) + twelfth(i) + 1 );
    end
    FirstComp = FALSE;
end

% find the corresponding index
indx=find(abs(dfrac-d)<10e-4);

% resample
for i = 0:n-1
    x( start + i ) = sum( x( start - m + i + (kmin:kmax) ) .* ...
                          wsinc(indx,(1:dlysize)));
end

y( 1:n ) = x( start:start+n-1 );
x( start:start+n-1 ) = zeros( 1, n );

⌨️ 快捷键说明

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