Class Oversampler
Integer-factor (1×, 2× or 4×) oversampler for a single channel. Zero-stuffs and low-pass filters on the way up, low-pass filters and decimates on the way down, so a non-linear stage (saturation, clipping) can run at a higher rate where the alias products it generates fall above the original Nyquist and are filtered out. A factor of 1 is a transparent pass-through.
public sealed class Oversampler
- Inheritance
-
Oversampler
- Inherited Members
Constructors
Oversampler(int, int)
Creates an oversampler.
public Oversampler(int factor, int sampleRate)
Parameters
Properties
Factor
The oversampling factor.
public int Factor { get; }
Property Value
Methods
Downsample(ReadOnlySpan<float>)
Low-pass filters the high-rate samples and returns the single decimated
output sample. source must be exactly Factor
long.
public float Downsample(ReadOnlySpan<float> source)
Parameters
sourceReadOnlySpan<float>
Returns
Reset()
Clears the anti-alias filter state.
public void Reset()
Upsample(float, Span<float>)
Upsamples one input sample into destination, which must be
at least Factor long.
public void Upsample(float input, Span<float> destination)