×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

DPCM encoding - problem with error quantizer

DPCM encoding - problem with error quantizer

DPCM encoding - problem with error quantizer

(OP)
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+window_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(sample)
       
    % 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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources