亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? simple_haar.java

?? java的小波分析程序
?? JAVA
字號:


package wavelets;

import java.util.*;
import wavelet_util.*;

/**
 *
<p>
  Class simple_haar

<p>
   This object calcalculates the "ordered fast Haar wavelet
   transform".  The algorithm used is the a simple Haar wavelet
   algorithm that does <u>not</u> calculate the wavelet transform
   in-place.  The function works on Java double values.
<p> 
   The wavelet_calc function is passed an <b>array</b> of doubles from
   which it calculates the Haar wavelet transform.  The transform is
   not calculated in place.  The result consists of a single value and
   a Vector of coefficients arrays, ordered by increasing frequency.
   The number of data points in the data used to calculate the wavelet
   must be a power of two.
<p>
   The Haar wavelet transform is based on calculating the Haar step
   function and the Haar wavelet from two adjacent values.  For
   an array of values S0, S1, S2 .. Sn, the step function and
   wavelet are calculated as follows for two adjacent points,
   S0 and S1:

<pre>
      <i>HaarStep</i> = (S0 + S1)/2  <i>// average of S0 and S1</i>
      <i>HaarWave</i> = (S0 - S1)/2  <i>// average difference of S0 and S1</i>
</pre>

<p>
   This yields two vectors: <b>a</b>, which contains the
   <i>HaarStep</i> values and <b>c</b>, which contains the
   <i>HaarWave</i> values.

<p> The result of the <tt>wavelet_calc</tt> is the single Haar value
    and a set of coefficients.  There will be ceil( log<sub>2</sub>(
    values.length() )) coefficients.

@author Ian Kaplan   

@see <i>Wavelets Made Easy by Yves Nieverglt, Birkhauser, 1999</i>

  
<h4>
   Copyright and Use
</h4>

<p>
   You may use this source code without limitation and without
   fee as long as you include:
</p>
<blockquote>
     This software was written and is copyrighted by Ian Kaplan, Bear
     Products International, www.bearcave.com, 2001.
</blockquote>
<p>
   This software is provided "as is", without any warrenty or
   claim as to its usefulness.  Anyone who uses this source code
   uses it at their own risk.  Nor is any support provided by
   Ian Kaplan and Bear Products International.
<p>
   Please send any bug fixes or suggested source changes to:
<pre>
     iank@bearcave.com
</pre>


 */

public class simple_haar extends wavelet_base {
  private double haar_value;  // the final Haar step value
  private Vector coef;        // The Haar coefficients
  private double[] data;

/**
 *      
<p>
   Calculate the Haar wavelet transform
   (the ordered fast Haar wavelet tranform).
   This calculation is <u>not</u> done in place.

<p>
  @param values
         a <tt>values</tt>: an array of double
         values on which the Haar transform is
         applied.

 */
  public void wavelet_calc( double[] values )
  {
    
    if (values != null) {
      data = values;
      coef = new Vector();
      haar_value = haar_calc( values );
      reverseCoef();
    }
  } // wavelet_calc


  /**

    The Haar transform coefficients are generated from the longest
    coefficient vector (highest frequency) to the shortest (lowest
    frequency).  However, the reverse Haar transform and the display
    of the values uses the coefficients from the lowest to the
    highest frequency.  This function reverses the coefficient 
    order, so they will be ordered from lowest to highest frequency.

   */
  private void reverseCoef() {
    int size = coef.size();
    Object tmp;

    for (int i = 0, j = size-1; i < j; i++, j--) {
      tmp = coef.elementAt(i);
      coef.setElementAt(coef.elementAt(j), i);
      coef.setElementAt(tmp, j);
    } // for
  } // reverseCoef


  
  /**
   * 

    Recursively calculate the Haar transform.  The result
    of the Haar transform is a single integer value
    and a Vector of coefficients.  The coefficients are
    calculated from the highest to the lowest frequency.
<p>
    The number of elements in <tt>values</tt> must be a power of two.

   */
  private double haar_calc( double[] values )
  {
    double retVal;

    double[] a = new double[ values.length/2 ];
    double[] c = new double[ values.length/2 ];

    for (int i = 0, j = 0; i < values.length; i += 2, j++) {
      a[j] = (values[i] + values[i+1])/2;
      c[j] = (values[i] - values[i+1])/2;
    }
    coef.addElement( c );
    
    if (a.length == 1)
      retVal = a[0];
    else
      retVal = haar_calc( a );

    return retVal;
  } // haar_calc


