public void NaiveMatchesDft(HartleyOptions hartleyOptions, FourierOptions fourierOptions) { var dht = new DiscreteHartleyTransform(); var samples = Generate.Random(0x80, GetUniform(1)); VerifyMatchesDft( samples, 5, false, s => Transform.FourierForward(s, fourierOptions), s => dht.NaiveForward(s, hartleyOptions)); VerifyMatchesDft( samples, 5, true, s => Transform.FourierInverse(s, fourierOptions), s => dht.NaiveInverse(s, hartleyOptions)); }
public void HartleyNaiveIsReversible(HartleyOptions options) { var dht = new DiscreteHartleyTransform(); VerifyIsReversibleReal( 0x80, 1e-9, s => dht.NaiveForward(s, options), s => dht.NaiveInverse(s, options)); }
public void HartleyNaiveIsReversible(HartleyOptions options) { var dht = new DiscreteHartleyTransform(); var samples = Generate.Random(0x80, GetUniform(1)); var work = new double[samples.Length]; samples.CopyTo(work, 0); work = dht.NaiveForward(work, options); Assert.IsFalse(work.ListAlmostEqual(samples, 6)); work = dht.NaiveInverse(work, options); AssertHelpers.ListAlmostEqual(samples, work, 12); }