numinteg.cpp

来自「《无线通信系统仿真——c++使用模型》这本书的源代码」· C++ 代码 · 共 34 行

CPP
34
字号
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
//  File = numinteg.cpp
//
//  simulation of analog all-pole filter
//

#include <math.h>
#include "numinteg.h"

//======================================================
//  constructor that initializes the integrator
//------------------------------------------------------

NumericInteg::NumericInteg( double delta_t, double alpha )
{
 Delta_T = delta_t;
 Alpha = alpha;
 Integ_Mem = 0.0;
 return;
};
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++      


//======================================================
//
//------------------------------------------------------

double NumericInteg::Integrate( double input )
{ 
Integ_Mem = Alpha * Integ_Mem + (Delta_T * input);
return(Integ_Mem);
}

⌨️ 快捷键说明

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