  /**
   *

<p>
     Calculate the inverse haar transform from the coefficients
     and the Haar value.
<p>
     The inverse function will overwrite the original data
     that was used to calculate the Haar transform.  Since this
     data is initialized by the caller, the caller should
     make a copy if the data should not be overwritten.
<p>
     The coefficients are stored in in a Java <tt>Vector</tt>
     container.  The length of the coefficient arrays is ordered in
     powers of two (e.g., 1, 2, 4, 8...).  The inverse Haar function
     is calculated using a butterfly pattern to write into the data
     array.  An initial step writes the Haar value into data[0].  In
     the case of the example below this would be

<pre>
     data[0] = 5.0;
</pre>
<p>
     Then a butterfly pattern is shown below.  Arrays indices start at
     0, so in this example <tt>c[1,1] is the second element of the
     second coefficient vector.

<pre>
wavelet:
{[5.0];
-3.0;
0.0, -1.0;
1.0, -2.0, 1.0, 0.0}

tmp = d[0];
d[0] = tmp + c[0, 0]
d[4] = tmp - c[0, 0]

tmp = d[0];
d[0] = tmp + c[1, 0]
d[2] = tmp - c[1, 0]
tmp = d[4];
d[4] = tmp + c[1, 1]
d[6] = tmp - c[1, 1]

tmp = d[0];
d[0] = tmp + c[2, 0]
d[1] = tmp - c[2, 0]
tmp = d[2];
d[2] = tmp + c[2, 1]
d[3] = tmp - c[2, 1]
tmp = d[4];
d[4] = tmp + c[2, 2]
d[5] = tmp - c[2, 2]
tmp = d[6];
d[6] = tmp + c[2, 3]
d[7] = tmp - c[2, 3]
</pre>

   */
  public void inverse() {
    if (data != null && coef != null && coef.size() > 0) {
      int len = data.length;

      data[0] = haar_value;

      if (len > 0) {
	// System.out.println("inverse()");
        byte log = binary.log2( len );

        len = binary.power2( log );  // calculation must be on 2 ** n values

	int vec_ix = 0;
	int last_p = 0;
	byte p_adj = 1;

        for (byte l = (byte)(log-1); l >= 0; l--) {

          int p = binary.power2( l );
	  double c[] = (double[])coef.elementAt( vec_ix );

	  int coef_ix = 0;
          for (int j = 0; j < len; j++) {
            int a_1 = p * (2 * j);
	    int a_2 = p * ((2 * j) + 1);

            if (a_2 < len) {
	      double tmp = data[a_1];
	      data[ a_1 ] = tmp + c[coef_ix];
	      data[ a_2 ] = tmp - c[coef_ix];
	      coef_ix++;
            }
            else {
              break;
            }
          } // for j
	  last_p = p;
	  p_adj++;
	  vec_ix++;
        } // for l
      }
      
    }
  } // inverse


  /**
      Print the simple Haar object (e.g, the
      final Haar step value and the coefficients.

   */
  public void pr() {
    if (coef != null) {
      System.out.print("{[" + haar_value + "]");
      int size = coef.size();
      double[] a;
      
      for (int i = 0; i < size; i++) {
	System.out.println(";");
	a = (double[])coef.elementAt(i);
	for (int j = 0; j < a.length; j++) {
	  System.out.print( a[j] );
	  if (j < a.length-1) {
	    System.out.print(", ");
	  }
	} // for j
      } // for i
      System.out.println("}");
    }
  } // pr


