コード例 #1
0
ファイル: Transform.java プロジェクト: noraomran/JWave
  /**
   * Constructor; needs some object like DiscreteFourierTransform, FastBasicTransform,
   * WaveletPacketTransfom, ... It take also a number of iteration for decomposition
   *
   * @date 19.05.2009 09:50:24
   * @author Christian Scheiblich ([email protected])
   */
  @Deprecated
  public Transform(BasicTransform transform, int iteration) {
    if (transform instanceof BasicTransform) {
      _transform = transform;

      // TODO realize the level transform in GOOD Software Engineering
      // style - after restructuring the code

      // ( (WaveletTransform)_transform ).set_iteration( iteration );

      try { // always break down these methods

        throw new JWaveError("THE ITERATION METHODS ARE BORKEN AT MOMENT");

      } catch (JWaveError e) {
        e.printStackTrace();
      } // try

    } else {
      throw new IllegalArgumentException(
          "Can't use transform :"
              + transform.getClass()
              + " with a specific level decomposition ;"
              + " use Transform( TransformI transform ) constructor instead.");
    }

    _mathToolKit = new MathToolKit();
  } // Transform
コード例 #2
0
ファイル: Transform.java プロジェクト: noraomran/JWave
  /**
   * Performs the 3-D reverse transform of the specified BasicWave object.
   *
   * @date 10.07.2010 18:15:33
   * @author Christian Scheiblich ([email protected])
   * @param matrixFreq coefficients of 2-D frequency or Hilbert domain; internal M(i),N(j),O(k)
   * @return coefficients of 2-D time domain
   * @throws JWaveFailure if space is not of type 2^p x 2^q x 2^r
   */
  public double[][][] reverse(double[][][] spaceFreq) throws JWaveFailure {

    int M = spaceFreq.length;

    if (!_mathToolKit.isBinary(M))
      throw new JWaveFailure(
          "given space dimension "
              + M
              + " is not 2^p = 1, 2, 4, 8, 16, 32, .. "
              + "please use the Ancient Egyptian Decomposition for any other array length!");

    for (int i = 0; i < M; i++) { // M(i)

      int N = spaceFreq[i].length;

      if (!_mathToolKit.isBinary(N))
        throw new JWaveFailure(
            "given space dimension N(i)="
                + N
                + " is not 2^p = 1, 2, 4, 8, 16, 32, .. "
                + "please use the Ancient Egyptian Decomposition for any other array length!");

      for (int j = 0; j < N; j++)
        // // N(j)
        if (!_mathToolKit.isBinary(spaceFreq[i][j].length))
          // O
          throw new JWaveFailure(
              "given space dimension M(j)="
                  + spaceFreq[i][j].length
                  + " is not 2^p = 1, 2, 4, 8, 16, 32, .. "
                  + "please use the Ancient Egyptian Decomposition for any other array length!");
    } // i

    return _transform.reverse(spaceFreq);
  } // reverse
コード例 #3
0
ファイル: Transform.java プロジェクト: noraomran/JWave
  /**
   * Performs the reverse transform of the specified BasicWave object.
   *
   * @date 10.02.2010 09:42:18
   * @author Christian Scheiblich ([email protected])
   * @param arrFreq coefficients of frequency or Hilbert domain
   * @return coefficients of time domain
   * @throws JWaveFailureif array is not of type 2^p
   */
  public double[] reverse(double[] arrFreq) throws JWaveFailure {

    if (!_mathToolKit.isBinary(arrFreq.length))
      throw new JWaveFailure(
          "given array length is not 2^p = 1, 2, 4, 8, 16, 32, .. "
              + "please use the Ancient Egyptian Decomposition for any other array length!");

    return _transform.reverse(arrFreq);
  } // reverse
コード例 #4
0
ファイル: Transform.java プロジェクト: noraomran/JWave
  /**
   * Performs the 2-D reverse transform of the specified BasicWave object.
   *
   * @date 10.02.2010 10:59:32
   * @author Christian Scheiblich ([email protected])
   * @param matrixFreq coefficients of 2-D frequency or Hilbert domain; internal M(i),N(j)
   * @return coefficients of 2-D time domain
   * @throws JWaveFailure if matrix is not of type 2^p x 2^q
   */
  public double[][] reverse(double[][] matrixFreq) throws JWaveFailure {

    int M = matrixFreq.length;

    if (!_mathToolKit.isBinary(M))
      throw new JWaveFailure(
          "given matrix dimension "
              + M
              + " is not 2^p = 1, 2, 4, 8, 16, 32, .. "
              + "please use the Ancient Egyptian Decomposition for any other array length!");

    for (int i = 0; i < M; i++)
      if (!_mathToolKit.isBinary(matrixFreq[i].length))
        throw new JWaveFailure(
            "given matrix dimension N(i)="
                + matrixFreq[i].length
                + " is not 2^p = 1, 2, 4, 8, 16, 32, .. "
                + "please use the Ancient Egyptian Decomposition for any other array length!");

    return _transform.reverse(matrixFreq);
  } // reverse