RTXI  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
con_resp.cpp
Go to the documentation of this file.
1 //
2 // File = con_resp.cpp
3 //
4 
5 #include <stdlib.h>
6 
7 #include "con_resp.h"
8 #include "misdefs.h"
9 
10 using namespace std;
11 
12 ContinWindowResponse::ContinWindowResponse(istream& uin, ostream& uout)
13 {
14  logical default_file_ok;
15 
16  uout << "shape of window?\n "
17  << "0 = Quit\n " << _RECTANGULAR << " = rectangular\n " << _TRIANGULAR
18  << " = triangular\n " << _HAMMING << " = Hamming\n " << _HANN
19  << " = Hann (hanning, vonHann)\n " << _DOLPH_CHEBY
20  << " = Dolph-Chebyshev\n " << std::endl;
21  uin >> Window_Shape;
22 
23  if (Window_Shape < _RECTANGULAR) {
24  exit(0);
25  }
26 
27  uout << "number of points in plot?" << std::endl;
28  uin >> Num_Resp_Pts;
29  uout << "scaling?\n"
30  << " 0 = linear, 1 = dB" << std::endl;
31  uin >> Db_Scale_Enab;
32 
33  if (Db_Scale_Enab != 0)
34  Db_Scale_Enab = 1;
35 
36  uout << "default name for magnitude response output\n"
37  << "file is cwinresp.txt\n\n"
38  << "is this okay?"
39  << " 0 = NO, 1 = YES" << std::endl;
40  uin >> default_file_ok;
41 
42  if (default_file_ok) {
43  Response_File = new ofstream("cwinresp.txt", ios::out);
44  } else {
45  char* file_name;
46  file_name = new char[31];
47 
48  uout << "enter complete name for output file" << std::endl;
49  uin >> file_name;
50  Response_File = new ofstream(file_name, ios::out);
51  delete[] file_name;
52  }
53 }
#define _DOLPH_CHEBY
Definition: misdefs.h:31
int logical
Definition: typedefs.h:4
#define _TRIANGULAR
Definition: misdefs.h:28
#define _HAMMING
Definition: misdefs.h:29
ContinWindowResponse(std::istream &uin, std::ostream &uout)
Definition: con_resp.cpp:12
#define _HANN
Definition: misdefs.h:30
#define _RECTANGULAR
Definition: misdefs.h:27