function RMSE = signalcompare1(f)

x=cos((1:2^(12))*2*pi*64*f/2^(13));
out = simplecodec(x);


trunc_x=x(33:end-32)';

if length(trunc_x)==length(out)
    disp('Truncated x is same length as compressed signal')
end

trunc_x=0.3*trunc_x/(max(abs(trunc_x)));

for i=1:length(out)
    err(i)=trunc_x(i)-out(i);
end
RMSE = norm(err,2)/sqrt(length(err))

t=linspace(0,1e-3,length(out));

figure;
plot(t,trunc_x,t,out)
legend('Orginal Signal','Compressed Signal')
title('Original Signal vs Compressed')

figure;
plot(t,err)
title('Error Between Original Signal and Compressed Signal')


end