Commit 8b8082b6 authored by thomas.forbriger's avatar thomas.forbriger
Browse files

libpsdxx [DOC][TASK]: group member functions; define return values

parent 14d86b6a
......@@ -37,6 +37,17 @@
namespace psd {
/*! compute cross-power spectral density
*
* Compute the Fourier transform of
* \f[
* P_{xy}(t)=\lim_{T\rightarrow\infty}
* \frac{1}{2T}\int\limits_{-T}^{T}
* x(\tau)\,y(t+\tau)\,\mathrm{d}\tau
* \f]
*
* The function returns are series of complex values.
*/
TDCISeries
DPSDComputer::cross_psd(const TDISeries::Tcoc& s1,
const TDISeries::Tcoc& s2) const
......
......@@ -39,6 +39,19 @@
namespace psd {
/*! compute magnitude squared coherency
*
* Compute
* \f[
* \frac{\left|P_{lk}\right|^2}{P_{ll}\,P_{kk}},
* \f]
* where \f$P_{lk}\f$ is the cross-power spectral density (complex values)
* of signal \f$k\f$ and signal \f$l\f$.
* Likewise \f$P_{kk}\f$ and \f$P_{ll}\f$ are the values of power spectral
* density of signal \f$k\f$ and signal \f$l\f$, respectively.
*
* The function returns are series of real values.
*/
TDISeries DPSDComputer::mscoherency(const TDISeries::Tcoc& s1,
const TDISeries::Tcoc& s2) const
{
......
......@@ -39,6 +39,19 @@
namespace psd {
/*! compute normalized cross-power spectral density
*
* Compute
* \f[
* \frac{P_{lk}}{\sqrt{P_{ll}\,P_{kk}}},
* \f]
* where \f$P_{lk}\f$ is the cross-power spectral density (complex values)
* of signal \f$k\f$ and signal \f$l\f$.
* Likewise \f$P_{kk}\f$ and \f$P_{ll}\f$ are the values of power spectral
* density of signal \f$k\f$ and signal \f$l\f$, respectively.
*
* The function returns are series of real values.
*/
TDCISeries DPSDComputer::normalized_cpsd(const TDISeries::Tcoc& s1,
const TDISeries::Tcoc& s2) const
{
......
......@@ -38,6 +38,17 @@
namespace psd {
/*! compute power spectral density
*
* Compute the Fourier transform of
* \f[
* P(t)=\lim_{T\rightarrow\infty}
* \frac{1}{2T}\int\limits_{-T}^{T}
* x(\tau)\,x(t+\tau)\,\mathrm{d}\tau
* \f]
*
* The function returns are series of real values.
*/
TDISeries DPSDComputer::psd(const TDISeries::Tcoc& s) const
{
PSDXX_debug(this->debug(), "DPSDComputer::psd",
......
......@@ -137,6 +137,11 @@ namespace psd {
/* ====================================================================== */
/*! \name Functions operating on interval series
*
*/
//!@{
//! return magnitude squared of complex values
TDISeries abssqr(const TDCISeries::Tcoc& s);
......@@ -151,7 +156,14 @@ namespace psd {
//! return sqrt values
TDISeries sqrt(const TDISeries::Tcoc& s);
//!@}
/* ---------------------------------------------------------------------- */
/*! \name Functions operating on series
*
*/
//!@{
//! return magnitude squared of complex values
TDseries abssqr(const TDCseries::Tcoc& s);
......@@ -166,6 +178,7 @@ namespace psd {
//! return sqrt values
TDseries sqrt(const TDseries::Tcoc& s);
//!@}
/* ====================================================================== */
......@@ -188,20 +201,31 @@ namespace psd {
Mnsegments(1), Moverlap(0.), Mdivisor(1), Mpadfactor(1),
Mverbose(false), Mdebug(false), Mdemean(true), Mdetrend(true) { }
/*! \name configuration set functions
*/
//!@{
void set_nsegments(const unsigned int& n);
void set_divisor(const unsigned int& n);
void set_padfactor(const unsigned int& n);
void set_overlap(const double& f);
void set_verbose(const bool& f=true);
void set_debug(const bool& f=true);
//!@}
/*! \name configuration query functions
*/
//!@{
unsigned int nsegments() const { return(Mnsegments); }
unsigned int divisor() const { return(Mdivisor); }
unsigned int padfactor() const { return(Mpadfactor); }
double overlap() const { return(Moverlap); }
bool verbose() const { return(Mverbose); }
bool debug() const { return(Mdebug); }
//!@}
/*! \name functions computing spectral results
*/
//!@{
//! compute power spectral density
TDISeries psd(const TDISeries::Tcoc& s) const;
//! compute cross power spectrum
......@@ -213,6 +237,7 @@ namespace psd {
//! compute magnitude squared coherency
TDISeries mscoherency(const TDISeries::Tcoc& s1,
const TDISeries::Tcoc& s2) const;
//!@}
private:
//! number of segments split input time series
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment