예제 #1
0
        public void FFT_TestMethod1()
        {
            DiscreteFourierTransform DFT = new DiscreteFourierTransform();
            // test case 1 ..
            var sig1           = UnitTestUtitlities.LoadSignal("TestingSignals/Signal1_FFT.ds");
            var expectedOutput = UnitTestUtitlities.LoadSignal("TestingSignals/Signal1_FFT_Results.ds");

            DFT.InputTimeDomainSignal  = sig1;
            DFT.InputSamplingFrequency = 360;

            DFT.Run();
            UnitTestUtitlities.SaveSignalFreqDomain(DFT.OutputFreqDomainSignal, "wrrr.txt");
            Assert.IsTrue(UnitTestUtitlities.SignalsSamplesAreEqual(expectedOutput.FrequenciesAmplitudes, DFT.OutputFreqDomainSignal.FrequenciesAmplitudes) &&
                          UnitTestUtitlities.SignalsPhaseShiftsAreEqual(expectedOutput.FrequenciesPhaseShifts, DFT.OutputFreqDomainSignal.FrequenciesPhaseShifts));
        }