⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bpfig31.m

📁 % Atomizer Main Directory, Version .802 里面信号含有分解去噪合成过程的代码 %---------------------------------------
💻 M
字号:
% bpfig31: BP Figure 3.1 -- Analyzing Carbon
%----------------------------------------------------------------------
%
%	(1) BOB cannot separate nonorthogonal atoms.
%	(2) MP has difficulty in separate similar (close, overlapping) atoms.
%	(3) BasisPursuit could handle both nonorthogonal and similar atoms.
%
% Signal:        Carbon
% Signal Length: 512
% Dictionary:    Wavelet Packets with D = log2(n) and qmf = (Symmlet, 8)
% Observations:
%	(a) Signal: Carbon, which is made up of 4 close atoms from WP.
%	(b) MOF phase plane is smeared out and very weak.
%	(c) BOB fails to pick up the Dirac and two other atoms.
%	    Instead, it is using orthogonal atoms to represent the 
%	    nonorthogonal structure.
%	(d) MP picks up the Dirac and the sinusoid, but it fails to 
%	    separate the four close WP atoms. MP initially selects 
%	    neither one of the 4 true atoms. Instead, it selects
%	    the atom at the center of the 4 true atoms, the atom that
%	    has a bigger cosine product with the signal than any of
%	    the 4 true atoms. Because of this mistake, MP is forced to
%	    make a series of alternating corrections, which suggests
%	    a rather complicated structure.
%	(e) BP does a perfect job.
%
% Use:
%    bpfig31                   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 bpfig31
bpengine;

n   = 512;
D   = log2(n);
qmf = MakeONFilter('Symmlet', 8);
x   = InputSignal('Carbon', n);

time  = cputime;
cMOF  = MOF(x, 'WP', D, qmf, 0);
time1 = cputime - time;

time  = cputime;
cBOB  = BOB(x, 'WP', D, qmf, 0);
time2 = cputime - time;

time  = cputime;
cMP   = MP(x, 'WP', D, qmf, 0);
time3 = cputime - time;

%-------------------------------------
% BP
%-------------------------------------
time  = cputime;
switch ATOMIZER_ENGINE
  case 1998
    cBP = BP_Interior ( x, 'WP', D, qmf, 0 );
  case 2001
    cBP = BP_Interior2( x, 'WP', D, qmf, 0 );
end
time4 = cputime - time;

fprintf('\n')
fprintf('CPU Running Time of MOF = %8.4e\n', time1);
fprintf('CPU Running Time of BOB = %8.4e\n', time2);
fprintf('CPU Running Time of  MP = %8.4e\n', time3);
fprintf('CPU Running Time of  BP = %8.4e\n', time4);

%--------------------
% Plots
%--------------------
fprintf('\nConstructing figure(%1g) ...\n', FIGURE)
figure(FIGURE);   clf reset;

t = (1:n)' / n;
subplot(3,2,1);   plot(t, x);
                  title('(a) Signal: Carbon');
                  NameOfDict = 'WP';   par2 = qmf;   TFScale = 1;
subplot(3,2,2);   PhasePlane(cBP , NameOfDict, n, par2, 256, TFScale);
subplot(3,2,3);   PhasePlane(cMOF, NameOfDict, n, par2, 256, TFScale);
subplot(3,2,4);   PhasePlane(cBOB, NameOfDict, n, par2, 256, TFScale);
subplot(3,2,5);   PhasePlane(cMP , NameOfDict, n, par2, 256, TFScale);
subplot(3,2,6);   PhasePlane(cBP , NameOfDict, n, par2, 256, TFScale);
subplot(3,2,2);   title('(b) Phase Plane: Ideal')
subplot(3,2,3);   title('(c) Phase Plane: MOF')
subplot(3,2,4);   title('(d) Phase Plane: BOB')
subplot(3,2,5);   title('(e) Phase Plane: MP')
subplot(3,2,6);   title('(f) Phase Plane: BP')

⌨️ 快捷键说明

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