⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filter_test.java

📁 java的小波分析程序
💻 JAVA
字号:

import java.io.*;
import wavelets.*;
import wavelet_util.*;
import dataInput.*;

/**
  Apply the gaussian filter to a time series (in this case
  the time series for Applied Materials (symbol: AMAT).
  Two files will be generated: <i>filtered_data</i> which
  contains the close price time series that has been 
  filtered using Haar wavelets and <i>filtered_data_noise</i>
  which contains the noise spectrum.
 */

class filter_test {

  public static void main( String[] args ) {
      String timeSeriesFile = "amat_close";  // Applied Materials Close prices
      tsRead data = new tsRead( timeSeriesFile );
      //
      // The wavelet algorithms work on arrays whose length is a power
      // of two.  Set the length to the nearest power of two that is
      // less than or equal to the data length.
      //
      int len = data.getSize();
      if (len > 0) {
	int newSize = binary.nearestPower2( len );
	data.setSize( newSize );
	double[] vals = data.getArray();

	if (vals != null) {
	  noise_filter filter = new noise_filter();
	  filter.filter_time_series( "filtered_data", vals );
	}
      }
  }

} // filter_test

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -