Ham Cockpit   

    Show / Hide Table of Contents

    Method ApproximateRatio

    View Source

    ApproximateRatio(Double, Double)

    Finds a rational approximation of a floating point value.

    Declaration
    public static (int L, int M) ApproximateRatio(double ratio, double maxError)
    Parameters
    Type Name Description
    Double ratio

    The floating point value.

    Double maxError

    The maximum error.

    Returns
    Type Description
    ValueTuple<Int32, Int32>

    The approximating ratio, L/M.

    Remarks

    Finds the Diophantine approximation to the given floating point value. Useful for the design of low complexity resamplers when the exact output rate is not required.

    • View Source
    Back to top Generated by DocFX