TS++ library: time series library

◆ value()

double ts::tapers::Cosine::value ( const int &  i) const
privatevirtual

returns taper value for sample index i. Private virtual function such that this function can only be accessed through the template function apply(). This way we ensure that the appropriate index range was set first.

Implements ts::tapers::Taper.

Definition at line 162 of file tapers.cc.

References Mf, Mfac, Ml, and Msf.

163  {
164  double s=1.;
165  if (i<(Mf+Msf)) { s=std::sin((i-Mf)*Mfac); }
166  else if (i>(Ml-Msf)) { s=std::sin((Ml-i)*Mfac); }
167  return (s*s);
168  } // double Cosine::value(const int& i) const