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

📄 bpfig34.m

📁 % Atomizer Main Directory, Version .802 里面信号含有分解去噪合成过程的代码 %---------------------------------------
💻 M
字号:
% bpfig34: BP Figure 3.4 -- Phase plane evolution at
%                           BP_Interior iterations
%----------------------------------------------------------------------
%
%          BP_Interior iteratively sparsifies the MOF solution.
%
% Signal:        FM-Cosine
% Signal Length: 1024
% Dictionary:    Cosine Packets with D = log2(n)-4
% Observations:
%    (a) Initial phase plane, i.e. the MOF phase plane.
%    (b) Phase plane at the 1st BP_Interior iteration.
%    (c) Phase plane at the 2st BP_Interior iteration.
%    (d) Phase plane at the 3st BP_Interior iteration.
%    (e) Phase plane at the 4st BP_Interior iteration.
%    (f) Phase plane at the BP_Interior iteration termination.
%
% Use:
%    bpfig34                   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 bpfig34
bpengine;

n    = 1024;
D    = log2(n);
qmf  = MakeONFilter('Symmlet', 8);
x    = InputSignal('FM', n);
b    = x(:);
cBPMovie = zeros(n * (D-4+1), 6);

% Set initial x.

NameOfDict = 'CP';   par1 = D-4;   par2 = 0;   par3 = 0;
[m L] = SizeOfDict(n, NameOfDict, par1, par2, par3);

x  = MOF(b, NameOfDict, par1, par2, par3, 1e-5);
cBPMovie(:,1) = x;
x  = [ x .* (x > 0) ; (-x) .* (x < 0) ];
sg = sign(x);
x  = x + .1;

% Juggle tolerances to make the solvers stop at the right iteration.

CGAccuracy = 1e-1;

switch ATOMIZER_ENGINE
  case 1998
    cBP = BP_Interior ( b, 'CP', D-4, 0, 0, 0.9, 0.9, CGAccuracy );
  case 2001
    cBP = BP_Interior2( b, 'CP', D-4, 0, 0, 0.9, 0.9 );
end
cBPMovie(:,2) = cBP;

switch ATOMIZER_ENGINE
  case 1998
    cBP = BP_Interior ( b, 'CP', D-4, 0, 0, 7e-1, 7e-1, CGAccuracy );
  case 2001
    cBP = BP_Interior2( b, 'CP', D-4, 0, 0, 1e-1, 1e-1 );
end
cBPMovie(:,3) = cBP;

switch ATOMIZER_ENGINE
  case 1998
    cBP = BP_Interior ( b, 'CP', D-4, 0, 0, 5e-1, 5e-1, CGAccuracy );
  case 2001
    cBP = BP_Interior2( b, 'CP', D-4, 0, 0, 4e-2, 4e-2 );
end
cBPMovie(:,4) = cBP;

switch ATOMIZER_ENGINE
  case 1998
    cBP = BP_Interior ( b, 'CP', D-4, 0, 0, 4e-1, 4e-1, CGAccuracy );
  case 2001
    cBP = BP_Interior2( b, 'CP', D-4, 0, 0, 1e-2, 1e-2 );
end
cBPMovie(:,5) = cBP;

switch ATOMIZER_ENGINE
  case 1998
    cBP = BP_Interior ( b, 'CP', D-4, 0, 0, 1e-1, 1e-1, CGAccuracy );
  case 2001
    cBP = BP_Interior2( b, 'CP', D-4, 0, 0, 1e-3, 1e-3 );
end
cBPMovie(:,6) = cBP;

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

TFScale = 20;
for i = 1:6
   subplot(3,2,i);
   PhasePlane(cBPMovie(:, i), 'CP', n, 0, 256, TFScale);
end
subplot(3,2,1);   title('Phase Plane: BP Iteration = 0');
subplot(3,2,2);   title('Phase Plane: BP Iteration = 1');
subplot(3,2,3);   title('Phase Plane: BP Iteration = 2');
subplot(3,2,4);   title('Phase Plane: BP Iteration = 3');
subplot(3,2,5);   title('Phase Plane: BP Iteration = 4');
subplot(3,2,6);   title('Phase Plane: BP Termination');

⌨️ 快捷键说明

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