|
qm-dsp 1.8
|
Decimator carries out a fast downsample by a power-of-two factor. More...
#include <Decimator.h>
Public Member Functions | |
| Decimator (unsigned int inLength, unsigned int decFactor) | |
| Construct a Decimator to operate on input blocks of length inLength, with decimation factor decFactor. | |
| virtual | ~Decimator () |
| void | process (const double *src, double *dst) |
| Process inLength samples (as supplied to constructor) from src and write inLength / decFactor samples to dst. | |
| void | process (const float *src, float *dst) |
| Process inLength samples (as supplied to constructor) from src and write inLength / decFactor samples to dst. | |
| int | getFactor () const |
| void | resetFilter () |
Static Public Member Functions | |
| static int | getHighestSupportedFactor () |
Private Member Functions | |
| void | deInitialise () |
| void | initialise (unsigned int inLength, unsigned int decFactor) |
| void | doAntiAlias (const double *src, double *dst, unsigned int length) |
| void | doAntiAlias (const float *src, double *dst, unsigned int length) |
Private Attributes | |
| unsigned int | m_inputLength |
| unsigned int | m_outputLength |
| unsigned int | m_decFactor |
| double | Input |
| double | Output |
| double | o1 |
| double | o2 |
| double | o3 |
| double | o4 |
| double | o5 |
| double | o6 |
| double | o7 |
| double | a [9] |
| double | b [9] |
| double * | decBuffer |
Decimator carries out a fast downsample by a power-of-two factor.
Only a limited number of factors are supported, from two to whatever getHighestSupportedFactor() returns. This is much faster than Resampler but has a worse signal-noise ratio.
Definition at line 24 of file Decimator.h.
| Decimator::Decimator | ( | unsigned int | inLength, |
| unsigned int | decFactor ) |
Construct a Decimator to operate on input blocks of length inLength, with decimation factor decFactor.
inLength should be a multiple of decFactor. Output blocks will be of length inLength / decFactor.
decFactor must be a power of two. The highest supported factor is obtained through getHighestSupportedFactor(); for higher factors, you will need to chain more than one decimator.
Definition at line 24 of file Decimator.cpp.
References initialise(), m_decFactor, m_inputLength, and m_outputLength.
|
virtual |
Definition at line 34 of file Decimator.cpp.
References deInitialise().
| void Decimator::process | ( | const double * | src, |
| double * | dst ) |
Process inLength samples (as supplied to constructor) from src and write inLength / decFactor samples to dst.
Note that src and dst may be the same or overlap (an intermediate buffer is used).
Definition at line 200 of file Decimator.cpp.
References decBuffer, doAntiAlias(), m_decFactor, m_inputLength, and m_outputLength.
| void Decimator::process | ( | const float * | src, |
| float * | dst ) |
Process inLength samples (as supplied to constructor) from src and write inLength / decFactor samples to dst.
Note that src and dst may be the same or overlap (an intermediate buffer is used).
Definition at line 219 of file Decimator.cpp.
References decBuffer, doAntiAlias(), m_decFactor, m_inputLength, and m_outputLength.
|
inline |
Definition at line 56 of file Decimator.h.
References m_decFactor.
|
inlinestatic |
Definition at line 57 of file Decimator.h.
Referenced by ClusterMeltSegmenter::initialise(), and DownBeat::makeDecimators().
| void Decimator::resetFilter | ( | ) |
|
private |
|
private |
Definition at line 39 of file Decimator.cpp.
References a, b, decBuffer, m_decFactor, m_inputLength, m_outputLength, and resetFilter().
Referenced by Decimator().
|
private |
|
private |
|
private |
Definition at line 67 of file Decimator.h.
Referenced by Decimator(), initialise(), process(), and process().
|
private |
Definition at line 68 of file Decimator.h.
Referenced by Decimator(), initialise(), process(), and process().
|
private |
Definition at line 69 of file Decimator.h.
Referenced by Decimator(), getFactor(), initialise(), process(), and process().
|
private |
Definition at line 71 of file Decimator.h.
Referenced by doAntiAlias(), doAntiAlias(), and resetFilter().
|
private |
Definition at line 72 of file Decimator.h.
Referenced by doAntiAlias(), doAntiAlias(), and resetFilter().
|
private |
Definition at line 74 of file Decimator.h.
Referenced by doAntiAlias(), doAntiAlias(), and resetFilter().
|
private |
Definition at line 74 of file Decimator.h.
Referenced by doAntiAlias(), doAntiAlias(), and resetFilter().
|
private |
Definition at line 74 of file Decimator.h.
Referenced by doAntiAlias(), doAntiAlias(), and resetFilter().
|
private |
Definition at line 74 of file Decimator.h.
Referenced by doAntiAlias(), doAntiAlias(), and resetFilter().
|
private |
Definition at line 74 of file Decimator.h.
Referenced by doAntiAlias(), doAntiAlias(), and resetFilter().
|
private |
Definition at line 74 of file Decimator.h.
Referenced by doAntiAlias(), doAntiAlias(), and resetFilter().
|
private |
Definition at line 74 of file Decimator.h.
Referenced by doAntiAlias(), doAntiAlias(), and resetFilter().
|
private |
Definition at line 76 of file Decimator.h.
Referenced by doAntiAlias(), doAntiAlias(), and initialise().
|
private |
Definition at line 77 of file Decimator.h.
Referenced by doAntiAlias(), doAntiAlias(), and initialise().
|
private |
Definition at line 79 of file Decimator.h.
Referenced by deInitialise(), initialise(), process(), and process().