eDSP  0.0.1
A cross-platform DSP library written in C++.
Enumerations | Functions
edsp::windowing Namespace Reference

Enumerations

enum  WindowType {
  WindowType::Bartlett = 0, WindowType::Blackman, WindowType::BlackmanHarris, WindowType::BlackmanNuttall,
  WindowType::Boxcar, WindowType::FlatTop, WindowType::Hamming, WindowType::Hanning,
  WindowType::Rectangular, WindowType::Triangular, WindowType::Welch
}
 The WindowType enum represents the type of availables windows. More...
 

Functions

template<typename OutputIt >
constexpr void bartlett (OutputIt first, OutputIt last)
 Computes a Bartlett window of length N and stores the result in the range, beginning at d_first. More...
 
template<typename OutputIt >
constexpr void blackman (OutputIt first, OutputIt last)
 Computes a Blackman window of length N and stores the result in the range, beginning at d_first. More...
 
template<typename OutputIt >
constexpr void blackman_harris (OutputIt first, OutputIt last)
 Computes a Blackman-Harris window of length N and stores the result in the range, beginning at d_first. More...
 
template<typename OutputIt >
constexpr void blackman_nutall (OutputIt first, OutputIt last)
 Computes a Blackman-Nuttall window of length N and stores the result in the range, beginning at d_first. More...
 
template<typename OutputIt >
constexpr void boxcar (OutputIt first, OutputIt last)
 Computes a boxcar (rectangular) window of length N and stores the result in the range, beginning at d_first. More...
 
template<typename OutputIt >
constexpr void flattop (OutputIt first, OutputIt last)
 Computes a Flat top window of length N and stores the result in the range, beginning at d_first. More...
 
template<typename OutputIt >
constexpr void hamming (OutputIt first, OutputIt last)
 Computes a Hamming window of length N and stores the result in the range, beginning at d_first. More...
 
template<typename OutputIt >
constexpr void hanning (OutputIt first, OutputIt last)
 Computes a Hann window of length N and stores the result in the range, beginning at d_first. More...
 
template<typename OutputIt >
constexpr void rectangular (OutputIt first, OutputIt last)
 Computes a rectangular window of length N and stores the result in the range, beginning at d_first. More...
 
template<typename OutputIt >
constexpr void triangular (OutputIt first, OutputIt last)
 Computes a triangular window of length N and stores the result in the range, beginning at d_first. More...
 
template<typename OutputIt >
constexpr void welch (OutputIt first, OutputIt last)
 Computes a Welch window of length N and stores the result in the range, beginning at d_first. More...
 
template<WindowType Type, typename OutputIt >
constexpr void make_window (OutputIt first, OutputIt last)
 Computes a window of the given type and length N and stores the result in the range, beginning at d_first. More...
 

Enumeration Type Documentation

◆ WindowType

The WindowType enum represents the type of availables windows.

Enumerator
Bartlett 

Bartlett Window

Blackman 

Blackman Window

BlackmanHarris 

Blackman-Harris Window

BlackmanNuttall 

Blackman-Nuttall Window

Boxcar 

Boxcar Window

FlatTop 

FlatTop Window

Hamming 

Hamming Window

Hanning 

Hanning Window

Rectangular 

Rectangular Window

Triangular 

Triangular Window

Welch 

Welch Window

Function Documentation

◆ bartlett()

template<typename OutputIt >
constexpr void edsp::windowing::bartlett ( OutputIt  first,
OutputIt  last 
)

Computes a Bartlett window of length N and stores the result in the range, beginning at d_first.

Parameters
firstInput iterator defining the beginning of the output range.
lastInput iterator defining the ending of the output range.

◆ blackman()

template<typename OutputIt >
constexpr void edsp::windowing::blackman ( OutputIt  first,
OutputIt  last 
)

Computes a Blackman window of length N and stores the result in the range, beginning at d_first.

Blackman windows are defined as:

\[ w(n)=a_{0}-a_{1}\cos \left({\frac {2\pi n}{N-1}}\right)+a_{2}\cos \left({\frac {4\pi n}{N-1}}\right)-a_{3}\cos \left({\frac {6\pi n}{N-1}}\right) \]

where: \( a_{0}=0.42;\quad a_{1}=0.5;\quad a_{2}=0.08;\quad a_{3}=0\, \)

Parameters
firstInput iterator defining the beginning of the output range.
lastInput iterator defining the ending of the output range.

◆ blackman_harris()

template<typename OutputIt >
constexpr void edsp::windowing::blackman_harris ( OutputIt  first,
OutputIt  last 
)

Computes a Blackman-Harris window of length N and stores the result in the range, beginning at d_first.

Blackman-Harris windows are defined as:

\[ w(n)=a_{0}-a_{1}\cos \left({\frac {2\pi n}{N-1}}\right)+a_{2}\cos \left({\frac {4\pi n}{N-1}}\right)-a_{3}\cos \left({\frac {6\pi n}{N-1}}\right) \]

where: \( a_{0}=0.35875;\quad a_{1}=0.48829;\quad a_{2}=0.14128;\quad a_{3}=0.01168\, \)

Parameters
firstInput iterator defining the beginning of the output range.
lastInput iterator defining the ending of the output range.

