subsamp.m
来自「CDMA系统的完整仿真程序,供大家参考.」· M 代码 · 共 20 行
M
20 行
function Y=subsamp(X,N)
%SUBSAMP Subsamples the input X by an amount N, using averaging
% Y=subsamp(X,N)
% The samples are subsampled as rows. Thus if X is a matrix
% each row is subsampled.
% If the length of X is not a multiple of N samples then remaining
% samples are ignored.
%Modified:
% 10/7/97 Started function. This function is finished and tested.
X=X(:,1:floor(size(X,2)/N)*N);
if (size(X,2) > 1)&(N>1),
Y = zeros(size(X,1),size(X,2)/N);
for k = 1:size(X,1),
Y(k,:)=mean(reshape(X(k,:),N,size(X,2)/N));
end
else
Y=X;
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?