Computes spectral measures of input data.
More...
#include <spectral.h>
|
static Eigen::MatrixXcd | computeTaperedSpectraRow (const Eigen::RowVectorXd &vecData, const Eigen::MatrixXd &matTaper, int iNfft) |
|
static QVector< Eigen::MatrixXcd > | computeTaperedSpectraMatrix (const Eigen::MatrixXd &matData, const Eigen::MatrixXd &matTaper, int iNfft, bool bUseThreads=true) |
|
static Eigen::MatrixXcd | compute (const TaperedSpectraInputData &inputData) |
|
static void | reduce (QVector< Eigen::MatrixXcd > &finalData, const Eigen::MatrixXcd &resultData) |
|
static Eigen::RowVectorXd | psdFromTaperedSpectra (const Eigen::MatrixXcd &matTapSpectrum, const Eigen::VectorXd &vecTapWeights, int iNfft, double dSampFreq=1.0) |
|
static Eigen::RowVectorXcd | csdFromTaperedSpectra (const Eigen::MatrixXcd &vecTapSpectrumSeed, const Eigen::MatrixXcd &vecTapSpectrumTarget, const Eigen::VectorXd &vecTapWeightsSeed, const Eigen::VectorXd &vecTapWeightsTarget, int iNfft, double dSampFreq=1.0) |
|
static Eigen::VectorXd | calculateFFTFreqs (int iNfft, double dSampFreq) |
|
static QPair< Eigen::MatrixXd, Eigen::VectorXd > | generateTapers (int iSignalLength, const QString &sWindowType="hanning") |
|
static std::pair< Eigen::MatrixXd, Eigen::VectorXd > | generateTapers (int iSignalLength, const std::string &sWindowType="hanning") |
|
Computes spectral measures of input data.
Computes spectral measures of input data such as spectra, power spectral density, cross-spectral density.
Definition at line 85 of file spectral.h.
◆ Spectral()
UTILSLIB::Spectral::Spectral |
( |
| ) |
|
|
delete |
deleted default constructor (static class).
◆ calculateFFTFreqs()
VectorXd Spectral::calculateFFTFreqs |
( |
int |
iNfft, |
|
|
double |
dSampFreq |
|
) |
| |
|
static |
Calculates the FFT frequencies
- Parameters
-
[in] | iNfft | FFT length. |
[in] | dSampFreq | sampling frequency of the input data. |
- Returns
- FFT frequencies.
Definition at line 278 of file spectral.cpp.
◆ compute()
Computes the tapered spectra for a row vector. This function gets called in parallel.
- Parameters
-
[in] | inputData | The input data. |
- Returns
- The tapered spectra for one data row.
Definition at line 171 of file spectral.cpp.
◆ computeTaperedSpectraMatrix()
QVector< MatrixXcd > Spectral::computeTaperedSpectraMatrix |
( |
const Eigen::MatrixXd & |
matData, |
|
|
const Eigen::MatrixXd & |
matTaper, |
|
|
int |
iNfft, |
|
|
bool |
bUseThreads = true |
|
) |
| |
|
static |
Calculates the full tapered spectra of a given input matrix data. This function calculates each row in parallel.
- Parameters
-
[in] | matData | input matrix data (time domain), for which the spectrum is computed. |
[in] | matTaper | tapers used to compute the spectra. |
[in] | iNfft | FFT length. |
[in] | bUseThreads | Whether to use multiple threads. |
- Returns
- tapered spectra of the input data.
Definition at line 100 of file spectral.cpp.
◆ computeTaperedSpectraRow()
MatrixXcd Spectral::computeTaperedSpectraRow |
( |
const Eigen::RowVectorXd & |
vecData, |
|
|
const Eigen::MatrixXd & |
matTaper, |
|
|
int |
iNfft |
|
) |
| |
|
static |
Calculates the full tapered spectra of a given input row data
- Parameters
-
[in] | vecData | input roww data (time domain), for which the spectrum is computed. |
[in] | matTaper | tapers used to compute the spectra. |
[in] | iNfft | FFT length. |
- Returns
- tapered spectra of the input data.
Definition at line 72 of file spectral.cpp.
◆ csdFromTaperedSpectra()
Eigen::RowVectorXcd Spectral::csdFromTaperedSpectra |
( |
const Eigen::MatrixXcd & |
vecTapSpectrumSeed, |
|
|
const Eigen::MatrixXcd & |
vecTapSpectrumTarget, |
|
|
const Eigen::VectorXd & |
vecTapWeightsSeed, |
|
|
const Eigen::VectorXd & |
vecTapWeightsTarget, |
|
|
int |
iNfft, |
|
|
double |
dSampFreq = 1.0 |
|
) |
| |
|
static |
Calculates the cross-spectral density of the tapered spectra of seed and target
- Parameters
-
[in] | vecTapSpectrumSeed | tapered spectrum of the seed. |
[in] | vecTapSpectrumTarget | tapered spectrum of the target. |
[in] | vecTapWeightsSeed | taper weights of the seed. |
[in] | vecTapWeightsTarget | taper weights of the target. |
[in] | iNfft | FFT length. |
[in] | dSampFreq | sampling frequency of the input data. |
- Returns
- cross-spectral density of the tapered spectra of seed and target.
Definition at line 224 of file spectral.cpp.
◆ generateTapers() [1/2]
QPair< MatrixXd, VectorXd > Spectral::generateTapers |
( |
int |
iSignalLength, |
|
|
const QString & |
sWindowType = "hanning" |
|
) |
| |
|
static |
Calculates a hanning window of given length
- Parameters
-
[in] | iSignalLength | length of the hanning window. |
[in] | sWindowType | type of the window function used to compute tapered spectra. |
- Returns
- Qpair of tapers and taper weights.
Definition at line 292 of file spectral.cpp.
◆ generateTapers() [2/2]
std::pair< MatrixXd, VectorXd > Spectral::generateTapers |
( |
int |
iSignalLength, |
|
|
const std::string & |
sWindowType = "hanning" |
|
) |
| |
|
static |
Calculates a hanning window of given length
- Parameters
-
[in] | iSignalLength | length of the hanning window. |
[in] | sWindowType | type of the window function used to compute tapered spectra. |
- Returns
- Qpair of tapers and taper weights.
Definition at line 310 of file spectral.cpp.
◆ psdFromTaperedSpectra()
Eigen::RowVectorXd Spectral::psdFromTaperedSpectra |
( |
const Eigen::MatrixXcd & |
matTapSpectrum, |
|
|
const Eigen::VectorXd & |
vecTapWeights, |
|
|
int |
iNfft, |
|
|
double |
dSampFreq = 1.0 |
|
) |
| |
|
static |
Calculates the power spectral density of given tapered spectrum
- Parameters
-
[in] | vecTapSpectrum | tapered spectrum, for which the PSD is calculated. |
[in] | vecTapWeights | taper weights. |
[in] | iNfft | FFT length. |
[in] | dSampFreq | sampling frequency of the input data. |
- Returns
- power spectral density of a given tapered spectrum.
Definition at line 198 of file spectral.cpp.
◆ reduce()
void Spectral::reduce |
( |
QVector< Eigen::MatrixXcd > & |
finalData, |
|
|
const Eigen::MatrixXcd & |
resultData |
|
) |
| |
|
static |
Reduces the taperedSpectra results to a final result. This function gets called in parallel.
- Parameters
-
[out] | finalData | The final data data. |
[in] | resultData | The resulting data from the computation step. |
Definition at line 181 of file spectral.cpp.
The documentation for this class was generated from the following files: