public void GetPowerCepstrumTest() { // http://mi.eng.cam.ac.uk/~ajr/SpeechAnalysis/node33.html Complex[] source = { (Complex)(-1.0), (Complex)(+0.5), (Complex)(+0.3), (Complex)(-0.4), (Complex)(+0.1), (Complex)(-0.9), (Complex)(-0.2), (Complex)(-0.5), }; double[] expected = { 0.3319, 0.1285, -0.0218, 0.2303, -0.2639, 0.2303, -0.0218, 0.1285 }; double[] actual = Tools.GetPowerCepstrum(source); Assert.IsTrue(expected.IsEqual(actual, atol: 1e-4)); }
public void InterleaveTest() { float[,] channels = { { 0.1f, -5.1f }, { -0.2f, -6.0f }, { 2.3f, -3.4f }, { 0.7f, 5.2f }, { 0.6f, -1.7f }, }; float[] expected = { 0.1f, -5.1f, -0.2f, -6.0f, 2.3f, -3.4f, 0.7f, 5.2f, 0.6f, -1.7f, }; float[] actual = Tools.Interleave(channels); Assert.IsTrue(actual.IsEqual(expected)); }