scope(failure) {writefln("Unittest failure :%s(%s)", __FILE__, __LINE__); stdout.flush();} scope(success) {writefln("Unittest success :%s(%s)", __FILE__, __LINE__); stdout.flush();} auto arr = [0, 1, -2, 3].repeatStream, nlz = arr.normalizer(1.5); assert(equal!approxEqual(nlz.read(new float[8]), [0, 1.5, -1.5, 1.5, 0, 0.5, -1.0, 1.5]));
信号の絶対値の最大値をlimitにするように線形に振幅を小さく、もしくは大きくします。