📄 thfig33.m
字号:
% thfig33: BP Thesis Figure 3.3 -- Analyzing FM-Cosine
% Signal: FM-Cosine
% s = .5*cos(n*pi*.5*t) + cos(n*pi*(t/2 + .5*cos(2*w*pi*t)/(4*w*pi)))
% where w = 4
% Signal Length: 1024
% Dictionary: Cosine Packets with D = log2(n)-4
% Observation:
% (a) FM-Cosine
% (n) The ideal phase plane: a sinosoid plus a frequency modulated
% oscillating cycles (four cycles).
% (c) MOF plane gives a weak and smeared-out description of the FM
% structure
% (d) BOB cannot resolve the nonorthogonality between the sinusoid
% and the FM structure.
% (e) MP cannot resolve the similarity among the 4 cycles in the
% FM structure. It completely misses the FM structure.
% (f) BP gives a good description of both the sinusoid and the
% FM structure.
%
help thfig33
n = 1024; D = log2(n); bell = 'Sine';t = (1:n)' / n;
x = InputSignal('FM', n);
time = cputime;
cMOF = MOF(x, 'CP', D-4, bell, 0);
cputime1 = cputime - time;
time = cputime;
cBOB = BOB(x, 'CP', D-4, bell, 0);
cputime2 = cputime - time;
time = cputime;
cMP = MP(x, 'CP', D-4, bell, 0);
cputime3 = cputime - time;
time = cputime;
cBP = BP_Interior(x, 'CP', D-4, bell, 0);
cputime4 = cputime - time;
fprintf('\n')
fprintf('CPU Running Time of MOF = %8.4e\n', cputime1);
fprintf('CPU Running Time of BOB = %8.4e\n', cputime2);
fprintf('CPU Running Time of MP = %8.4e\n', cputime3);
fprintf('CPU Running Time of BP = %8.4e\n', cputime4);
figure(1);clf
subplot(3,2,1);
plot(t, x);
title('(a) Signal: FM');
subplot(3,2,2);
axis([0 1 0 1])
plot(t, .5*ones(1024, 1)); hold on
w = 4;
sig = cos(n * pi * ( t / 2 + .5 * cos(2*w * pi * t) / ( 4 * w * pi)));
sig = sig + cos(n * pi * .5 * t) * .5;
tf = 1/2 + .25 * sin(2 * w * pi * t);
plot(t, tf);title('(b) Ideal Phase Plane');
xlabel('Time'); ylabel('Frequency')
TFScale = 20;
subplot(3,2,6);
PhasePlane(cBP, 'CP',n, 0, 256, TFScale);
title('(f) PhasePlane: BP');
subplot(3,2,5);
PhasePlane(cMP, 'CP',n, 0, 256, TFScale);
title('(e) PhasePlane: MP');
subplot(3,2,4);
PhasePlane(cBOB, 'CP',n, 0, 256, TFScale);
title('(d) PhasePlane: BOB');
subplot(3,2,3);
PhasePlane(cMOF, 'CP',n, 0, 256, TFScale);
title('(c) PhasePlane: MOF');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -