Oversample the sample data from a DenseTimeValueModel by an integer factor, on the assumption that the model represents audio. More...

#include <WaveformOversampler.h>

Static Public Member Functions

static floatvec_t getOversampledData (const DenseTimeValueModel &source, int channel, sv_frame_t sourceStartFrame, sv_frame_t sourceFrameCount, int oversampleBy)
 Return an oversampled version of the audio data from the given source sample range. More...
 

Static Private Member Functions

static floatvec_t getFixedRatioData (const DenseTimeValueModel &source, int channel, sv_frame_t sourceStartFrame, sv_frame_t sourceFrameCount)
 

Static Private Attributes

static int m_filterRatio = 8
 
static floatvec_t m_filter
 Precalculated windowed sinc FIR filter for oversampling ratio of 8. More...
 

Detailed Description

Oversample the sample data from a DenseTimeValueModel by an integer factor, on the assumption that the model represents audio.

Oversampling is carried out using a windowed sinc filter for a fixed 8x ratio with further linear interpolation to handle other ratios. The aim is not to provide the "best-sounding" interpolation, but to provide accurate and predictable projections of the theoretical waveform shape for display rendering without leaving decisions about interpolation up to a resampler library.

Definition at line 31 of file WaveformOversampler.h.

Member Function Documentation

floatvec_t WaveformOversampler::getOversampledData ( const DenseTimeValueModel source,
int  channel,
sv_frame_t  sourceStartFrame,
sv_frame_t  sourceFrameCount,
int  oversampleBy 
)
static

Return an oversampled version of the audio data from the given source sample range.

Will query sufficient source audio before and after the requested range (where available) to ensure an accurate-looking result after filtering. The returned vector will have sourceFrameCount * oversampleBy samples, except when truncated because the end of the model was reached.

Definition at line 22 of file WaveformOversampler.cpp.

References getFixedRatioData(), in_range_for(), and m_filterRatio.

floatvec_t WaveformOversampler::getFixedRatioData ( const DenseTimeValueModel source,
int  channel,
sv_frame_t  sourceStartFrame,
sv_frame_t  sourceFrameCount 
)
staticprivate

Member Data Documentation

int WaveformOversampler::m_filterRatio = 8
staticprivate

Definition at line 53 of file WaveformOversampler.h.

Referenced by getFixedRatioData(), and getOversampledData().

floatvec_t WaveformOversampler::m_filter
staticprivate

Precalculated windowed sinc FIR filter for oversampling ratio of 8.

Definition at line 54 of file WaveformOversampler.h.

Referenced by getFixedRatioData().


The documentation for this class was generated from the following files: