function [total,percent] = lpcpercent(w,p,tol)
% w is the data vector; p is block size
% Checks if computed value vs. true value exceeds tolerance tol.
% If so, also sends true value; output wc is data to be sent; percent 
% is the compression achieved
N = length(w);
A = lpcA(p,w);
Y = lpcY(p,w);
V = (A'*A)^(-1)*A'*Y;
f = lpcreconstruct(w(1:p),V,N);
e = (f(p+1:N)-w(p+1:N))';
for k = 1:length(w)-p
    count(k) = (abs(e(k)) > tol);
end
total = sum(count);
percent = 100*(length(w)-2*p-total)/length(w);
