LASP 1.0
Library for Acoustic Signal Processing
Loading...
Searching...
No Matches
PowerSpectra Class Reference

Computes single-sided cross-power spectra for a group of channels. Only a single block of length fft, no averaging. This class should normally not be used. Please refer to AvPowerSpectra instead. More...

#include <lasp_avpowerspectra.h>

Public Member Functions

 PowerSpectra (const us nfft, const Window::WindowType w)
 Initalize power spectra computer.
 
 PowerSpectra (const vd &window)
 Initalize power spectra computer.
 
ccube compute (const dmat &input)
 Computes the spectra. Data is normalized by the (spectral) power of the window, to compensate for the effect of the window.
 

Public Attributes

us nfft
 The FFT length.
 

Detailed Description

Computes single-sided cross-power spectra for a group of channels. Only a single block of length fft, no averaging. This class should normally not be used. Please refer to AvPowerSpectra instead.

Definition at line 22 of file lasp_avpowerspectra.h.

Constructor & Destructor Documentation

◆ PowerSpectra() [1/2]

PowerSpectra::PowerSpectra ( const us  nfft,
const Window::WindowType  w 
)

Initalize power spectra computer.

Parameters
nfftThe fft length
wThe window type

Definition at line 12 of file lasp_avpowerspectra.cpp.

◆ PowerSpectra() [2/2]

PowerSpectra::PowerSpectra ( const vd window)

Initalize power spectra computer.

Parameters
windowUses the window length to compute fft length, and uses the window shape as the actual window.

Definition at line 15 of file lasp_avpowerspectra.cpp.

Member Function Documentation

◆ compute()

ccube PowerSpectra::compute ( const dmat input)

Computes the spectra. Data is normalized by the (spectral) power of the window, to compensate for the effect of the window.

Parameters
inputInput data, first axis is assumed the sample, second axis the channel. Input first dimension should be equal to nfft, otherwise a runtime error is thrown.
Returns
Cross-power-spectra. Cubic array with size indices C_fij, where f is the frequency index, i is the row and j is the column. An element can be accessed by: C(f, i, j). Storage is such that frequency components are contiguous.

Run very often. Silence this one.

This one can be run in parallel without any problem. Note that it is the inner loop that is run in parallel.

Definition at line 27 of file lasp_avpowerspectra.cpp.

Member Data Documentation

◆ nfft

us PowerSpectra::nfft

The FFT length.

Definition at line 27 of file lasp_avpowerspectra.h.


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