function err = RMSEaudio(y, z, b)
%UNTITLED2 Summary of this function goes here
[m,n] = size(y);


for i = 1:n
    if(z == 1)
        y2(:,i) = simplecodecw(y(:,i)', b);
    else
        y2(:,i) = simplecodec(y(:,i)', b);
    end
end

[m2, n2]  = size(y2);

ty = y;
%size(ty)
ty(1:32, :) = [];
%size(ty)
ty(m2 +1:end, :) = [];
%size(ty)

ty=0.3*ty*(1/max(max(abs(ty))));

%size(y2)

err = sqrt(sum(sum(abs((y2 - ty).^2)))/length(y2));

end