Exemple #1
0
        /// <summary>
        /// 時間領域データから作成。
        /// </summary>
        /// <param name="x">時間領域データ</param>
        /// <param name="length">データの長さ</param>
        /// <param name="skip">読み飛ばす長さ</param>
        /// <returns>作成された周波数特性</returns>
        public static Spectrum FromTimeSequence(double[] x, int length, int skip)
        {
            if (x == null)
            {
                return(null);
            }

            int len = BitOperation.FloorPower2(length);

            double[] tmp = new double[len];
            for (int i = 0; i < len; ++i)
            {
                tmp[i] = x[skip + i];
            }
            Fft fft = new Fft(len);

            fft.Transform(tmp);
            return(new Spectrum(tmp));
        }