ml-savitzky-golay-generalized
    Preparing search index...

    Function sggPair

    • Apply the Savitzky Golay algorithm for two derivative orders at once.

      Each y value is read once and multiplied into both accumulators, and the window spacing is measured once and raised twice, where calling sgg twice repeats both. Peak picking wants the first and second derivative of the same trace, which is what the default asks for.

      Two and not a list: an accumulator per order behind a loop costs more than sharing the reads saves, so a general version measured slower than calling sgg repeatedly. Ask for more than two by calling this and sgg.

      Parameters

      • ys: NumberArray

        Array of y values.

      • xs: number | NumberArray

        Array of X or deltaX.

      • options: SGGPairOptions = {}

        Options controlling window size, derivatives and polynomial order.

      Returns [Float64Array<ArrayBufferLike>, Float64Array<ArrayBufferLike>]

      The two derivative arrays, in the order requested.