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