◆ blackman_nutall()

template<typename OutputIt >
constexpr void edsp::windowing::blackman_nutall ( OutputIt  first,
OutputIt  last 
)

Computes a Blackman-Nuttall window of length N and stores the result in the range, beginning at d_first.

Blackman-Nuttall windows are defined as:

\[ w(n)=a_{0}-a_{1}\cos \left({\frac {2\pi n}{N-1}}\right)+a_{2}\cos \left({\frac {4\pi n}{N-1}}\right)-a_{3}\cos \left({\frac {6\pi n}{N-1}}\right) \]

where: \( a_{0}=0.3635819;\quad a_{1}=0.4891775;\quad a_{2}=0.1365995;\quad a_{3}=0.0106411\, \)

Parameters
firstInput iterator defining the beginning of the output range.
lastInput iterator defining the ending of the output range.

◆ boxcar()

template<typename OutputIt >
constexpr void edsp::windowing::boxcar ( OutputIt  first,
OutputIt  last 
)

Computes a boxcar (rectangular) window of length N and stores the result in the range, beginning at d_first.

Boxcar windows are defined as:

\[ w(n)=1 \]

Parameters
firstInput iterator defining the beginning of the output range.
lastInput iterator defining the ending of the output range.

◆ flattop()

template<typename OutputIt >
constexpr void edsp::windowing::flattop ( OutputIt  first,
OutputIt  last 
)

Computes a Flat top window of length N and stores the result in the range, beginning at d_first.

Flat top windows are defined as:

\[ w(n)=a_{0}-a_{1}\cos \left({\frac {2\pi n}{N-1}}\right)+a_{2}\cos \left({\frac {4\pi n}{N-1}}\right)-a_{3}\cos \left({\frac {6\pi n}{N-1}}\right)+a_{4}\cos \left({\frac {8\pi n}{N-1}}\right) \]

where: \( a_{0}=1;\quad a_{1}=1.93;\quad a_{2}=1.29;\quad a_{3}=0.388;\quad a_{4}=0.028\, \)

Parameters
firstInput iterator defining the beginning of the output range.
lastInput iterator defining the ending of the output range.

◆ hamming()

template<typename OutputIt >
constexpr void edsp::windowing::hamming ( OutputIt  first,
OutputIt  last 
)

Computes a Hamming window of length N and stores the result in the range, beginning at d_first.

Hamming windows are defined as:

\[ {\displaystyle w(n)=a_{0}-\underbrace {(1-a_{0})} _{a_{1}}\cdot \cos \left({\frac {2\pi n}{N-1}}\right),\quad 0\leq n\leq N-1,} \]

where: \( a_{0}=0.54;\quad a_{1}=0.46 \)

Parameters
firstInput iterator defining the beginning of the output range.
lastInput iterator defining the ending of the output range.

◆ hanning()

template<typename OutputIt >
constexpr void edsp::windowing::hanning ( OutputIt  first,
OutputIt  last 
)

Computes a Hann window of length N and stores the result in the range, beginning at d_first.

Hann windows are defined as:

\[ {\displaystyle w(n)=a_{0}-\underbrace {(1-a_{0})} _{a_{1}}\cdot \cos \left({\frac {2\pi n}{N-1}}\right),\quad 0\leq n\leq N-1,} \]

where: \( a_{0}=0.5;\quad a_{1}=0.5 \)

Parameters
firstInput iterator defining the beginning of the output range.
lastInput iterator defining the ending of the output range.

◆ make_window()

template<WindowType Type, typename OutputIt >
constexpr void edsp::windowing::make_window ( OutputIt  first,
OutputIt  last 
)

Computes a window of the given type and length N and stores the result in the range, beginning at d_first.

Template Parameters
TypeType of window to be computed
Parameters
firstInput iterator defining the beginning of the output range.
lastInput iterator defining the ending of the output range.

◆ rectangular()

template<typename OutputIt >
constexpr void edsp::windowing::rectangular ( OutputIt  first,
OutputIt  last 
)

Computes a rectangular window of length N and stores the result in the range, beginning at d_first.

Rectangular windows are defined as:

\[ w(n)=1 \]

Parameters
firstInput iterator defining the beginning of the output range.
lastInput iterator defining the ending of the output range.

◆ triangular()

template<typename OutputIt >
constexpr void edsp::windowing::triangular ( OutputIt  first,
OutputIt  last 
)

Computes a triangular window of length N and stores the result in the range, beginning at d_first.

Triangular windows are defined as:

\[ w(n)=1-\left|{\frac {n-{\frac {N-1}{2}}}{\frac {L}{2}}}\right| \]

Parameters
firstInput iterator defining the beginning of the output range.
lastInput iterator defining the ending of the output range.

◆ welch()

template<typename OutputIt >
constexpr void edsp::windowing::welch ( OutputIt  first,
OutputIt  last 
)

Computes a Welch window of length N and stores the result in the range, beginning at d_first.

Welch windows are defined as:

\[ w(n)=1-\left({\frac {n-{\frac {N-1}{2}}}{\frac {N-1}{2}}}\right)^{2} \]

Parameters
firstInput iterator defining the beginning of the output range.
lastInput iterator defining the ending of the output range.