⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 toon0742.m

📁 老外写的小波变换的工具箱
💻 M
字号:
% toon0742 -- Visualize wavelet packet decomposition of SlowChirp
%
	n = 1024;
	t = (1:n)./n;
	MAXPLOTS = 25;
	xi  		= pi/5 .* t;
	SlowChirp   = cos(xi .* (1:n));
	qmf = MakeONFilter('Symmlet',8);
	D   = 10;
%
	wp  = WPAnalysis(SlowChirp,D,qmf);
	st  = CalcStatTree(wp,'Entropy');
	bb  = BestBasis(st,D);
	cf  = UnpackBasisCoeff(bb,wp);
	wc  = cf ./norm(cf);
	count = min([sum(abs(wc) > 1.e-2) MAXPLOTS]);
clf;
%subplot(221); plot(t,SlowChirp); title('SlowChirp');
%subplot(223); PlotPacketTable(wp); title('WP[SlowChirp]');
%ylabel('split level'); xlabel('Frequency[Time]')
%
	subplot(121);
	LockAxes([0 1 0 MAXPLOTS+1]);
	title('First 25 WP Components of SlowChirp');
	subplot(122);
	LockAxes([0 1 MAXPLOTS 2*MAXPLOTS+1]);
	title('Next 25 WP Components of SlowChirp');
%
	cwp  = zeros(size(wp));
	cwp = PackBasisCoeff(bb,cwp,cf);
	nplot = 0;
	subplot(121);
	for kk=1:50,
	   if kk == 26,
	      drawnow;
	      subplot(122);
	   end
	   [amp,ind] = max(abs(cwp(:)));
	   [d,b,k] = ix2pkt(ind,D,n);
	   dwp     = WPImpulse(cwp,d,b,k,qmf);
	   wcmp    = dwp(:,1)';
	   nplot = nplot+1;
	   plot(t,nplot + cwp(ind).*wcmp);
	   txt = sprintf('(%1.0f,%2.0f,%2.0f)',d,b,k);
	   text(.87,nplot+.275,txt);
	   cwp(ind) = 0;
	end
%
	drawnow;
	subplot(121); UnlockAxes;
	subplot(122); UnlockAxes;
    
    
  %%  Part of Wavelab Version 850%  Built Tue Jan  3 13:20:43 EST 2006%  This is Copyrighted Material%  For Copying permissions see COPYING.m%  Comments? e-mail wavelab@stat.stanford.edu 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -