ttfig4.m

来自「% Atomizer Main Directory, Version .802 」· M 代码 · 共 72 行

M
72
字号
% ttfig4: Tutorial Demo -- Analyze Transients
% Signal: 
%	Transients
%	Ref: Mallat & Zhang (1993), 
%	     Matching Pursuits with Time-Frequency Dictionaries
% Sample Size:	1024
% Dictionary:
%	Wavelet Packet 
%	D = 10, qmf = (Symmlet, 8)
% Observation:
%	(a) Signal: Transients
%	(b,c,d) Phase Planes
%	    Basis Pursuit gives a cleaner phase plane, clearly resolving
%	    the two chirps and several crossing behaviors
%
fig_label=get(0,'Children');
for fi=1:prod(size(fig_label))
   if fi>2
      close (fig_label(fi));
   end
end

help ttfig4

%Signal
x = InputSignal('Transients');

%Sample Size
n = length(x);

%Dictionary
D = log2(n);
qmf = MakeONFilter('Symmlet', 8);

NameOfDict = 'WP';
par1 = D;
par2 = qmf;
par3 = 0;


%Decomposition
cBOB = BOB(x, 'WP', D, qmf, 0);
cMP = MP(x, 'WP', D, qmf, 0);
cBP = BP_Interior(x, 'WP', D, qmf, 0, 1e-1, 1e-1, 1e-1, 10);

disp(' ')
disp('Plot ...')
%Figures
figure(1);clf;
subplot(2,2,1);
t = (1:n)' / n;
plot(t, x);
title('(a) Signal: Transients')

%phase planes:
%(1) make sure the 4 phase planes at the same scale
%(2) PhasePlane routine needs qmf for 'WP'
TFScale = max(abs([cBOB; cMP; cBP])) ^ 2;
subplot(2,2,2);PhasePlane(cBOB, 'WP', n, qmf, 256, TFScale);
subplot(2,2,3);PhasePlane(cMP, 'WP', n, qmf, 256, TFScale);
subplot(2,2,4);PhasePlane(cBP, 'WP', n, qmf, 256, TFScale);

subplot(2,2,2); title('(b) Phase Plane: From Best Ortho Basis')
subplot(2,2,3); title('(c) Phase Plane: From Matching Pursuit')
subplot(2,2,4); title('(d) Phase Plane: From BasisPursuit')

colormap('hot')
brighten(.5)
brighten(.5)

help ttfig4

⌨️ 快捷键说明

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