📄 ttfig5.m
字号:
% ttfig5: Tutorial Demo -- Analyze Greasy
% Signal:
% "S" segment from the "Greasy" signal
% Ref: Mallat & Zhang (1993),
% Matching Pursuits with Time-Frequency Dictionaries
% Sample Size: 2048
% Dictionary:
% Cosine Packet
% D = 7
% Observation:
% (a) Signal: "S" from "Greasy"
% (b) BOB finds the right phase plane, since the best basis for
% Beryllium is orthogonal.
% (c) MP phase plane is a little messy about the true location,
% since MP couldn't resolve the similarity among the 4 atoms.
% (d) BP does a perfect job as BOB.
%
fig_label=get(0,'Children');
for fi=1:prod(size(fig_label))
if fi>2
close (fig_label(fi));
end
end
help ttfig5
disp('This is going to take quite long -- Do you want to go on ?')
disp('Press any key to continue')
disp('Control-C to stop')
pause
%Signal
x = ReadSignal('Greasy');
x = x(3400:3400+2047);
%Sample Size
n = length(x);
%Dictionary: 'CP' with D = log2(n) -4
D = log2(n);
%Decomposition
cBOB = BOB(x, 'CP', D-4, 0, 0);
cMP = MP(x, 'CP', D-4, 0, 0);
cBP = BP_Interior(x, 'CP', D-4, 0, 0, 1e-3, 1e-3, 1e-3, 10);
disp(' ')
disp('Plot ...')
%Figures
figure(1);clf;
subplot(2,2,1);
t = (1:n)' / n;
plot(t, x);
title('(a) Signal: S from Greasy');
%phase planes:
%(1) make sure the 4 phase planes at the same scale
TFScale = max(abs([cBOB; cMP; cBP])) ^ 2;
subplot(2,2,2);PhasePlane(cBOB, 'CP', n, 0, 256, TFScale);
subplot(2,2,3);PhasePlane(cMP, 'CP', n, 0, 256, TFScale);
subplot(2,2,4);PhasePlane(cBP, 'CP', n, 0, 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')
help ttfig5
subplot(2,2,2);PhasePlane(cBOB, 'CP', n);
subplot(2,2,3);PhasePlane(cMP, 'CP', n);
subplot(2,2,4);PhasePlane(cBP, 'CP', n);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -