% ex 4 Single-pole noise shaping

k=2^7;
OSR = 5;
ampl = 0.9;
ord = 3;
sim('lab6ex5a')

sigview(quantOut5a, quantOut5aFiltered); grid on
sigview(quantOut5aFiltered)

sigspectrum(quantOut5a, quantOut5aFiltered), grid on
specFiltered = (sigspectrum(quantOut5aFiltered)), grid on

SNRdB = 10*log10(max(specFiltered)/(sum(specFiltered)-max(specFiltered)))


