eDSP
0.0.1
A cross-platform DSP library written in C++.
|
Functions | |
template<typename InputIt , typename OutputIt > | |
constexpr void | mu_law_compression (InputIt first, InputIt last, OutputIt d_first, meta::value_type_t< InputIt > absolute_max_value, meta::diff_type_t< InputIt > compression_factor) |
The \( \mu \) law converts data in 16-bit linear formats to a 8-bit µ-law format. More... | |
template<typename InputIt , typename OutputIt > | |
constexpr void | inverse_mu_law_compression (InputIt first, InputIt last, OutputIt d_first, meta::value_type_t< InputIt > absolute_max_value, meta::diff_type_t< InputIt > compression_factor) |
The \( \mu \) law converts data in 8-bit µ-law format to 16-bit linear formats. More... | |
constexpr void edsp::quantizer::inverse_mu_law_compression | ( | InputIt | first, |
InputIt | last, | ||
OutputIt | d_first, | ||
meta::value_type_t< InputIt > | absolute_max_value, | ||
meta::diff_type_t< InputIt > | compression_factor | ||
) |
The \( \mu \) law converts data in 8-bit µ-law format to 16-bit linear formats.
The de-compression process is performed as follows:
\[ {\displaystyle F^{-1}(y)=\operatorname {sgn}(y){1 \over \mu }{\Bigl (}(1+\mu )^{|y|}-1{\Bigr )}~~~~-1\leq y\leq 1} \]
first | Input iterator defining the beginning of the input range. |
last | Input iterator defining the ending of the input range. |
d_first | Output iterator defining the beginning of the destination range. |
absolute_max_value | Maximum value of the input |
compression_factor | Compression ratio |
constexpr void edsp::quantizer::mu_law_compression | ( | InputIt | first, |
InputIt | last, | ||
OutputIt | d_first, | ||
meta::value_type_t< InputIt > | absolute_max_value, | ||
meta::diff_type_t< InputIt > | compression_factor | ||
) |
The \( \mu \) law converts data in 16-bit linear formats to a 8-bit µ-law format.
The compression process is performed as follows:
\[ {\displaystyle y=F(x)=\operatorname {sgn}(x){\frac {\ln(1+\mu |x|)}{\ln(1+\mu )}}~~~~-1\leq x\leq 1} \]
first | Input iterator defining the beginning of the input range. |
last | Input iterator defining the ending of the input range. |
d_first | Output iterator defining the beginning of the destination range. |
absolute_max_value | Maximum value of the input |
compression_factor | Compression ratio |