largestr.m
来自「linear time-frequency toolbox」· M 代码 · 共 39 行
M
39 行
function [xo,N]=largestr(xi,p)%LARGESTR Keep largest ratio of coefficients.% Usage: xo=LARGESTR(x,p);% [xo,N]=LARGESTR(x,p);%% LARGESTR(x,p) returns an array of the same size as x keeping% the fraction p of the coefficients. The largest coefficients% are kept.%% [xo,N]=LARGESTR(xi,p) will additionally return the number of% coefficients kept.%% Note that if this function is used on coefficients coming from a% redundant transform or from a transform where the input signal was% padded, the coefficient array will be larger than the original input% signal. Therefore, the number of coefficients kept might be higher% than expected.%% SEE ALSO: LARGESTN%% REFERENCES:% S. Mallat. A wavelet tour of signal processing. Academic Press, San Diego,% CA, 1998.if nargin~=2 error('Wrong number of input arguments.');end;if (prod(size(p))~=1 || ~isnumeric(p)) error('p must be a scalar.');end;% Determine the size of the array.ss=prod(size(xi));N=round(ss*p);xo=largestn(xi,N);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?