?? sinc_interp.m
字號:
function out = sinc_interp(x, a)% sinc_interp -- sinc interpolate a signal%% Usage% y = sinc_interp(x, a)%% Inputs% x signal vector% a interpolation factor (optional, default is 2)%% Outputs% y interpolated vector. If N=length(x) then% length(y) = a*N-a+1 and y(1:a:end) = x.% No extrapolation is done.%% Surprisingly this does not seem to be included with matlab.% Copyright (C) -- see DiscreteTFDs/Copyrighterror(nargchk(1, 2, nargin));if (nargin < 2) a = 2;endx = x(:);N = length(x);M = a*N-a+1;% y has length: a*N-a+1y = zeros(M,1);y(1:a:M) = x;% h has length: 2*(a*N-a-1)+1h = sinc([-(N-1-1/a):1/a:(N-1-1/a)]');% out has length 3*(a*N-a)-1out = lconv(y, h);% what we want has length: a*N-a+1out = out(a*N-a:end-a*N+a+1);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -