00001 /* 00002 * SPUC - Signal processing using C++ - A DSP library 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2, or (at your option) 00007 * any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 #ifndef DVBCONVENC 00019 #define DVBCONVENC 00020 #include <math.h> 00021 #include <max_pn.h> 00022 namespace SPUC { 00032 00033 00034 00035 class dvb_conv_encoder 00036 { 00037 public: 00038 max_pn test_pn; 00039 const long g1; 00040 const long g2; 00041 bool conv_enc_phase; 00042 int conv_enc_get_bit; 00043 long conv_enc_u; 00044 long conv_bit_number; 00045 bool raw_bit; 00046 00047 public: 00049 dvb_conv_encoder() : g1(0x6d), g2(0x4f) { 00050 reset(); 00051 } 00052 void reset() { // clear variables for next burst 00053 conv_enc_u = 0; 00054 conv_enc_phase = 1; 00055 conv_enc_get_bit = 1; 00056 conv_bit_number = 0; 00057 test_pn.reset(); 00058 } 00059 ~dvb_conv_encoder() { } 00060 bool clock(); 00061 bool get_data(void) { 00062 raw_bit = test_pn.get_bit(); 00063 return(raw_bit); 00064 } 00065 bool reduce(long x, long y); 00066 00067 }; 00068 } // namespace SPUC 00069 #endif