Welch's averaged-periodogram power spectral density estimator. More...
#include <welch_psd.h>
Public Types | |
| enum | WindowType { Hann =0 , Hamming =1 , Blackman =2 , FlatTop =3 } |
Static Public Member Functions | |
| static WelchPsdResult | compute (const Eigen::MatrixXd &matData, double dSFreq, int iNfft=256, double dOverlap=0.5, WindowType window=Hann, const Eigen::RowVectorXi &vecPicks=Eigen::RowVectorXi()) |
| static Eigen::RowVectorXd | computeVector (const Eigen::RowVectorXd &vecData, double dSFreq, int iNfft=256, double dOverlap=0.5, WindowType window=Hann) |
| static Eigen::RowVectorXd | freqAxis (int iNfft, double dSFreq) |
Welch's averaged-periodogram power spectral density estimator.
Divides each channel into overlapping windowed segments, computes the FFT of each segment, and averages the squared magnitudes. The result is a one-sided PSD normalised so that integrating over frequency recovers the mean signal power.
Definition at line 84 of file welch_psd.h.
Window function applied to each segment before the FFT.
| Enumerator | |
|---|---|
| Hann | |
| Hamming | |
| Blackman | |
| FlatTop | |
Definition at line 88 of file welch_psd.h.
|
static |
Compute Welch PSD for every (selected) channel of a data matrix.
| [in] | matData | Data matrix (n_channels × n_samples). |
| [in] | dSFreq | Sampling frequency in Hz. |
| [in] | iNfft | FFT length / segment length in samples (default 256). |
| [in] | dOverlap | Fractional overlap between adjacent segments, in [0, 1) (default 0.5). |
| [in] | window | Window function (default Hann). |
| [in] | vecPicks | Channel row indices to process; empty = all channels. |
Definition at line 164 of file welch_psd.cpp.
|
static |
Compute Welch PSD for a single channel row vector.
| [in] | vecData | Single-channel data (1 × n_samples row vector). |
| [in] | dSFreq | Sampling frequency in Hz. |
| [in] | iNfft | FFT / segment length in samples. |
| [in] | dOverlap | Fractional segment overlap in [0, 1). |
| [in] | window | Window function. |
Definition at line 117 of file welch_psd.cpp.
|
static |
Build the frequency axis for a given FFT length and sampling frequency.
| [in] | iNfft | FFT length. |
| [in] | dSFreq | Sampling frequency in Hz. |
Definition at line 106 of file welch_psd.cpp.