RTXI  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
con_tngl.cpp
Go to the documentation of this file.
1 //
2 // File = con_tngl.cpp
3 //
4 
5 #include <iostream>
6 #include <math.h>
7 #include <iostream>
8 
9 #include "con_tngl.h"
10 #include "misdefs.h"
11 #include "sincsqrd.h"
12 #include "typedefs.h"
13 
14 using namespace std;
15 
17  : ContinWindowResponse(uin, uout)
18 {
19  double amp0, x, value;
20  double tau, freq, freq_exp, freq_cyc;
21 
22  tau = 1.0;
23  freq_cyc = 2.0;
24 
25  for (int n = 0; n < Num_Resp_Pts; n++) {
26  freq_exp = 1.0 + freq_cyc * (n - Num_Resp_Pts) / ((double)Num_Resp_Pts);
27  freq = pow((double)10.0, freq_exp);
28  amp0 = 0.5 * tau;
29  x = PI * freq * tau / 2.0;
30  value = 0.5 * tau * sinc_sqrd(x) / amp0;
31  if (Db_Scale_Enab)
32  value = 20.0 * log10(value);
33  (*Response_File) << freq << ", " << value << std::endl;
34  }
35 }
logical Db_Scale_Enab
Definition: con_resp.h:20
#define PI
Definition: misdefs.h:9
double sinc_sqrd(double x)
Definition: sincsqrd.cpp:10
ContTriangularMagResp(std::istream &uin, std::ostream &uout)
Definition: con_tngl.cpp:16