clear;

N = 2048;

Bumps = MakeSignal('Bumps' , N);
t = (0:(N-1))/N;

zBumps = cumsum(Bumps);
N = length(Bumps);
t = (0:(N-1))/N;
x = zBumps + WhiteNoise(zBumps);
z = diff([0 x]);
%
QMF = MakeONFilter('Coiflet',3);
w    = FWT_PO(z, 5,QMF);
ws   = InvShrink(w,5,4,1);
zrec = IWT_PO(ws,5,QMF);
%
wb = FWT_PO(Bumps,5,QMF);
%
clf;

figure(1)
plot(t,Bumps,'linewidth',3);

set(gca,'linewidth',3);
set(gca,'fontsize',14);

set(gcf, 'PaperUnits', 'centimeters')
set(gcf, 'PaperOrientation', 'portrait');
set(gcf, 'PaperPosition', [0 0 21 14])
print('-depsc', 'Plots/edge_detection_1.eps');

figure(2)
plot(t,x,'linewidth',3);

set(gca,'linewidth',3);
set(gca,'fontsize',14);

set(gcf, 'PaperUnits', 'centimeters')
set(gcf, 'PaperOrientation', 'portrait');
set(gcf, 'PaperPosition', [0 0 21 14])
print('-depsc', 'Plots/edge_detection_2.eps');

figure(3)
plot(t,z,'linewidth',3);

set(gca,'linewidth',3);
set(gca,'fontsize',14);

set(gcf, 'PaperUnits', 'centimeters')
set(gcf, 'PaperOrientation', 'portrait');
set(gcf, 'PaperPosition', [0 0 21 14])
print('-depsc', 'Plots/edge_detection_3.eps');

figure(4);
plot(t,zrec,'linewidth',3);

set(gca,'linewidth',3);
set(gca,'fontsize',14);

set(gcf, 'PaperUnits', 'centimeters')
set(gcf, 'PaperOrientation', 'portrait');
set(gcf, 'PaperPosition', [0 0 21 14])
print('-depsc', 'Plots/edge_detection_4.eps');
