lslfilter.hpp

来自「Adaptive digital Filters in C++」· HPP 代码 · 共 37 行

HPP
37
字号
/* lslfilter.hpp	recursive Least-Squares Lattice (LSL) scalar case
			for exponentially weighted data

		See Algorithm 5.3 of Cowan & Grant, Adaptive Filters
		p 115

	rcsid: @(#)lslfilter.hpp	1.1 16:19:01 3/31/94   EFC
*/


#ifndef LSL_FILTER_HPP_
#define LSL_FILTER_HPP_ 1.1

#include <dfilter.hpp>

class LSLFilter : public DigitalFilter
{
	private:
	  int p;
	  float lambda;
	  float *b, *delta, *gamma, *sig_f, *sig_b, *b_old, *sig_b_old;
	  void free_space();
	  float filter(const float);
	public:
	  LSLFilter() : p(0) {}
	  LSLFilter(const int ord, const float lam = 0.98) : lambda(lam)
				{ order(ord); }
	 ~LSLFilter() { free_space(); }

	  int order(const int ord = -1);
	  void set_lambda(const float lam) { lambda = lam; }


};

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?