📄 bpfig26.m
字号:
% bpfig26: BP Figure 2.6 -- Analyzing WernerSorrows
%----------------------------------------------------------------------
%
% (1) BOB by C-W entropy can be improved by BOB by l^1 entropy.
% (2) BOB by l^1 entropy can be improved by BP.
%
% Signal: WernerSorrows
% Signal Length: 1024
% Dictionary: Cosine Packets with D = log2(n)-4
% Observations:
% (a) Signal: WernerSorrows, a signal made up of a sinusoid and
% two chirps.
% (b) Phase plane from BOB by C-W entropy(like l^2). BOB chooses
% Fourier basis, and totally fails to find the chirp structures.
% (c) Phase plane from BOB by l^1 entropy. We can basically observe
% the three structures in the signal.
% (d) Phase plane from BP. Compared with (c), BP clearly
% reveals the sinusoid and the two chirps.
%
% Use:
% bpfig26 uses the current solver.
% ATOMIZER_ENGINE = 1998; selects original solver.
% ATOMIZER_ENGINE = 2001; selects later solver.
% Default is most recent solver.
%----------------------------------------------------------------------
%----------------------------------------------------------------------
% 1998: (S. Chen) Original script for BP paper.
% 09 Apr 2001: (M. Saunders) Choice of solvers implemented.
%----------------------------------------------------------------------
help bpfig26
bpengine;
n = 1024;
D = log2(n);
t = (1:n)' ./ n;
bell = 'Sine';
x = InputSignal('WernerSorrows',n);
%--------------------------------------
% BOB with Coifman-Wickerhauser Entropy
%--------------------------------------
cBOB1 = BOB(x, 'CP', D-4, bell, 0, 'Entropy');
%-------------------------------------
% BOB with l^1 Entropy
%-------------------------------------
time = cputime;
cBOB2 = BOB(x, 'CP', D-4, bell, 0, 'l^p', 1);
time2 = cputime - time;
%-------------------------------------
% BP
%-------------------------------------
time = cputime;
switch ATOMIZER_ENGINE
case 1998
cBP = BP_Interior ( x, 'CP', D-4, bell, 0 );
case 2001
cBP = BP_Interior2( x, 'CP', D-4, bell, 0 );
end
time4 = cputime - time;
fprintf('\n')
fprintf('CPU Running Time of BOB = %8.4e\n', time2);
fprintf('CPU Running Time of BP = %8.4e\n', time4);
%--------------------
% Plots
%--------------------
fprintf('\nConstructing figure(%1g) ...\n', FIGURE)
figure(FIGURE); clf reset;
TFNORM = 64.5218;
subplot(2,2,1); plot(t,x);
title('(a) Signal: Werner Sorrows')
subplot(2,2,2); PhasePlane(cBOB1, 'CP', n, 0, 256, TFNORM);
title('(b) Phase Plane: BOB by C-W Entropy')
subplot(2,2,3); PhasePlane(cBOB2, 'CP', n, 0, 256, TFNORM);
title('(c) Phase Plane: BOB by l^1 Entropy')
subplot(2,2,4); PhasePlane(cBP , 'CP', n, 0, 256, TFNORM);
title('(d) Phase Plane: BP')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -