eDSP
0.0.1
A cross-platform DSP library written in C++.
|
This class implements a resampler object to perform sample-rate conversion. More...
#include <resampler.hpp>
Public Types | |
using | value_type = T |
using | size_type = long |
using | error_type = int |
Public Member Functions | |
resampler (size_type channels, resample_quality quality, value_type factor) | |
Creates a resampler with the given configuration. More... | |
~resampler ()=default | |
Default destructor. More... | |
template<typename InputIt , typename OutputIt > | |
size_type | process (InputIt first, InputIt last, OutputIt d_first) |
Resamples the input elements in the range [first, last) and stores the result in another range, beginning at d_first. More... | |
resample_quality | quality () const |
Returns the quality used in the resampling process. More... | |
error_type | reset () |
Resets the internal buffers. More... | |
error_type | error () const |
Returns the internal error code. More... | |
const edsp::string_view | error_string () const |
Returns a description of the internal error code. More... | |
Static Public Member Functions | |
static bool | valid_ratio (value_type ratio) |
Checks if a ratio is valid. More... | |
This class implements a resampler object to perform sample-rate conversion.
The class resamples an input signal in a factor proportional to the desired sample-rate..
using edsp::io::resampler< T >::error_type = int |
using edsp::io::resampler< T >::size_type = long |
using edsp::io::resampler< T >::value_type = T |
|
inline |
Creates a resampler with the given configuration.
channels | Number of channels. |
quality | Quality of the resampling process. |
factor | Resampling factor (output samplerate / input samplerate) |
|
default |
Default destructor.
|
inline |
Returns the internal error code.
|
inline |
Returns a description of the internal error code.
|
inline |
Resamples the input elements in the range [first, last) and stores the result in another range, beginning at d_first.
The output size is proportional to the input in a factor of \( \lambda \), where lambda is:
\[ \lambda = \frac{f_{si}}{f_{so}} \]
where \( f_{si} \) and \( f_{so} \) are the input size and the output size respectively.
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. |
|
inline |
Returns the quality used in the resampling process.
|
inline |
Resets the internal buffers.
|
inlinestatic |
Checks if a ratio is valid.
ratio | Ratio to be tested |