  /**
   *

<p>
     Print the data values.

<p>
     The <tt>pr()</tt> method prints the coefficients in increasing
     frequency.  This function prints the data values which were
     used to generate the Haar transform.

   */
  public void pr_values() {
    if (data != null) {
      System.out.print("{");
      for (int i = 0; i < data.length; i++) {
	System.out.print( data[i] );
	if (i < data.length-1)
	  System.out.print(", ");
      }
      System.out.println("}");
    }
  } // pr_values


} // simple_haar

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久影院电视剧免费观看| 久久亚洲影视婷婷| 国内久久精品视频| 亚洲欧美视频一区| 久久久影院官网| 欧美精品久久一区| 一本久久a久久免费精品不卡| 美女视频一区二区| 午夜久久久久久电影| 中文字幕中文乱码欧美一区二区 | 麻豆国产精品一区二区三区| 亚洲精品老司机| 国产精品妹子av| 欧美精品一区二区久久婷婷| 91精品欧美一区二区三区综合在| 色又黄又爽网站www久久| 高清不卡一区二区| 国产精品一区一区三区| 蜜臀va亚洲va欧美va天堂| 亚洲一级电影视频| 亚洲女与黑人做爰| 国产精品大尺度| 国产精品日韩成人| 国产色产综合色产在线视频| 欧美变态口味重另类| 欧美一区二区久久久| 欧美另类变人与禽xxxxx| 欧美伊人久久大香线蕉综合69| av激情成人网| 91欧美激情一区二区三区成人| 成人国产免费视频| www.av亚洲| 99久久免费精品高清特色大片| 国产成人精品亚洲日本在线桃色| 国产专区欧美精品| 国产在线精品一区二区| 国产综合久久久久久鬼色| 精品一区二区精品| 国产一区二区三区| 国产成人午夜高潮毛片| 大陆成人av片| 色综合久久久久综合体桃花网| 色哟哟精品一区| 欧美日韩一区二区三区四区五区| 欧美日韩中字一区| 欧美一区二区美女| 久久久精品欧美丰满| 欧美高清一级片在线观看| 国产精品免费看片| 亚洲精品日日夜夜| 亚洲成人精品一区| 免费观看成人鲁鲁鲁鲁鲁视频| 久久99精品久久久久婷婷| 国产一区二区三区久久悠悠色av | 成人综合在线网站| 91麻豆高清视频| 欧美精品丝袜中出| 日韩欧美电影在线| 国产精品免费视频观看| 亚洲精品国产一区二区精华液| 午夜精品免费在线| 国内精品国产成人国产三级粉色| 国产98色在线|日韩| 97精品久久久午夜一区二区三区 | 欧美日韩视频在线第一区 | 国产精品无码永久免费888| 日韩美女视频一区二区| 亚洲二区视频在线| 国产一区二三区好的| 色综合久久综合中文综合网| 91精品国产免费久久综合| 国产午夜亚洲精品不卡| 亚洲免费看黄网站| 免费在线观看日韩欧美| 岛国av在线一区| 4438亚洲最大| 国产欧美一区在线| 天堂久久久久va久久久久| 国产精品自拍网站| 精品视频999| 中文字幕av不卡| 日产精品久久久久久久性色| 成人精品视频.| 3atv在线一区二区三区| 国产精品三级av| 久久国产精品第一页| 色综合久久久网| 久久久五月婷婷| 亚洲成人精品一区二区| 丁香六月久久综合狠狠色| 91精品久久久久久久91蜜桃| 国产精品电影一区二区三区| 毛片一区二区三区| 91久久线看在观草草青青 | 自拍av一区二区三区| 美女在线观看视频一区二区| 一本到不卡精品视频在线观看| 精品少妇一区二区| 亚洲成精国产精品女| 成人黄色在线看| 久久久综合网站| 日本视频一区二区三区| 色丁香久综合在线久综合在线观看| 2023国产精品视频| 日韩电影一区二区三区| 欧洲另类一二三四区| 中文字幕电影一区| 精品无码三级在线观看视频 | 国产精品久久久久久久岛一牛影视 | 亚洲麻豆国产自偷在线| 懂色中文一区二区在线播放| 91精品一区二区三区在线观看| 一区二区三区免费观看| 成人a级免费电影| 久久免费的精品国产v∧| 麻豆成人91精品二区三区| 精品视频1区2区| 亚洲激情六月丁香| 91亚洲永久精品| 日韩理论片在线| av中文字幕不卡| 中文字幕乱码日本亚洲一区二区| 激情亚洲综合在线| 日韩欧美成人午夜| 日本伊人色综合网| 欧美肥妇free| 石原莉奈在线亚洲三区| 欧美日韩国产高清一区二区| 亚欧色一区w666天堂| 欧美影院一区二区| 亚洲一区二区三区四区在线免费观看| 91视视频在线直接观看在线看网页在线看| 国产精品无遮挡| 91女神在线视频| 亚洲欧美日韩久久精品| 在线视频一区二区三| 一片黄亚洲嫩模| 9191国产精品| 捆绑调教美女网站视频一区| 欧美一级二级三级蜜桃| 久久99久久精品| 久久精品一区二区三区不卡牛牛 | 91在线码无精品| 怡红院av一区二区三区| 欧美综合一区二区三区| 亚瑟在线精品视频| 精品免费日韩av| 国产成人欧美日韩在线电影| 国产精品色一区二区三区| 日本高清成人免费播放| 亚洲成人av电影| 精品久久免费看| 国产成人精品一区二区三区四区 | 日韩激情一区二区| 日韩免费在线观看| 成人高清视频在线观看| 一片黄亚洲嫩模| 日韩美女在线视频| 粉嫩13p一区二区三区| 亚洲综合色视频| 日韩精品一区二区三区中文精品| 国产麻豆精品视频| 亚洲另类中文字| 欧美一级夜夜爽| 粉嫩13p一区二区三区| 一二三区精品福利视频| 欧美v日韩v国产v| 不卡一区在线观看| 日本亚洲一区二区| 欧美国产综合色视频| 欧美丝袜丝交足nylons| 精品一区二区三区日韩| 亚洲理论在线观看| 欧美大片在线观看一区二区| aaa欧美大片| 日本成人在线网站| 中文字幕一区三区| 91精品国产综合久久蜜臀| 成人网页在线观看| 日韩精品一级中文字幕精品视频免费观看 | 国产午夜精品久久久久久免费视| www.日韩在线| 日本亚洲三级在线| 中文字幕一区三区| 精品久久人人做人人爰| 欧洲中文字幕精品| 国产精品99久久久| 天天色图综合网| 中文字幕在线不卡一区二区三区| 欧美日本一区二区在线观看| 国产成人在线免费观看| 日韩激情av在线| 亚洲欧美另类久久久精品| 精品福利在线导航| 欧美日韩一区二区不卡| av在线不卡观看免费观看| 精品午夜一区二区三区在线观看| 香蕉久久夜色精品国产使用方法| 国产精品拍天天在线| 欧美大片日本大片免费观看|