an estimate of the effective width of wavelet filter FORMAT w = width(obj, varargin) Intended to give number of points over which the lowpass filter has important power Inputs obj - input wavelet object varargin - any other necessary args to wavelet filter Ouputs w - estimated width in datapoints $Id: width.m,v 1.2 2005/06/05 04:21:27 matthewbrett Exp $
0001 function w = width(obj, varargin) 0002 % an estimate of the effective width of wavelet filter 0003 % FORMAT w = width(obj, varargin) 0004 % 0005 % Intended to give number of points over which the lowpass filter has 0006 % important power 0007 % 0008 % Inputs 0009 % obj - input wavelet object 0010 % varargin - any other necessary args to wavelet filter 0011 % 0012 % Ouputs 0013 % w - estimated width in datapoints 0014 % 0015 % $Id: width.m,v 1.2 2005/06/05 04:21:27 matthewbrett Exp $ 0016 0017 [tmp G] = get_filters(obj, varargin{:}); 0018 0019 % Get 2.5 97.5 centile range of density of squared coefficients 0020 % (seemed like a good idea at the time) 0021 dens = cumsum(G.^2); 0022 dens = dens / dens(end); 0023 in_d = find(dens > 0.025 & dens < 0.975); 0024 if isempty(in_d) 0025 w = 1; 0026 else 0027 w = in_d(end) - in_d(1) + 1; 0028 end