Ejemplo n.º 1
0
            public SpectrogramDrawer(int nfft)
            {
                _nfft      = nfft;
                _mapper    = new MagnitudeToIndexMapper(100.0, 255);
                _fft       = new RealFFT(nfft);
                _palette   = GeneratePalette(nfft);
                _segment   = new double[nfft];
                _window    = CreateRaisedCosineWindow(nfft);
                _magnitude = new double[nfft / 2];

                double scaleCorrection = 1.0 / (raisedCosineWindowScale * _fft.ForwardScaleFactor);

                for (int i = 0; i < _window.Length; i++)
                {
                    _window[i] *= scaleCorrection;
                }
            }
Ejemplo n.º 2
0
            public SpectrogramDrawer(int nfft)
            {
                _nfft = nfft;
                _mapper = new MagnitudeToIndexMapper(100.0, MagnitudeIndexRange - 1);
                _fft = new RealFFT(nfft);
                _palette = GeneratePalette();
                _segment = new double[nfft];
                _window = CreateRaisedCosineWindow(nfft);
                _magnitude1 = new double[nfft / 2];
                _magnitude2 = new double[nfft / 2];

                double scaleCorrection = 1.0 / (RaisedCosineWindowScale * _fft.ForwardScaleFactor);
                for (int i = 0; i < _window.Length; i++)
                {
                    _window[i] *= scaleCorrection;
                }
            }