LPCencode.m
资源名称:work.rar [点击查看]
上传用户:hwtw888
上传日期:2016-03-15
资源大小:177k
文件大小:0k
源码类别:
压缩解压
开发平台:
Matlab
- function y = LPCencode(x, f)
- %LPCencode函数用一维无损预测编码压缩图像x,f为预测系数,如果f默认,则f=1,
- %就是前值预测。
- error(nargchk(1, 2, nargin))
- if nargin < 2
- f = 1;
- end
- x = double(x);
- [m, n] = size(x);
- p = zeros(m, n); %存放预测值
- xs = x;
- zc = zeros(m, 1);
- for j = 1: length(f)
- xs = [zc xs(:, 1: end-1)];
- p = p + f(j) * xs;
- end
- y = x - round(p);