scalib.preprocessing.QuantFitMethod#

class scalib.preprocessing.QuantFitMethod(method, **kwargs)[source]#

Method for esimating the scale and shift parameters of Quantizer.

Methods

bounds([margin])

Take the min and max of the training traces, fit such that the [min, max] range is mapped to a zero-centered interval covering a 1/margin fraction of the quantized domain: if the quantized domain is [-Q,Q], min` is mapped to ``-Q/margin and max is mapped to Q/margin.

moment([nstd])

Take the mean and standard deviation of the training traces, fit such that mean-nstd*std is mapped to -Q and mean+nstd*std is mapped to Q, where [-Q, Q] is the quantized domain.

Parameters:

method (QFitMethod) –

classmethod bounds(margin=4.0)[source]#

Take the min and max of the training traces, fit such that the [min, max] range is mapped to a zero-centered interval covering a 1/margin fraction of the quantized domain: if the quantized domain is [-Q,Q], min` is mapped to ``-Q/margin and max is mapped to Q/margin.

classmethod moment(nstd=7.0)[source]#

Take the mean and standard deviation of the training traces, fit such that mean-nstd*std is mapped to -Q and mean+nstd*std is mapped to Q, where [-Q, Q] is the quantized domain.