@@ -0,0 +1,743 @@
+package framework.generators;%0A%0A/**%0A * Extends the Generator abstract class to create sine waves.%0A */%0Apublic class SquareGenerator extends Generator %7B%0A    public Double%5B%5D generate(Double f, Double d, Double a) %7B%0A        int N = (int)(Generator.SAMPLE_RATE * d);%0A        Double%5B%5D result = new Double%5BN+1%5D;%0A%0A        Double phase = 0.;%0A%0A        for(int i = 0; i %3C= N; i++) %7B%0A            if(phase %3C Math.PI)%0A                result%5Bi%5D = a;%0A            else%0A                result%5Bi%5D = -a;%0A%0A            phase += (2 * Math.PI * f) / Generator.SAMPLE_RATE;%0A%0A            if(phase %3E (2 * Math.PI))%0A                phase = phase - (2 * Math.PI);%0A        %7D%0A%0A        return result;%0A    %7D%0A%0A    public String toString() %7B%0A        return %22Square Wave%22;%0A    %7D%0A%7D

Create square generator.