private static double[] generateWave(Double rate, double... freqMagPhase) {
		double[] data = new double[TWO_POWER];

		for (int fm = 0; fm < freqMagPhase.length; fm += 3) {
			double frequency = freqMagPhase[fm];
			double magnitude = freqMagPhase[fm + 1];
			double phase = freqMagPhase[fm + 2];
			for (int t = 0; t < TWO_POWER; t++) {
				data[t] = data[t] + magnitude * Math.sin(frequency * t + phase)
						+ rate * t;
			}
		}

		return data;
	}