dsample.m
来自「里面囊括了基于matlab滤波器设计的各种.m文件」· M 代码 · 共 29 行
M
29 行
% f = dsample(h,M)
% DSAMPLE
% To decimate the vector h with the factor of
% M(positive integer and M>1). The decimation result
% is function reture vector. The method is only simple
% selection.
% See also USAMPLE and UPSAMPLE in Wavelab.
function f = dsample(h,M)
N=length(h);
if nargin < 2
error('Not enough input arguments');
else
if M > N
disp('Vector length need be greater or equal to M');
elseif M == N
f = h(1);
else
f = h(1);
for I = 2:N
if rem(I-1,M) == 0
f = [f;h(I)];
end
end
end
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?