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