00001 // SPUC - Signal processing using C++ - A DSP library 00002 /*---------------------------------------------------------------------------* 00003 * IT++ * 00004 *---------------------------------------------------------------------------* 00005 * Copyright (c) 1995-2001 by Tony Ottosson, Thomas Eriksson, Pål Frenger, * 00006 * Tobias Ringström, and Jonas Samuelsson. * 00007 * * 00008 * Permission to use, copy, modify, and distribute this software and its * 00009 * documentation under the terms of the GNU General Public License is hereby * 00010 * granted. No representations are made about the suitability of this * 00011 * software for any purpose. It is provided "as is" without expressed or * 00012 * implied warranty. See the GNU General Public License for more details. * 00013 *---------------------------------------------------------------------------*/ 00024 #ifndef __reedsolomon_h 00025 #define __reedsolomon_h 00026 00027 #include <gfx.h> 00028 namespace SPUC { 00029 //---------------------- Reed-Solomon -------------------------------------- 00030 00041 class reed_solomon { 00042 public: 00044 reed_solomon(int in_m, int in_t); 00046 bvec encode(const bvec &uncodedbits); 00048 bvec decode(const bvec &codedbits); 00050 double get_rate() { return double(k)/double(n); } 00051 protected: 00053 int m, t, k, n, q; 00055 gfx g; 00056 }; 00057 } 00058 #endif // __reedsolomon_h