Invert() public method

逆フーリエ変換を行う。
public Invert ( double x ) : void
x double 変換したいデータ
return void
Esempio n. 1
0
        /// <summary>
        /// x をヒルベルト変換する。
        /// </summary>
        /// <param name="x">変換元</param>
        /// <returns>変換後</returns>
        public static double[] HilbertTransform(double[] x)
        {
            int N = x.Length;

            double[] tmp = new double[2 * N];
            for (int i = 0; i < N; ++i)
            {
                tmp[2 * i]     = x[i];
                tmp[2 * i + 1] = 0;
            }

            CFft cfft = new CFft(2 * N);

            cfft.Invert(tmp);

            tmp[0] /= 2; tmp[1] /= 2;
            tmp[N] /= 2; tmp[N + 1] /= 2;
            for (int i = N + 1; i < 2 * N; ++i)
            {
                tmp[i] = 0;
            }

            cfft.Transform(tmp);

            double[] y = new double[x.Length];
            for (int i = 0; i < N; ++i)
            {
                x[i] = tmp[2 * i] * 2 / N;
                y[i] = tmp[2 * i + 1] * 2 / N;
            }

            return(y);
        }        //HilbertTransform
Esempio n. 2
0
        /// <summary>
        /// 最小位相を求める。
        /// </summary>
        public double[] GetMinimumPhase()
        {
            int N = this.x.Length / 2;

            double[] tmp = new double[2 * N];
            for (int i = 0; i < N; ++i)
            {
                tmp[2 * i]     = Math.Log(this[i].LinearPower);
                tmp[2 * i + 1] = 0;
            }

            CFft cfft = new CFft(2 * N);

            cfft.Invert(tmp);

            tmp[0] /= 2; tmp[1] /= 2;
            tmp[N] /= 2; tmp[N + 1] /= 2;
            for (int i = N + 1; i < 2 * N; ++i)
            {
                tmp[i] = 0;
            }

            cfft.Transform(tmp);

            double[] y = new double[N];
            for (int i = 0; i < N; ++i)
            {
                y[i] = -tmp[2 * i + 1] / N;
            }

            return(y);
        }        //GetMinimumPhase
Esempio n. 3
0
		/// <summary>
		/// x をヒルベルト変換する。
		/// </summary>
		/// <param name="x">変換元</param>
		/// <returns>変換後</returns>
		public static double[] HilbertTransform(double[] x)
		{
			int N = x.Length;
			double[] tmp = new double[2*N];
			for(int i=0; i<N; ++i)
			{
				tmp[2*i]         = x[i];
				tmp[2*i+1]       = 0;
			}

			CFft cfft = new CFft(2*N);
			cfft.Invert(tmp);

			tmp[0] /= 2; tmp[1] /= 2;
			tmp[N] /= 2; tmp[N+1] /= 2;
			for(int i=N+1; i<2*N; ++i)
				tmp[i] = 0;

			cfft.Transform(tmp);

			double[] y = new double[x.Length];
			for(int i=0; i<N; ++i)
			{
				x[i] = tmp[2*i]   * 2 / N;
				y[i] = tmp[2*i+1] * 2 / N;
			}

			return y;
		}//HilbertTransform
Esempio n. 4
0
		/// <summary>
		/// 最小位相を求める。
		/// </summary>
		public double[] GetMinimumPhase()
		{
			int N = this.x.Length / 2;
			double[] tmp = new double[2*N];
			for(int i=0; i<N; ++i)
			{
				tmp[2*i]         = Math.Log(this[i].LinearPower);
				tmp[2*i+1]       = 0;
			}

			CFft cfft = new CFft(2*N);
			cfft.Invert(tmp);

			tmp[0] /= 2; tmp[1] /= 2;
			tmp[N] /= 2; tmp[N+1] /= 2;
			for(int i=N+1; i<2*N; ++i)
				tmp[i] = 0;

			cfft.Transform(tmp);

			double[] y = new double[N];
			for(int i=0; i<N; ++i)
			{
				y[i] = -tmp[2*i+1] / N;
			}

			return y;
		}//GetMinimumPhase