📄 cptour.sci
字号:
function [cp, btree] = CPTour(Format,x,D,titlestr)
// CPTour -- Cosine packet decomposition & Best Basis analysis
// Usage
// [cp, btree] = CPTour(Format,x,D,title)
// Inputs
// Format string: 'S' for sequential, 'P' for panel
// x 1-d signal to analyze by Cosine Packets
// D maximum depth of dyadic subdivision of time domain
// title name of signal [optional]
// Outputs
// cp packet table (see CPAnalysis)
// 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 Cosine packet Table
// tree plot, best basis
// phase plot, best basis
// printout, entropy, best basis
//
// See Also
// CPAnalysis, BestBasis, PlotPhasePlane, PlotBasisTree
//
// Copyright Aldo I Maalouf
global PREFERIMAGEGRAPHICS
if ~mtlb_exist('PREFERIMAGEGRAPHICS'),
PREFERIMAGEGRAPHICS = 0;
end
cp = CPAnalysis(x,D,'Sine');
mtlb_clf
if string(Format(1))=='P',
mtlb_subplot(221)
end
PlotPacketTable(cp);
signaltitle = [ 'Cosine Packet Analysis ' titlestr];
xtitle(signaltitle)
xtitle('','Time/Frequency', 'Split Level');
if string(Format(1))=='S',
HitAnyKey
end
stree = CalcStatTree(cp,'Entropy');
[btree,vtree] = BestBasis(stree,D);
if string(Format(1))=='P',
mtlb_subplot(222)
end
signaltitle = [' CP Best Basis; ' titlestr];
PlotBasisTree(btree,D,stree,signaltitle); //
xtitle('','Splits of Time Domain','Entropy Drop');
if string(Format(1))=='S',
HitAnyKey
end
if string(Format(1))=='P',
mtlb_subplot(223)
end
cpcoef = UnpackBasisCoeff(btree,cp);
PlotCompressNumbers(cpcoef,signaltitle);
if string(Format(1))=='S',
HitAnyKey
end
if string(Format(1))=='P',
mtlb_subplot(224)
end
if PREFERIMAGEGRAPHICS,
ImagePhasePlane('CP',btree,cp,signaltitle)//
else
PlotPhasePlane('CP',btree,cp,signaltitle) //
end
if string(Format(1))=='S',
HitAnyKey
end
endfunction
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -