📄 ttfig4.m
字号:
% 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -