thfig43.m
来自「% Atomizer Main Directory, Version .802 」· M 代码 · 共 57 行
M
57 行
% thfig43: BP Thesis Figure 4.3 -- Dictionary Mergers
%
% We can combine dictionaries to make bigger, more expressive
% dictionaries.
%
% Signal: HeaviSine
% Signal Length: 64
% Dictionary: standard discrete sine dictionary + Heavisides
% Observations:
% (a) Signal HeaviSine
% (b) Coef from BP using HS only
% (c) Coef from BP using DST only
% (d) HS coef from BP using the merged dictionary:
% the two jumps are correctly located.
% (e) DST coef from BP using the merged dictionary:
% the true frequency is correctly located
% By combining DST and HS, BP achieves much better result than
% just using any of DST and HS along
%
help thfig43
n = 64;
x = InputSignal('HeaviSine', n);
t = (1:n)' / n;
t2 = (1:(2*n))' /(2*n);
%%HS
cHS = [x(1); diff(x)];
%%DST
cDST = BP_Interior(x, 'DST', 2, 0, 0);
%%Merge
dicts = MakeList('DST', 'HS');
par1s = MakeList(2,0);
par2s = par1s;
par3s = par2s;
cBP = BP_Interior(x, dicts, par1s, par2s, par3s);
cBPDST = cBP(1:2*n);
cBPHS = cBP((2*n+1):(3*n));
%figures
figure(1); clf;
subplot(3,2,1); plot(t, x); title('(a) Signal: HeaviSine'); AXIS = axis;
subplot(3,2,3); plot(t, cHS); title('(b) Pure Heaviside Representation')
xlabel('Position')
axis(AXIS);
subplot(3,2,4); plot(t2, cDST); title('(c) Pure Sinusoid Representation')
xlabel('Frequency/Nyquist')
subplot(3,2,5); plot(t, cBPHS); title('(d) Heaviside Coef by BP using Jump+Sine');
xlabel('Position')
axis(AXIS);
subplot(3,2,6); plot(t2, cBPDST); title('(e) Sine Coef by BP using Jump+Sine');
xlabel('Frequency/Nyquist')
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?