Table of Contents

Constructor DitherResponse

Namespace
Gamelogic.Extensions.Algorithms
Assembly
Gamelogic.Extensions.dll

DitherResponse(IResponseCurve<float>, IGenerator<float>, float[])

Constructs a new DitherResponse.

public DitherResponse(IResponseCurve<float> quantizer, IGenerator<float> noiseGenerator, float[] errorFactors)

Parameters

quantizer IResponseCurve<float>

The response used to quantize values, such as an instance of StepResponse.

noiseGenerator IGenerator<float>

A generator that provides noise. For satisfactory results, the mean should be 0.

errorFactors float[]

An array of factors used to diffuse the error over several calls. For example, if the error factors are [0.6, 0.3, 0.1], then 60% of the error is given added to the next sample, 30% to the sample after that, and 10% to the sample after that.

DitherResponse(IResponseCurve<float>, int, float, float[])

Dithers responses by adding noise before passing it to a step response. If the quality of the noise is 1, the noise is uniform noise. If the quality of the noise is 2, the noise is triangular noise. The higher the quality, the closer the noise follow a random distribution.

public DitherResponse(IResponseCurve<float> quantizer, int quality, float noiseScale, float[] errorFactors)

Parameters

quantizer IResponseCurve<float>

A response curve that converts inputs to discrete outputs.

quality int

The quality.

noiseScale float

The noise scale.

errorFactors float[]

An array of factors used to diffuse the error over several calls. For example, if the error factors are [0.6, 0.3, 0.1], then 60% of the error is given added to the next sample, 30% to the sample after that, and 10% to the sample after that.