clear all 
close all
%==========
 lw = 2;  
 set(0, 'DefaultAxesFontSize', 16);
 fs = 15;
 msize = 5;
%==========
N = 1024;
SNR = 7;
signal = MakeSignal('Blocks', N);
sigma = std(signal);
signal = signal.*SNR/sigma;
noise = randn(1,N);
data = signal + noise;

out1 = bafdr(data,'Symmlet',8,4,0.05,0.9);
out2 = blfdr_fixed(data,'Symmlet' , 8, 4,  0.95);
out3 = blfdr(data, 'Symmlet', 8, 4, 2.5);

plot(data,'r');
hold on
plot(signal,'linewidth',lw);
axis([0,N, min(data)-1, max(data)+1])
title('Signal + Noise');


figure(2);
plot(out1,'linewidth',lw);
axis([0,N, min(data)-1, max(data)+1])
title('Restored Signal using BAFDR')

figure(3);
plot(out2,'linewidth',lw);
axis([0,N, min(data)-1, max(data)+1])
title('Restored Signal using BLFDR with fixed probabilities')


figure(4)
plot(out3,'linewidth',lw);
axis([0,N, min(data)-1, max(data)+1])
title('Restored Signal using BLFDR')
