bpfig33.m

来自「% Atomizer Main Directory, Version .802 」· M 代码 · 共 90 行

M
90
字号
% bpfig33: BP Figure 3.3 -- Analyzing Gong
%----------------------------------------------------------------------
%
% Signal:        Gong
%                s = cos(t * pi/2 * n) ./ ((1:n) .^ .5)';
%                s = [zeros(n/2,1); s(1:(n/2))];
% Signal Length: 1024
% Dictionary:    Cosine Packets with D = log2(n)-4
% Observations:
%    (a) Signal Gong
%    (b) MOF phase plane: weak and smeared out.
%    (c) BOB phase plane misses the decay structure of the Gong.
%    (d) MP is better the BOB, but still doesn't give a good
%        description of the decay structure.
%    (e) BP phase plane reveals the decay structure precisely.
%
% Use:
%    bpfig33                   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 bpfig33
bpengine;

n  = 1024;   D = log2(n);
t  = (1:n)' ./ n;
x  = cos(t * pi/2 * n) ./ ((1:n) .^ .5)';
nn = n / 2;
x  = [zeros(nn,1); x(1:(n - nn))];

time  = cputime;
cMOF  = MOF(x, 'CP', D, 0, 0);
time1 = cputime - time;
time  = cputime;
cBOB  = BOB(x, 'CP', D, 0, 0);
time2 = cputime - time;
time  = cputime;
cMP   = MP (x, 'CP', D, 0, 0);
time3 = cputime - time;

time  = cputime;
switch ATOMIZER_ENGINE
  case 1998
    cBP = BP_Interior (x, 'CP', D, 0, 0, 1e-3, 1e-3, 1e-3);
                                  % Was  1e-4, 1e-4, 1e-4,  but no need.
  case 2001
    cBP = BP_Interior2(x, 'CP', D, 0, 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;

subplot(3,2,1);   plot(t, x);
                  axis([0 1 -1 1]);
                  title('(a) Signal: Gong');
subplot(3,2,6);   [TF TFScale] = PhasePlane(cBP, 'CP', n);
                  title('(f) Phase Plane: BP');
subplot(3,2,3);   PhasePlane(cMOF, 'CP', n, 0, 256, TFScale);
                  title('(c) Phase Plane: MOF');
subplot(3,2,4);   PhasePlane(cBOB, 'CP', n, 0, 256, TFScale);
                  title('(d) Phase Plane: BOB');
subplot(3,2,5);   PhasePlane(cMP , 'CP', n, 0, 256, TFScale);
                  title('(e) Phase Plane: MP');

subplot(3,2,3);   axis([.48 .65 0 1])
subplot(3,2,4);   axis([.48 .65 0 1])
subplot(3,2,5);   axis([.48 .65 0 1])
subplot(3,2,6);   axis([.48 .65 0 1])
brighten(-.5);
brighten(-.5);
brighten(-.5);

⌨️ 快捷键说明

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