eDSP
0.0.1
A cross-platform DSP library written in C++.
|
Classes | |
struct | constants |
Enumerations | |
enum | distances { manhattan, euclidean, logarithmic } |
Functions | |
template<typename T > | |
constexpr T | magnitude (const std::complex< T > &z) |
Computes the magnitude of the complex number z. More... | |
template<typename T > | |
constexpr T | phase (const std::complex< T > &z) |
Computes the phase of the complex number z. More... | |
template<typename T > | |
constexpr T | real (const std::complex< T > &z) |
Computes the real component of the complex number z. More... | |
template<typename T > | |
constexpr T | imag (const std::complex< T > &z) |
Computes the imaginary component of the complex number z. More... | |
template<typename T > | |
constexpr std::complex< T > | conj (const std::complex< T > &z) |
Computes the complex conjugate of the complex number z. More... | |
template<typename T > | |
constexpr auto | is_nan (const std::complex< T > &z) noexcept |
Determines if the given real or imaginary part of the complex number is a not-a-number (NaN) value. More... | |
template<typename T > | |
constexpr auto | is_inf (const std::complex< T > &z) noexcept |
Determines if the given real or imaginary part of the complex number is \( \infty \). More... | |
template<typename T > | |
constexpr std::complex< T > | infinity () noexcept |
Computes an \( \infty \) complex number. More... | |
template<typename T > | |
constexpr bool | is_negative (T x) |
Determines if the number is negative. More... | |
template<typename T > | |
constexpr bool | is_odd (T x) |
Determines if the number is odd. More... | |
template<typename T > | |
constexpr bool | is_even (T x) |
Determines if the number is even. More... | |
template<typename T > | |
constexpr bool | is_power_two (T x) |
Determines if the number is power of two. More... | |
template<typename T > | |
constexpr bool | is_denormal (T x) |
Determines if the number is denormal floating-point. More... | |
template<typename T > | |
constexpr bool | is_normal (T x) |
Determines if the number is normal floating-point. More... | |
template<typename T > | |
constexpr bool | is_zero (T x) |
Determines if the number is zero. More... | |
template<typename T > | |
constexpr bool | is_nan (T x) noexcept |
Determines if the number is not-a-number (NAN). More... | |
template<typename T > | |
constexpr bool | is_inf (T x) |
Determines if the number is \( \infty \). More... | |
template<typename T > | |
constexpr bool | is_prime (T x) |
Determines if the number is prime. More... | |
template<typename T > | |
constexpr T | sign (T x) noexcept |
Determines the sign of the input number. More... | |
template<typename T > | |
constexpr T | next_power_two (T x) |
Computes the closest next higher power of 2 of the input number. More... | |
template<typename T > | |
constexpr T | square (T x) |
Computes the square value of the input number. More... | |
template<typename T > | |
constexpr T | fract (T x) |
Computes the fractional part of the input number. More... | |
template<typename T > | |
constexpr T | inv (T x) |
Computes the inverse value of the input number. More... | |
template<typename T > | |
constexpr T | half (T x) |
Computes the half value of the input number. More... | |
template<typename T > | |
std::enable_if< std::is_floating_point< T >::value, T >::type | rand (T min, T max) |
Computes a random number in the range [min, max]. More... | |
template<typename T > | |
std::enable_if< std::is_floating_point< T >::value, T >::type | rand () |
Computes a random number. The generated numbers follow a uniform distribution. More... | |
template<typename T > | |
std::enable_if< std::is_integral< T >::value, T >::type | rand (T min, T max) |
Computes a random number in the range [min, max]. More... | |
template<typename T > | |
std::enable_if< std::is_integral< T >::value, T >::type | rand () |
Computes a random number. The generated numbers follow a uniform distribution. More... | |
template<distances d, typename T > | |
constexpr T | distance (T x, T y) noexcept |
Computes the distance between x and y. More... | |
constexpr std::complex<T> edsp::math::conj | ( | const std::complex< T > & | z | ) |
Computes the complex conjugate of the complex number z.
z | Complex value |
|
noexcept |
Computes the distance between x and y.
x | First element of the equation |
y | Second element of the equation |
d | Distance implementation to be used. |
constexpr T edsp::math::fract | ( | T | x | ) |
Computes the fractional part of the input number.
x | Number to evaluate. |
constexpr T edsp::math::half | ( | T | x | ) |
Computes the half value of the input number.
x | Number to evaluate. |
constexpr T edsp::math::imag | ( | const std::complex< T > & | z | ) |
Computes the imaginary component of the complex number z.
z | Complex value |
|
noexcept |
Computes an \( \infty \) complex number.
constexpr T edsp::math::inv | ( | T | x | ) |
Computes the inverse value of the input number.
x | Number to evaluate. |
constexpr bool edsp::math::is_denormal | ( | T | x | ) |
Determines if the number is denormal floating-point.
x | Number to evaluate. |
constexpr bool edsp::math::is_even | ( | T | x | ) |
Determines if the number is even.
x | Number to evaluate. |
|
noexcept |
Determines if the given real or imaginary part of the complex number is \( \infty \).
z | Complex value |
constexpr bool edsp::math::is_inf | ( | T | x | ) |
Determines if the number is \( \infty \).
x | Number to evaluate. |
|
noexcept |
Determines if the given real or imaginary part of the complex number is a not-a-number (NaN) value.
z | Complex value |
|
noexcept |
Determines if the number is not-a-number (NAN).
x | Number to evaluate. |
constexpr bool edsp::math::is_negative | ( | T | x | ) |
Determines if the number is negative.
x | Number to evaluate. |
constexpr bool edsp::math::is_normal | ( | T | x | ) |
Determines if the number is normal floating-point.
x | Number to evaluate. |
constexpr bool edsp::math::is_odd | ( | T | x | ) |
Determines if the number is odd.
x | Number to evaluate. |
constexpr bool edsp::math::is_power_two | ( | T | x | ) |
Determines if the number is power of two.
x | Number to evaluate. |
constexpr bool edsp::math::is_prime | ( | T | x | ) |
Determines if the number is prime.
x | Number to evaluate. |
constexpr bool edsp::math::is_zero | ( | T | x | ) |
Determines if the number is zero.
x | Number to evaluate. |
constexpr T edsp::math::magnitude | ( | const std::complex< T > & | z | ) |
Computes the magnitude of the complex number z.
z | Complex value |
constexpr T edsp::math::next_power_two | ( | T | x | ) |
Computes the closest next higher power of 2 of the input number.
x | Number to evaluate. |
constexpr T edsp::math::phase | ( | const std::complex< T > & | z | ) |
Computes the phase of the complex number z.
z | Complex value |
|
inline |
Computes a random number in the range [min, max].
The generated numbers follow a uniform distribution.
min | Minimum number |
max | Maximum number |
|
inline |
Computes a random number. The generated numbers follow a uniform distribution.
|
inline |
Computes a random number in the range [min, max].
The generated numbers follow a uniform distribution.
min | Minimum number |
max | Maximum number |
|
inline |
Computes a random number. The generated numbers follow a uniform distribution.
constexpr T edsp::math::real | ( | const std::complex< T > & | z | ) |
Computes the real component of the complex number z.
z | Complex value |
|
noexcept |
Determines the sign of the input number.
x | Number to evaluate. |
constexpr T edsp::math::square | ( | T | x | ) |
Computes the square value of the input number.
x | Number to evaluate. |