eDSP
0.0.1
A cross-platform DSP library written in C++.
|
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... | |
|
strong |
The WindowType enum represents the type of availables windows.
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.
first | Input iterator defining the beginning of the output range. |
last | Input iterator defining the ending of the output range. |
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\, \)
first | Input iterator defining the beginning of the output range. |
last | Input iterator defining the ending of the output range. |
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\, \)
first | Input iterator defining the beginning of the output range. |
last | Input iterator defining the ending of the output range. |
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\, \)
first | Input iterator defining the beginning of the output range. |
last | Input iterator defining the ending of the output range. |
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 \]
first | Input iterator defining the beginning of the output range. |
last | Input iterator defining the ending of the output range. |
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\, \)
first | Input iterator defining the beginning of the output range. |
last | Input iterator defining the ending of the output range. |
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 \)
first | Input iterator defining the beginning of the output range. |
last | Input iterator defining the ending of the output range. |
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 \)
first | Input iterator defining the beginning of the output range. |
last | Input iterator defining the ending of the output range. |
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.
Type | Type of window to be computed |
first | Input iterator defining the beginning of the output range. |
last | Input iterator defining the ending of the output range. |
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 \]
first | Input iterator defining the beginning of the output range. |
last | Input iterator defining the ending of the output range. |
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| \]
first | Input iterator defining the beginning of the output range. |
last | Input iterator defining the ending of the output range. |
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} \]
first | Input iterator defining the beginning of the output range. |
last | Input iterator defining the ending of the output range. |