Пример #1
0
        private void Refresh(int sampleCount)
        {
            float[] samples = new float[sampleCount];
            samples = samples.Select(sample => 1f).ToArray();

            graphInput.Values = samples;

            float[] samplesRectangle = (float[])samples.Clone();
            WindowUtil.Rectangle(samplesRectangle, 0, samples.Length);
            graphRectangle.Values = samplesRectangle;

            float[] samplesTriangle = (float[])samples.Clone();
            WindowUtil.Triangle(samplesTriangle, 0, samples.Length);
            graphTriangle.Values = samplesTriangle;

            float[] samplesHamming = (float[])samples.Clone();
            WindowUtil.Hamming(samplesHamming, 0, samples.Length);
            graphHamming.Values = samplesHamming;

            float[] samplesHann = (float[])samples.Clone();
            WindowUtil.Hann(samplesHann, 0, samples.Length);
            graphHann.Values = samplesHann;

            float[] samplesBlackman = (float[])samples.Clone();
            WindowUtil.Blackman(samplesBlackman, 0, samples.Length);
            graphBlackman.Values = samplesBlackman;

            float[] samplesBlackmanHarris = (float[])samples.Clone();
            WindowUtil.BlackmanHarris(samplesBlackmanHarris, 0, samples.Length);
            graphBlackmanHarris.Values = samplesBlackmanHarris;

            float[] samplesBlackmanNuttall = (float[])samples.Clone();
            WindowUtil.BlackmanNuttall(samplesBlackmanNuttall, 0, samples.Length);
            graphBlackmanNuttall.Values = samplesBlackmanNuttall;

            float[] samplesNuttall = (float[])samples.Clone();
            WindowUtil.Nuttall(samplesNuttall, 0, samples.Length);
            graphNuttall.Values = samplesNuttall;

            //PrintArrayToDebugOutput(samples);
            //PrintArrayToDebugOutput(samplesRectangle);
            //PrintArrayToDebugOutput(samplesTriangular);
            //PrintArrayToDebugOutput(samplesHamming);
            //PrintArrayToDebugOutput(samplesHanning);
            //PrintArrayToDebugOutput(samplesBlackman);
            //PrintArrayToDebugOutput(samplesBlackmanHarris);
            //PrintArrayToDebugOutput(samplesBlackmanNuttall);
        }