Acoustic FDTD Solver
Public Member Functions | Private Attributes | List of all members
Sinusoid Class Reference

#include <Sinusoid.hpp>

Inheritance diagram for Sinusoid:
Function

Public Member Functions

 Sinusoid (const double magnitude, const double frequency, const unsigned ramp_period=1)
 Compute the sinuoidal signal using $ f(t)=A u(t) \sin(2\pi f_c t) $, where $u(t)=\frac{t}{(n+\frac{1}{4})T}$ when $0\le t \le (n+\frac{1}{4})T $, and $u(t)=1$ when $(n+\frac{1}{4})T\le t$.
virtual double getValue (const double x) const
 Evaluate the function at x.
virtual void setScale (const double x)
virtual double getDf (const double x) const
 Evaluate the first-order derivative at x.
virtual double getFrequency () const
 return the central frequency
int getType () const
virtual ~Sinusoid ()
- Public Member Functions inherited from Function
 Function ()
double rtnewt (const double x1, const double x2, const double xacc) const
 Use the Newton-Raphson method, find the root of a function known to line in the interval [x1, x2].
double rtsecan (double xn_1, double xn, const double xacc) const
 o * Use the secant method to find the root of a function with the initial guess at xn_1 and xn.
virtual ~Function ()

Private Attributes

double f_c
double A
unsigned n

Constructor & Destructor Documentation

Sinusoid::Sinusoid ( const double  magnitude,
const double  frequency,
const unsigned  ramp_period = 1 
)

Compute the sinuoidal signal using $ f(t)=A u(t) \sin(2\pi f_c t) $, where $u(t)=\frac{t}{(n+\frac{1}{4})T}$ when $0\le t \le (n+\frac{1}{4})T $, and $u(t)=1$ when $(n+\frac{1}{4})T\le t$.

Parameters
magnitude
frequency
ramp_periodspecifies the number of periods, after which the first peak of the sinusoidal function assumes the value of one.
virtual Sinusoid::~Sinusoid ( )
inlinevirtual

Member Function Documentation

double Sinusoid::getDf ( const double  x) const
virtual

Evaluate the first-order derivative at x.

Reimplemented from Function.

double Sinusoid::getFrequency ( ) const
virtual

return the central frequency

Reimplemented from Function.

int Sinusoid::getType ( ) const
double Sinusoid::getValue ( const double  x) const
virtual

Evaluate the function at x.

Reimplemented from Function.

void Sinusoid::setScale ( const double  x)
virtual

Reimplemented from Function.

Member Data Documentation

double Sinusoid::A
private
double Sinusoid::f_c
private
unsigned Sinusoid::n
private

The documentation for this class was generated from the following files: