public static Complex[] Dft(Complex[] signal, uint samplingRation, HammingWindowDef hammingWindow = null)
        {
            var signalLength = signal.Length;
            var ret = new Complex[signalLength];
            var phasePart = -2 * Math.PI / signalLength;
            var phaseHammingPart = 2 * Math.PI / (signalLength - 1);

            for (int frequency = 0; frequency < signalLength; frequency++)
            {
                ret[frequency] = new Complex();
                var phasePartFrequency = phasePart * frequency;
                for (int step = 1; step <= signal.Length; step++)
                {
                    var phase = phasePartFrequency * (step);
                    var temp = signal[step - 1] * Complex.FromPolarCoordinates(1, phase);
                    if (hammingWindow != null)
                    {
                        temp = temp * (hammingWindow.Alpha - hammingWindow.Beta * Math.Cos(phaseHammingPart * (step)));
                    }
                    ret[frequency] += temp;
                }
            }

            return ret;
        }
        public static double[] ApplyHammingWindow(float[] signal, HammingWindowDef hammingWindowDef = null)
        {
            if (hammingWindowDef == null)
            {
                hammingWindowDef = new HammingWindowDef();
            }
            var hammingWindow = new HammingWindow(hammingWindowDef, signal.Length);

            return hammingWindow.Apply(signal);
        }
            public HammingWindow(HammingWindowDef definition, int signalLength)
            {
                var phaseHammingPart = 2 * Math.PI / (signalLength - 1);
                var definition1 = definition;

                _values = new double[signalLength];

                for (int index = 0; index < signalLength; index++)
                {
                    _values[index] = definition1.Alpha - (definition1.Beta * Math.Cos(phaseHammingPart * index));
                }
            }
 public void TestHamming()
 {
     var hamming = new HammingWindowDef();
     var hammingWindow = new HammingWindowDef.HammingWindow(hamming, 5);
     var ret = new double[5];
     for (var index = 0; index < 5; index++)
     {
         ret[index] = hammingWindow[index];
     }
 }