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

📄 spectrum_test.java

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

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

/**
  Generate gnuplot files for the time series with
  various spectrum removed.

 */

class spectrum_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) {

	  wavelets.inplace_haar haar = new wavelets.inplace_haar();
	  haar.wavelet_calc( vals );
	  haar.order();

	  coef_spectrum spectrum = new coef_spectrum();
	  spectrum.filter_one_spectrum( vals );
	  spectrum.only_one_spectrum( vals );
	}
      }
  }

} // spectrum_test

⌨️ 快捷键说明

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