include/it/source_func.h

Go to the documentation of this file.
00001 /*
00002    libit - Library for basic source and channel coding functions
00003    Copyright (C) 2005-2005 Vivien Chappelier, Herve Jegou
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public
00016    License along with this library; if not, write to the Free
00017    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 */
00019 
00020 /*
00021   Various Souce functions
00022   Copyright (C) 2005 Vivien Chappelier, Herve Jegou
00023 */
00024 
00025 
00026 #ifndef __it_source_func_h
00027 #define __it_source_func_h
00028 
00029 #include <it/vec.h>
00030 #include <it/mat.h>
00031 
00032 /*! Return the entropy of a memoryless discrete source */
00033 double entropy (vec pdf);
00034 
00035 /*! Entropy rate of a Markov chain defined by transition matrix pt */
00036 double entropy_markov (mat pt);
00037 
00038 /*! Return the  entropy of a binary source source */
00039 double entropy_bin (double p);
00040 
00041 /*! Return the histogram of the realization S. 
00042    The source is assumed to take its values between 0 and omega-1 */
00043 ivec histogram (int omega, ivec S);
00044 
00045 /*! Same as histogram return a normalized histogram, i.e. a pdf */
00046 vec  histogram_normalized (int omega, ivec S);
00047 
00048 /*! Return the conditionnal (i.e., bi-dimensional) histogram of a source realization */
00049 imat histogram_cond (int omega, ivec S);
00050 
00051 /*! Return the expectation of a source defined by the pdf and the symbols values */
00052 double source_expectation (vec pdf, vec symbols);
00053 
00054 /*! Return the variance of a source defined by its pdf and its symbols */
00055 double source_variance (vec pdf, vec symbols);
00056 
00057 /*! Verify if the input vector is a valid probability density function */
00058 int  is_valid_pdf (vec pdf, double tol);
00059 
00060 /*! Check if pt is a valid matrix of transition probabilities (Markov chain) */
00061 int  is_valid_markov_matrix (mat pt, double tol);
00062 
00063 /*! Return the stationary probability of a Markov chain defined by transition matrix pt */
00064 vec  markov_marg_pdf (mat pt);
00065 
00066 
00067 #endif

Hosted by
Copyright (C) 2005-2006 Hervé Jégou
Vivien Chappelier
Francois Cayre
libit logo courtesy of Jonathan Delhumeau