AcoustID.Audio.LomontFFTService.ComputeFrame C# (CSharp) 메소드

ComputeFrame() 공개 메소드

public ComputeFrame ( short input, double output ) : void
input short
output double
리턴 void
        public void ComputeFrame(short[] input, double[] output)
        {
            for (int i = 0; i < m_frame_size; i++)
            {
                m_input[i] = (double)input[i];
            }

            Helper.ApplyWindow(ref m_input, m_window, m_frame_size, 1.0);

            this.RealFFT(m_input);

            // m_input will now contain the FFT values
            // r0, r(n/2), r1, i1, r2, i2 ...

            // Compute energy
            output[0] = m_input[0] * m_input[0];
            output[m_frame_size_h] = m_input[1] * m_input[1];

            for (int i = 1; i < m_frame_size_h; i++)
            {
                output[i] = m_input[2 * i] * m_input[2 * i] + m_input[2 * i + 1] * m_input[2 * i + 1];
            }
        }