📄 buttfunc.cpp
字号:
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// File = buttfunc.cpp
//
// Butterworth Filter Response
//
#include <math.h>
#include "misdefs.h"
#include "buttfunc.h"
extern ofstream DebugFile;
//======================================================
// constructor
ButterworthTransFunc::ButterworthTransFunc( int order )
:FilterTransFunc(order)
{
double x;
Prototype_Pole_Locs = (double_complex*) new double[2*(order+1)];
Num_Prototype_Poles = order;
Prototype_Zero_Locs = (double_complex*) new double[2];
Num_Prototype_Zeros = 0;
H_Sub_Zero = 1.0;
DebugFile << "in Butterworth Resp, H_Sub_Zero set to "
<< H_Sub_Zero << endl;
for(int k=1; k<=order; k++)
{
x = PI * (order + (2*k)-1) / (2*order);
Prototype_Pole_Locs[k] = double_complex( cos(x), sin(x) );
DebugFile << "pole[" << k << "] = "
<< Prototype_Pole_Locs[k] << endl;
}
return;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -