00001 // 00002 // author="Tony Kirke" 00003 // Copyright (c) 1993-1996 Tony Kirke 00004 // 00005 /* 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2, or (at your option) 00009 * any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00019 */ 00020 #ifndef LMS_DFE 00021 #define LMS_DFE 00022 #include <complex.h> 00023 #include <fir_adapt.h> 00024 namespace SPUC { 00028 00029 00030 00031 00032 class lms_dfe { 00033 public: 00035 fir_adapt < complex<double> > ff; 00037 fir_adapt < complex<double> > fb; 00039 double u; 00040 00041 public: 00043 lms_dfe(char inf=16, char inb=0, double gain=0.01); 00044 ~lms_dfe() { } 00045 void reset(); 00046 void set_ff_tap(long i,complex<double> x) { ff.coeff[i] = x; } 00047 complex<double> get_ff_tap(long x) { return (ff.coeff[x]); } 00048 complex<double> get_fb_tap(long x) { return (fb.coeff[x]); } 00049 long ff_size() { return (ff.num_taps); } 00050 long fb_size() { return (fb.num_taps); } 00051 void set_gain(double g) { 00052 u = g; 00053 ff.set_gain(u); 00054 fb.set_gain(u); 00055 } 00057 complex<double> update(complex<double> in, complex<double> slicer_output); 00059 void update_taps_lms(complex<double> err); 00060 }; 00061 } // namespace SPUC 00062 #endif