RTXI  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
arma_src.cpp
Go to the documentation of this file.
1 //
2 // File = armaproc.cpp
3 //
4 
5 #include "arma_src.h"
6 #include "gausrand.h"
7 #include "mod_yuwa.h"
8 #include "yulewalk.h"
9 #include <fstream>
10 #include <stdlib.h>
11 
12 //=======================================================
13 // ArmaSource - subclass of ArmaProcess for case where
14 // AR coefficients are known or assumed and
15 // are provided as input parameters
16 
17 template <class T>
18 ArmaSource<T>::ArmaSource(int ar_order, T* a_coeffs, int ma_order, T* b_coeffs,
19  double drv_noise_var)
20  : ArmaProcess<T>()
21 {
22  int i;
23  this->Ar_Order = ar_order;
24  this->Ma_Order = ma_order;
25  this->Noise_Seed = 31415927; // arbitrary default
26  this->Drv_Noise_Var = drv_noise_var;
27 
28  this->A_Coeffs = new T[ar_order + 1];
29  for (i = 0; i <= ar_order; i++)
30  this->A_Coeffs[i] = a_coeffs[i];
31 
32  this->B_Coeffs = new T[ma_order + 1];
33  for (i = 0; i <= ma_order; i++)
34  this->B_Coeffs[i] = b_coeffs[i];
35 
36  this->Old_Input = new T[ma_order + 1];
37  for (i = 0; i <= ma_order; i++)
38  this->Old_Input[i] = 0.0;
39  this->Old_Output = new T[ar_order];
40  for (i = 0; i < ar_order; i++)
41  this->Old_Output[i] = 0.0;
42 }
43 //-------------------------------------
44 // Explicit instantiations of template
45 template class ArmaSource<double>;
46 template class ArmaSource<complex>;
double Drv_Noise_Var
Definition: armaproc.h:33
int Ma_Order
Definition: armaproc.h:27
long Noise_Seed
Definition: armaproc.h:32
ArmaSource(int ar_order, T *a_coeffs, int ma_order, T *b_coeffs, double drv_noise_var)
Definition: arma_src.cpp:18
T * Old_Output
Definition: armaproc.h:31
T * B_Coeffs
Definition: armaproc.h:29
int Ar_Order
Definition: armaproc.h:26
T * Old_Input
Definition: armaproc.h:30
T * A_Coeffs
Definition: armaproc.h:28