00001 // 00002 // author="Tony Kirke" * 00003 // Copyright(c) 2001 Tony Kirke 00004 /* 00005 * SPUC - Signal processing using C++ - A DSP library 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2, or (at your option) 00010 * any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00020 */ 00021 #ifndef RLSC 00022 #define RLSC 00023 #include <vector.h> 00024 #include <matrix.h> 00025 #include <fir.h> 00026 namespace SPUC { 00030 00031 00032 class rls { 00033 private: 00034 int n, m; 00035 Matrix<double> P; 00036 Vector<double> k; 00037 Vector<double> w, u, ut, x; 00038 double ialpha; 00039 fir<double> cfir; 00040 00041 public: 00043 rls(const int n_in, double a); 00045 ~rls() {} 00047 void adapt(double x_in); 00049 double update(double x_in); 00050 }; 00051 } 00052 #endif