%lab 6 ex 6
bias = 0;
OSR = 5;
% ampl = sqrt( (2*10^((-3.01-1)/10)))
% sim('lab6ex6a')
% specFiltered = (sigspectrum(quantOut6aFiltered)), grid on
% sigspectrum(quantOut6a,    quantOut6aFiltered)
% %sigview(quantOut6a,    quantOut6aFiltered)
% SNRdB = 10*log10(max(specFiltered(6))/(sum(specFiltered)-max(specFiltered(6))))

% ampl = 0;
% sim('lab6ex6a')
% filteredUnbiased = quantOut6aFiltered;
% sigview(quantOut6a, quantOut6aFiltered)
% sigview(quantOut6aFiltered)

ampl=0;
bias = 0.01;
sim('lab6ex6a')
sigview(quantOut6a)
filteredbias001= quantOut6aFiltered
sigspectrum(quantOut6a, quantOut6aFiltered)
sigspectrum(quantOut6aFiltered)
sigview(quantOut6a)
sigview(quantOut6aFiltered)
sigview(quantOut6a, quantOut6aFiltered)

bias = 1e-3;
sim('lab6ex6a')
sigview(filteredbias001, quantOut6aFiltered)
sigspectrum(filteredbias001, quantOut6aFiltered)
% % unbiasedSpec=quantOut6aFiltered
% bias=0.01
% sim('lab6ex6a')
% sigspectrum(quantOut6aFiltered, unbiased_spec)
% 
% 
% specFiltered = (sigspectrum(quantOut6aFiltered)), grid on
% SNRdB = 10*log10(max(specFiltered(6))/(sum(specFiltered)-max(specFiltered(6))))