sigspectrum(summedsines, filteredsig)

%

sigview(noisysine)
arf = sigspectrum(noisysine)
sum(arf)
arf(8)
%SNR = -10*log10((1/512)^2*(2*pi*7)^2)
SNR = arf(8)/(sum(arf)-arf(8))
SNRdB = 10 * log10(SNR)

sigview(noisysine, noisysinefiltered)
[arf_noisysine]=sigspectrum(noisysine)
[arf_noisysinefiltered]=sigspectrum(noisysinefiltered)

%

t = 64
SNR_noisysine = arf_noisysine(t*7+1)/(sum(arf_noisysine)-arf_noisysine(t*7+1))
SNRdB_noisysine = 10 * log10(SNR_noisysine)

SNR_noisysinefiltered = arf_noisysinefiltered(t*7+1)/(sum(arf_noisysinefiltered)-arf_noisysinefiltered(t*7+1))
SNRdB_noisysinefiltered = 10 * log10(SNR_noisysinefiltered)

% Percentage of power removed by the filter.

a=(sum(arf_noisysine)-arf_noisysine(t*7+1))
b=(sum(arf_noisysinefiltered)-arf_noisysinefiltered(t*7+1))

100*(a-b)/a

% Percentage Ratio of filter cutoff freq to max freq of simulation

23/256*100