示例#1
0
        void FFTCallback(float[] fftData) //data received
        {
            Dispatcher.Invoke(() =>
            {
                // MatrixFrame.FFTToFrame(fftData);

                MatrixFrame.FillFrame(new Pixel(0, 0, 0));
                float[] downSampledData = ResizeSampleArray(fftData, MatrixFrame.Width);
                for (int i = 0; i < MatrixFrame.Width; i++)
                {
                    if (SelectedDisplayMode == 0)
                    {
                        MatrixFrame.DrawColumnMirrored(i, (int)(downSampledData[i] * MatrixFrame.Height), _bottomColorPixel, _topColorPixel);
                    }
                    if (SelectedDisplayMode == 1)
                    {
                        MatrixFrame.DrawColumn(i, (int)(downSampledData[i] * MatrixFrame.Height), _bottomColorPixel, _topColorPixel);
                    }
                }
                MatrixFrame.Refresh();
            });
        }