Home > freetb4matlab > comm > riceenco.m

riceenco

PURPOSE ^

%

SYNOPSIS ^

function [rcode,K,Ltot]=riceenco(sig,K)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} {} riceenco (@var{sig}, @var{K})
%
% Returns the Rice encoded signal using @var{K} or optimal K . 
% Default optimal K is chosen between 0-7. Currently no other way
% to increase the range except to specify explicitly. Also returns
% @var{K} parameter used (in case it were to be chosen optimally) 
% and @var{Ltot} the total length of output code in bits.
% This function uses a @var{K} if supplied or by default chooses
% the optimal K for encoding signal vector into a rice coded vector.
% A restrictions is that a signal set must strictly be non-negative.
% The Rice algorithm is used to encode the data into unary coded
% quotient part which is represented as a set of 1's separated from
% the K-part (binary) using a zero. This scheme doesnt need any 
% kind of dictionaries and its close to O(N), but this implementation
% *may be* sluggish, though correct.
%
% Reference: Solomon Golomb, Run length Encodings, 1966 IEEE Trans
% Info' Theory
%
% An exmaple of the use of @code{riceenco} is
% @example
% @group
%   riceenco(1:4) %  
%   riceenco(1:10,2) % 
% @end group
% @end example
% @end deftypefn
% @seealso{ricedeco}

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 22-May-2009 15:13:00 by m2html © 2003