Converts the sample rate of a signal with a windowed sinc low pass filter (by default the cut off is at 45% of the lower sample rate).
More...
#include <DSPUtils.h>
|
| void | begin (float in_rate, float out_rate, float cutoff=0.45f) |
| void | reset () |
| void | setRateFactor (double factor) |
| template<class F> |
| void | write (float x, F out) |
| | Adds an input sample and calls out(float) for each output sample.
|
| template<class F> |
| void | writeComplex (float re, float im, F out) |
|
| float | kernel (float u) |
| | kernel at the distance u (in samples of the lower rate)
|
Converts the sample rate of a signal with a windowed sinc low pass filter (by default the cut off is at 45% of the lower sample rate).
- Copyright
- GPLv3
◆ begin()
| void tinymodem::SampleRateConverter::begin |
( |
float | in_rate, |
|
|
float | out_rate, |
|
|
float | cutoff = 0.45f ) |
|
inline |
Defines the input and output sample rate and the cut off relative to the lower sample rate
◆ kernel()
| float tinymodem::SampleRateConverter::kernel |
( |
float | u | ) |
|
|
inlineprotected |
kernel at the distance u (in samples of the lower rate)
◆ reset()
| void tinymodem::SampleRateConverter::reset |
( |
| ) |
|
|
inline |
◆ setRateFactor()
| void tinymodem::SampleRateConverter::setRateFactor |
( |
double | factor | ) |
|
|
inline |
Changes the output rate by the indicated factor (e.g. 1.001), e.g. to follow a different clock of the sender
◆ write()
template<class F>
| void tinymodem::SampleRateConverter::write |
( |
float | x, |
|
|
F | out ) |
|
inline |
Adds an input sample and calls out(float) for each output sample.
◆ writeComplex()
template<class F>
| void tinymodem::SampleRateConverter::writeComplex |
( |
float | re, |
|
|
float | im, |
|
|
F | out ) |
|
inline |
Adds a complex input sample (both parts use the same timing) and calls out(float re, float im) for each output sample
◆ base_ratio
| double tinymodem::SampleRateConverter::base_ratio = 1 |
|
protected |
◆ bypass
| bool tinymodem::SampleRateConverter::bypass = true |
|
protected |
◆ count
| int64_t tinymodem::SampleRateConverter::count = 0 |
|
protected |
◆ cutoff
| float tinymodem::SampleRateConverter::cutoff = 0.45f |
|
protected |
◆ HALF_WIDTH
| int tinymodem::SampleRateConverter::HALF_WIDTH = 8 |
|
staticconstexprprotected |
◆ half_width
| float tinymodem::SampleRateConverter::half_width = HALF_WIDTH |
|
protected |
◆ history
| audio_tools::Vector<float> tinymodem::SampleRateConverter::history |
|
protected |
◆ history_q
| audio_tools::Vector<float> tinymodem::SampleRateConverter::history_q |
|
protected |
◆ kernel_scale
| float tinymodem::SampleRateConverter::kernel_scale = 1 |
|
protected |
◆ next
| double tinymodem::SampleRateConverter::next = 0 |
|
protected |
◆ ratio
| double tinymodem::SampleRateConverter::ratio = 1 |
|
protected |
◆ TABLE
| int tinymodem::SampleRateConverter::TABLE = 512 |
|
staticconstexprprotected |
◆ table
| float tinymodem::SampleRateConverter::table[TABLE+2] |
|
protected |
The documentation for this class was generated from the following file: