Audacity 3.2.0
|
Our MIR operations do not need the full 44.1 or 48kHz resolution typical of audio files. It may change in the future, if we start looking at chromagrams for example, but for now even a certain amount of aliasing isn't an issue. In fact, for onset detection, it may even be beneficial, since it preserves a trace of the highest frequency components by folding them down below the nyquist. Thus we can decimate the audio signal to a certain extent. This is fast and easy to implement, meanwhile reducing dramatically the amount of data and operations. More...
#include <DecimatingMirAudioReader.h>
Public Member Functions | |
DecimatingMirAudioReader (const MirAudioReader &reader) | |
double | GetSampleRate () const override |
long long | GetNumSamples () const override |
void | ReadFloats (float *buffer, long long start, size_t numFrames) const override |
Public Member Functions inherited from MIR::MirAudioReader | |
virtual double | GetSampleRate () const =0 |
virtual long long | GetNumSamples () const =0 |
virtual void | ReadFloats (float *buffer, long long where, size_t numFrames) const =0 |
double | GetDuration () const |
virtual | ~MirAudioReader ()=default |
Private Attributes | |
const MirAudioReader & | mReader |
const int | mDecimationFactor |
std::vector< float > | mBuffer |
Our MIR operations do not need the full 44.1 or 48kHz resolution typical of audio files. It may change in the future, if we start looking at chromagrams for example, but for now even a certain amount of aliasing isn't an issue. In fact, for onset detection, it may even be beneficial, since it preserves a trace of the highest frequency components by folding them down below the nyquist. Thus we can decimate the audio signal to a certain extent. This is fast and easy to implement, meanwhile reducing dramatically the amount of data and operations.
Definition at line 29 of file DecimatingMirAudioReader.h.
|
explicit |
Definition at line 18 of file DecimatingMirAudioReader.cpp.
|
overridevirtual |
Implements MIR::MirAudioReader.
Definition at line 33 of file DecimatingMirAudioReader.cpp.
References MIR::MirAudioReader::GetNumSamples(), mDecimationFactor, and mReader.
|
overridevirtual |
Implements MIR::MirAudioReader.
Definition at line 28 of file DecimatingMirAudioReader.cpp.
References MIR::MirAudioReader::GetSampleRate(), mDecimationFactor, and mReader.
|
overridevirtual |
Implements MIR::MirAudioReader.
Definition at line 39 of file DecimatingMirAudioReader.cpp.
References mBuffer, mDecimationFactor, mReader, and MIR::MirAudioReader::ReadFloats().
|
mutableprivate |
Definition at line 42 of file DecimatingMirAudioReader.h.
Referenced by ReadFloats().
|
private |
Definition at line 41 of file DecimatingMirAudioReader.h.
Referenced by GetNumSamples(), GetSampleRate(), and ReadFloats().
|
private |
Definition at line 40 of file DecimatingMirAudioReader.h.
Referenced by GetNumSamples(), GetSampleRate(), and ReadFloats().