protected uint SamplingPeriodToCode(double period) { uint code = (uint)Math.Round(period / SamplingPeriodStep, MidpointRounding.AwayFromZero); code = MathLib.Bound(code, SamplingPeriodMinCode, SamplingPeriodMaxCode); return(code); }