Waveform filter programs

◆ response()

Tseries response ( const double &  fn,
const double &  h,
const double &  dt,
const int &  n 
)

Definition at line 114 of file geophone.cc.

References pi.

Referenced by main().

116 {
117  const double eps=1.e-4;
118  Tseries result(n);
119  for (int i=result.first(); i<=result.last(); i++)
120  {
121  double t=double(i)*dt;
122  double omn=2.*pi*fn;
123  if (h>(1.+eps))
124  {
125  double hfac=std::sqrt(h*h-1.);
126  result(i)=std::exp(-omn*h*t)*
127  (std::exp(-omn*t*hfac)-std::exp(omn*t*hfac))/
128  (-2.*omn*hfac);
129  } else if (h<(1.-eps))
130  {
131  double hfac=std::sqrt(1.-h*h);
132  result(i)=std::sin(omn*t*hfac)*std::exp(-omn*h*t)/(omn*hfac);
133  } else
134  {
135  result(i)=t*std::exp(-omn*t);
136  }
137  }
138  return(result);
139 } // response
const double pi
Definition: geophone.cc:99
aff::Series< double > Tseries
Definition: cross.cc:69
Here is the caller graph for this function: