www.gusucode.com > wavelet 源码程序 matlab案例代码 > wavelet/DefaultGlobalThresholdforWaveletPacketCompressionExample.m

    %% Default Global Threshold for Wavelet Packet Compression  
% Determine the default global compression threshold for an N(0,1) white
% noise input.   

%% 
% Create an N(0,1) white noise input. Set the random number generator to
% the default initial settings for reproducible results. 
dwtmode('per');
rng default;
x = randn(512,1);  

%% 
% Use |ddencmp| with the |'cmp'| and |'wp'| input arguments to return the
% default global compression threshold for a wavelet packet transform. 
[thr,sorh,keepapp,crit] = ddencmp('den','wp',x);