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

📄 wptour.sci

📁 小波分解源代码
💻 SCI
字号:
function [wp, btree] = WPTour(Format,x,D,qmf,titlestr)
// WPTour -- Wavelet packet decomposition & Best Basis analysis
//  Usage
//    [wp, btree] = WPTour(Format,x,D,qmf,title)
//  Inputs  
//    Format  string: 'S' for sequential display of four figures
//                    'P' for four-panel display  
//    x       1-d signal to analyze by Wavelet Packets
//    D       fineness of frequency splitting
//    qmf     quadrature mirror filter (e.g. Coiflet c3)
//    title   name of signal
//  Outputs
//    wp      Wavelet packet table (see WPAnalysis)
//    btree   basis tree of best time-frequency basis
//
//  Description
//    The format string controls whether all four displays
//    are drawn as subplots in one figure, or whether they are
//    drawn one-after-the-other on the same figure
//
//    The global PREFERIMAGEGRAPHICS controls whether the phase
//    portrait is done using ``image'' graphics (if =1) or ``plot''
//    graphics (if =0).
//
//  Side Effects
//    plot of Wavelet packet Table
//    tree plot, best basis
//    phase plot, best basis
//    printout, entropy, best basis
//
//  See Also
//    WPAnalysis, BestBasis, PlotPhasePlane, PlotBasisTree
//
//  Copyright Aldo I Maalouf

	global PREFERIMAGEGRAPHICS
	if ~mtlb_exist('PREFERIMAGEGRAPHICS'),   
	   PREFERIMAGEGRAPHICS = 0;
	end

	wp = WPAnalysis(x,D,qmf);

	mtlb_clf
	if string(Format(1))=='P',
		mtlb_subplot(221)
	end

	PlotPacketTable(wp);
	signaltitle = [ 'Wavelet Packet Analysis ' titlestr];
	xtitle(signaltitle); ylabel('Split Level'); xlabel('Frequency[Time]')//

	if string(Format(1))=='S',
	    HitAnyKey
	end

	stree = CalcStatTree(wp,'Entropy');
	[btree,vtree] = BestBasis(stree,D);

	if string(Format(1))=='P',
	    mtlb_subplot(222)
	end

	signaltitle = [' WP Best Basis; ' titlestr];
	PlotBasisTree(btree,D,stree,signaltitle);
	xlabel('Frequency Domain Splits')        //
	ylabel('Entropy Gain')

	if string(Format(1))=='S',
	    HitAnyKey
	end

	if string(Format(1))=='P',
	    mtlb_subplot(223)
	end

//	PlotPhaseTiling('WP',btree,wp,signaltitle);
	wpcoef = UnpackBasisCoeff(btree,wp);
	PlotCompressNumbers(wpcoef,signaltitle);


	if string(Format(1))=='S',
	    HitAnyKey
	end

	if string(Format(1))=='P',
	    mtlb_subplot(224)
	end

	if PREFERIMAGEGRAPHICS,
	     ImagePhasePlane('WP',btree,wp,signaltitle,256,qmf)
	else 
	     PlotPhasePlane('WP',btree,wp,signaltitle)
	end

	if string(Format(1))=='S',
	    HitAnyKey
	end
	endfunction

⌨️ 快捷键说明

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