RTXI  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ma_src.cpp
Go to the documentation of this file.
1 //
2 // File = ma_src.cpp
3 //
4 
5 #include <fstream>
6 #include <stdlib.h>
7 #include <iostream>
8 
9 #include "ma_src.h"
10 #include "sig_type.h" //selects signal type for template
11  // instantiation
12 
13 #ifdef _DEBUG
14 extern std::ofstream DebugFile;
15 #endif
16 
17 //======================================================
18 // MaSource - subclass of MaProcess for the case where
19 // the AR coefficients are known or assumed
20 // and are provided as input parameters
21 
22 template <class T>
23 MaSource<T>::MaSource(int ma_order, T* b_coeffs, double drv_noise_var)
24  : MaProcess<T>()
25 {
26  int i;
27  this->Ma_Order = ma_order;
28  this->Noise_Seed = 31415927; // arbitrary default
29  this->Drv_Noise_Var = drv_noise_var;
30 
31  this->B_Coeffs = new T[ma_order + 1];
32  for (i = 0; i <= ma_order; i++)
33  this->B_Coeffs[i] = b_coeffs[i];
34 
35  this->Old_Input = new T[ma_order + 1];
36  for (i = 0; i <= ma_order; i++)
37  this->Old_Input[i] = 0.0;
38 }
39 
40 template <class T>
42 {
43 }
44 
45 //-----------------------------------------------
46 // Explicit instantiations
47 // template class MaSource<double>;
48 template class MaSource<type_of_sig_vals_T>;
int Ma_Order
Definition: ma_proc.h:26
T * Old_Input
Definition: ma_proc.h:28
~MaSource(void)
Definition: ma_src.cpp:41
std::ofstream DebugFile
T * B_Coeffs
Definition: ma_proc.h:27
double Drv_Noise_Var
Definition: ma_proc.h:30
long Noise_Seed
Definition: ma_proc.h:29
MaSource(int ma_order, T *b_coeffs, double drv_noise_var)
Definition: ma_src.cpp:23