For Programmers: Free Programming Magazines  


Home > Archive > Matlab > December 2005 > DPCM encoding - problem with error quantizer









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author DPCM encoding - problem with error quantizer
ows_general

2005-12-16, 7:10 pm

I'm trying to implement a DPCM_encoder like the following
(usin' an AR model as a predictor)
one -> <http://visl.technion.ac.il/projects/2000s27/Dpcm.gif>

I'm usin' it to stream data (usin' windows of samples of specific
size, i.e. I'll have to renew AR coefficients only once in each
window, for instance, in each 250 samples).

My problem is how I can quantize the error Ê knowin' that only in the
end of that window_size I can get a good quantizer for that window).
My code is the following (now I'm not usin' quantized errors to add
to last predicted samples of the signal, cause I don't know the
quantizer).

My main doubt is: how to get that quantizer of the error
(during the streaming of that window of samples, not only in the
end)?

DPCM_encoder(signal, order, levels, window_size)

len_signal = length(signal);

for i=0:size(signal)/window_size
sample = signal(i*window_size+1:i*window_size+win
dow_size);

% encoder data
[coefficients, signal_predicted] = AR_model(transpose(sample),
order);

len_signal_predicted = length(sample);
x = zeros(len_signal_predicted, 1);
e = zeros(len_signal_predicted, 1);

for j=i*window_size+1:i*window_size+size(sam
ple)

% this signal_predicted only change in windows
out = signal_predicted(j-window_size*i);% * x

% we only know this error in the end of thw window
e(j-window_size*i) = signal(j) - out;

% in the beggining of each window send signal instead of error
if(j-window_size*i <= order)
e(j-window_size*i) = signal(j);
end;

% renew the estimated output
%x = [e(j-window_size*i) ; x(1:len_signal_predicted-1)];

end;
% now we can quantize errors
[e_quant] = offLine_quantizer(e, levels, size(sample));

end;

Tkx for all your help,
ows
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com