public void FFTTest()
{
// Tests from
// http://www.nayuki.io/res/free-small-fft-in-multiple-languages/FftTest.java
// Test power-of-2 size FFTs
for (int i = 0; i <= 12; i++)
testFft(1 << i);
// Test small size FFTs
for (int i = 0; i < 30; i++)
testFft(i);
// Test diverse size FFTs
int prev = 0;
for (int i = 0; i <= 100; i++)
{
int n = (int)Math.Round(Math.Pow(1500, i / 100.0));
if (n > prev)
{
testFft(n);
prev = n;
}
}
// Test power-of-2 size convolutions
for (int i = 0; i <= 12; i++)
testConvolution(1 << i);
// Test diverse size convolutions
prev = 0;
for (int i = 0; i <= 100; i++)
{
int n = (int)Math.Round(Math.Pow(1500, i / 100.0));
if (n > prev)
{
testConvolution(n);
prev = n;
}
}
Assert.IsTrue(maxLogError < -12.9);
}