public FrequencyDomainSignal PerformTransform(List <int> timeDomainSignal)
        {
            FrequencyDomainSignal result = new FrequencyDomainSignal();

            //foreach frequency
            for (int k = 0; k <= timeDomainSignal.Count / 2; k++)
            {
                double accumulatedReal      = 0;
                double accumulatedImaginary = 0;

                for (int i = 0; i < timeDomainSignal.Count; i++)
                {
                    double angle = CalculateCosSinAngle(k, i, timeDomainSignal.Count);
                    accumulatedReal      += timeDomainSignal[i] * Math.Cos(angle);
                    accumulatedImaginary += timeDomainSignal[i] * Math.Sin(angle);
                }

                result.RealResult.Add(accumulatedReal);

                //must negate imaginary
                result.ImaginaryResult.Add(-accumulatedImaginary);
            }

            return(result);
        }
예제 #2
0
        public List <int> PerformInverseTransform(FrequencyDomainSignal frequencyDomainSignal)
        {
            List <int> result = new List <int>();


            return(result);
        }