ldas-tools-filters
2.6.6
|
A class representing a Kaiser window. More...
#include <KaiserWindow.hh>
Public Member Functions | |
KaiserWindow (const double beta=KaiserWindowDefaultBeta) | |
Constructor. More... | |
double | beta () const |
Get the beta parameter for this window. More... | |
void | set_beta (const double &beta) |
Set the beta parameter for this window. More... | |
virtual std::string | name () const |
Return window name. More... | |
virtual double | param () const |
Return window parameter. More... | |
virtual KaiserWindow * | Clone () const |
Clone a window. More... | |
KaiserWindow (const double beta=KaiserWindowDefaultBeta) | |
Constructor. More... | |
double | beta () const |
Get the beta parameter for this window. More... | |
void | set_beta (const double &beta) |
Set the beta parameter for this window. More... | |
virtual std::string | name () const |
Return window name. More... | |
virtual double | param () const |
Return window parameter. More... | |
virtual KaiserWindow * | Clone () const |
Clone a window. More... | |
KaiserWindow (const double beta=KaiserWindowDefaultBeta) | |
Constructor. More... | |
double | beta () const |
Get the beta parameter for this window. More... | |
void | set_beta (const double &beta) |
Set the beta parameter for this window. More... | |
virtual std::string | name () const |
Return window name. More... | |
virtual double | param () const |
Return window parameter. More... | |
virtual KaiserWindow * | Clone () const |
Clone a window. More... | |
size_t | size () const |
Return window length. More... | |
size_t | size () const |
Return window length. More... | |
size_t | size () const |
Return window length. More... | |
double | mean () const |
Return mean value of window. More... | |
double | mean () const |
Return mean value of window. More... | |
double | mean () const |
Return mean value of window. More... | |
double | rms () const |
Return RMS value of window. More... | |
double | rms () const |
Return RMS value of window. More... | |
double | rms () const |
Return RMS value of window. More... | |
void | resize (const size_t n) |
Change the size of the window. More... | |
void | resize (const size_t n) |
Change the size of the window. More... | |
void | resize (const size_t n) |
Change the size of the window. More... | |
template<class T > | |
void | apply (std::valarray< T > &x) |
Apply a window to the data in-place. More... | |
template<class TOut , class TIn > | |
void | apply (std::valarray< TOut > &out, const std::valarray< TIn > &in) |
Apply a window to the data out-of-place. More... | |
template<class T > | |
void | apply (std::valarray< T > &x) |
Apply a window to the data in-place. More... | |
template<class TOut , class TIn > | |
void | apply (std::valarray< TOut > &out, const std::valarray< TIn > &in) |
Apply a window to the data out-of-place. More... | |
template<class T > | |
void | apply (std::valarray< T > &x) |
Apply a window to the data in-place. More... | |
template<class TOut , class TIn > | |
void | apply (std::valarray< TOut > &out, const std::valarray< TIn > &in) |
Apply a window to the data out-of-place. More... | |
template<class TOut , class TIn > | |
void | operator() (std::valarray< TOut > &out, const std::valarray< TIn > &in) |
Synonym for apply. More... | |
template<class TOut , class TIn > | |
void | operator() (std::valarray< TOut > &out, const std::valarray< TIn > &in) |
Synonym for apply. More... | |
template<class TOut , class TIn > | |
void | operator() (std::valarray< TOut > &out, const std::valarray< TIn > &in) |
Synonym for apply. More... | |
Protected Member Functions | |
void | populate () |
Populate the elements of the window. More... | |
void | populate () |
Populate the elements of the window. More... | |
void | populate () |
Populate the elements of the window. More... | |
Private Member Functions | |
virtual double | element (const size_t i) const |
Get the ith element of the window. More... | |
double | I0 (const double &x) const |
Modified Bessel Function of first kind, order 0, evaluated by power series expansion. More... | |
virtual double | element (const size_t i) const |
Get the ith element of the window. More... | |
double | I0 (const double &x) const |
Modified Bessel Function of first kind, order 0, evaluated by power series expansion. More... | |
virtual double | element (const size_t i) const |
Get the ith element of the window. More... | |
double | I0 (const double &x) const |
Modified Bessel Function of first kind, order 0, evaluated by power series expansion. More... | |
void | multiply_by_window (std::valarray< float > &out) |
Multiply a sequence of floats by the window. More... | |
void | multiply_by_window (std::valarray< double > &out) |
Multiply a sequence of doubles by the window. More... | |
void | multiply_by_window (std::valarray< std::complex< float > > &out) |
Multiply a sequence of complex floats by the window. More... | |
void | multiply_by_window (std::valarray< std::complex< double > > &out) |
Multiply a sequence of complex doubles by the window. More... | |
void | multiply_by_window (std::valarray< float > &out) |
Multiply a sequence of floats by the window. More... | |
void | multiply_by_window (std::valarray< double > &out) |
Multiply a sequence of doubles by the window. More... | |
void | multiply_by_window (std::valarray< std::complex< float > > &out) |
Multiply a sequence of complex floats by the window. More... | |
void | multiply_by_window (std::valarray< std::complex< double > > &out) |
Multiply a sequence of complex doubles by the window. More... | |
void | multiply_by_window (std::valarray< float > &out) |
Multiply a sequence of floats by the window. More... | |
void | multiply_by_window (std::valarray< double > &out) |
Multiply a sequence of doubles by the window. More... | |
void | multiply_by_window (std::valarray< std::complex< float > > &out) |
Multiply a sequence of complex floats by the window. More... | |
void | multiply_by_window (std::valarray< std::complex< double > > &out) |
Multiply a sequence of complex doubles by the window. More... | |
Private Attributes | |
double | m_beta |
beta parameter More... | |
double | m_I0beta |
parameter for the modified Bessel function More... | |
std::valarray< float > | m_f_window |
a sequence for holding a window of floats More... | |
std::valarray< double > | m_d_window |
a sequence for holding a window of doubles More... | |
double | m_mean |
mean value of window elements More... | |
double | m_rms |
rms value of window elements More... | |
bool | m_is_float |
true if window elements are floats More... | |
A class representing a Kaiser window.
|
explicit |
Constructor.
std::invalid_argument | thrown if beta is less than 0 |
|
explicit |
Constructor.
std::invalid_argument | thrown if beta is less than 0 |
|
explicit |
Constructor.
std::invalid_argument | thrown if beta is less than 0 |
|
inherited |
Apply a window to the data in-place.
[in,out] | x | input/output sequence |
std::length_error | thrown if desired window length is greater than maximum allowed value |
std::bad_alloc | thrown if not able to allocate memory for window |
|
inherited |
Apply a window to the data in-place.
[in,out] | x | input/output sequence |
std::length_error | thrown if desired window length is greater than maximum allowed value |
std::bad_alloc | thrown if not able to allocate memory for window |
|
inherited |
Apply a window to the data in-place.
[in,out] | x | input/output sequence |
std::length_error | thrown if desired window length is greater than maximum allowed value |
std::bad_alloc | thrown if not able to allocate memory for window |
|
inherited |
Apply a window to the data out-of-place.
[out] | out | windowed sequence |
[in] | in | input sequence |
std::length_error | thrown if desired window length is greater than maximum allowed value |
std::bad_alloc | thrown if not able to allocate memory for window |
|
inherited |
Apply a window to the data out-of-place.
[out] | out | windowed sequence |
[in] | in | input sequence |
std::length_error | thrown if desired window length is greater than maximum allowed value |
std::bad_alloc | thrown if not able to allocate memory for window |
|
inherited |
Apply a window to the data out-of-place.
[out] | out | windowed sequence |
[in] | in | input sequence |
std::length_error | thrown if desired window length is greater than maximum allowed value |
std::bad_alloc | thrown if not able to allocate memory for window |
|
inline |
Get the beta parameter for this window.
double Filters::KaiserWindow::beta | ( | ) | const |
Get the beta parameter for this window.
double Filters::KaiserWindow::beta | ( | ) | const |
Get the beta parameter for this window.
|
virtual |
|
virtual |
|
virtual |
|
privatevirtual |
Get the ith element of the window.
A Kaiser window is defined by
w[i] = I0( beta*sqrt(1 - [2*i/(n-1) - 1]^2) )/I0(beta)
for i= 0,1, ... n-1, where I0(x) is the 0th order, modified Bessel function of the first kind, and beta (>=0) is a shape parameter related to the amplitude of the sidelobes of the Fourier transform of the window. See "Discrete-time Signal Processing" by Oppenheim and Schafer, p.474 for details.)
[in] | i | the element at which the window is evaluated |
Implements Filters::Window.
|
privatevirtual |
Get the ith element of the window.
A Kaiser window is defined by
w[i] = I0( beta*sqrt(1 - [2*i/(n-1) - 1]^2) )/I0(beta)
for i= 0,1, ... n-1, where I0(x) is the 0th order, modified Bessel function of the first kind, and beta (>=0) is a shape parameter related to the amplitude of the sidelobes of the Fourier transform of the window. See "Discrete-time Signal Processing" by Oppenheim and Schafer, p.474 for details.)
[in] | i | the element at which the window is evaluated |
Implements Filters::Window.
|
privatevirtual |
Get the ith element of the window.
A Kaiser window is defined by
w[i] = I0( beta*sqrt(1 - [2*i/(n-1) - 1]^2) )/I0(beta)
for i= 0,1, ... n-1, where I0(x) is the 0th order, modified Bessel function of the first kind, and beta (>=0) is a shape parameter related to the amplitude of the sidelobes of the Fourier transform of the window. See "Discrete-time Signal Processing" by Oppenheim and Schafer, p.474 for details.)
[in] | i | the element at which the window is evaluated |
Implements Filters::Window.
|
private |
Modified Bessel Function of first kind, order 0, evaluated by power series expansion.
Calculate I0(x)
Calculates the value of the 0th order, modified Bessel function of the first kind using a power series expansion. (See "Handbook of Math. Functions," eds. Abramowitz and Stegun, 9.6.12 for details.)
[in] | x |
|
private |
Modified Bessel Function of first kind, order 0, evaluated by power series expansion.
|
private |
Modified Bessel Function of first kind, order 0, evaluated by power series expansion.
|
inlineinherited |
Return mean value of window.
|
inherited |
Return mean value of window.
|
inherited |
Return mean value of window.
|
privateinherited |
Multiply a sequence of doubles by the window.
[in,out] | out | input (and output) sequence |
|
privateinherited |
Multiply a sequence of doubles by the window.
[in,out] | out | input (and output) sequence |
|
privateinherited |
Multiply a sequence of doubles by the window.
[in,out] | out | input (and output) sequence |
|
privateinherited |
Multiply a sequence of floats by the window.
[in,out] | out | input (and output) sequence |
|
privateinherited |
Multiply a sequence of floats by the window.
[in,out] | out | input (and output) sequence |
|
privateinherited |
Multiply a sequence of floats by the window.
[in,out] | out | input (and output) sequence |
|
privateinherited |
Multiply a sequence of complex doubles by the window.
[in,out] | out | input (and output) sequence |
|
privateinherited |
Multiply a sequence of complex doubles by the window.
[in,out] | out | input (and output) sequence |
|
privateinherited |
Multiply a sequence of complex doubles by the window.
[in,out] | out | input (and output) sequence |
|
privateinherited |
Multiply a sequence of complex floats by the window.
[in,out] | input | (and output) sequence |
|
privateinherited |
Multiply a sequence of complex floats by the window.
[in,out] | input | (and output) sequence |
|
privateinherited |
Multiply a sequence of complex floats by the window.
[in,out] | input | (and output) sequence |
|
virtual |
|
virtual |
|
virtual |
|
inherited |
Synonym for apply.
[out] | out | windowed sequence |
[in] | in | input sequence |
std::length_error | thrown if desired window length is greater than maximum allowed value |
std::bad_alloc | thrown if not able to allocate memory for window |
|
inherited |
Synonym for apply.
[out] | out | windowed sequence |
[in] | in | input sequence |
std::length_error | thrown if desired window length is greater than maximum allowed value |
std::bad_alloc | thrown if not able to allocate memory for window |
|
inherited |
Synonym for apply.
[out] | out | windowed sequence |
[in] | in | input sequence |
std::length_error | thrown if desired window length is greater than maximum allowed value |
std::bad_alloc | thrown if not able to allocate memory for window |
|
virtual |
|
virtual |
|
virtual |
|
protectedinherited |
Populate the elements of the window.
This function will usually need to be called by a derived class whenever the the window is changed in any way which affects the element() function, such as when some window parameter is altered.
|
protectedinherited |
Populate the elements of the window.
This function will usually need to be called by a derived class whenever the the window is changed in any way which affects the element() function, such as when some window parameter is altered.
|
protectedinherited |
Populate the elements of the window.
This function will usually need to be called by a derived class whenever the the window is changed in any way which affects the element() function, such as when some window parameter is altered.
|
inherited |
Change the size of the window.
[in] | n | desired length of window |
std::length_error | thrown if desired window length is greater than maximum allowed value |
std::bad_alloc | thrown if not able to allocate memory for the window |
|
inherited |
Change the size of the window.
[in] | n | desired length of window |
std::length_error | thrown if desired window length is greater than maximum allowed value |
std::bad_alloc | thrown if not able to allocate memory for the window |
|
inherited |
Change the size of the window.
[in] | n | desired length of window |
std::length_error | thrown if desired window length is greater than maximum allowed value |
std::bad_alloc | thrown if not able to allocate memory for the window |
|
inlineinherited |
Return RMS value of window.
|
inherited |
Return RMS value of window.
|
inherited |
Return RMS value of window.
void Filters::KaiserWindow::set_beta | ( | const double & | beta | ) |
Set the beta parameter for this window.
std::invalid_argument | thrown if beta is less than 0 |
void Filters::KaiserWindow::set_beta | ( | const double & | beta | ) |
Set the beta parameter for this window.
std::invalid_argument | thrown if beta is less than 0 |
void Filters::KaiserWindow::set_beta | ( | const double & | beta | ) |
Set the beta parameter for this window.
std::invalid_argument | thrown if beta is less than 0 |
|
inlineinherited |
Return window length.
|
inherited |
Return window length.
|
inherited |
Return window length.
|
private |
beta parameter
|
privateinherited |
a sequence for holding a window of doubles
|
privateinherited |
a sequence for holding a window of floats
|
private |
parameter for the modified Bessel function
|
privateinherited |
true if window elements are floats
|
privateinherited |
mean value of window elements
|
privateinherited |
rms value of window elements