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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? lifting.h

?? 小波提升格式的源代碼
?? H
?? 第 1 頁 / 共 2 頁
字號:

#include <stdio.h>

/**
   \file

   This file contains code to implement Lifting Scheme wavelets.
   Lifting Scheme wavelets are described in Wim Sweldens' tutorial
   paper <i>Building Your Own Wavelets at Home</i> which is available
   on the Web.

   Lifting Scheme wavelets are a conceptual extension of Haar wavelets.
   One of the disadvantages of Haar wavelets is the high frequency
   (largest) coefficient spectrum can miss detail (even to odd
   transitions, for example).  Lifting Scheme wavelets properly
   represent change in all coefficient spectrum.  This makes lifting
   scheme wavelets a better choice for some algorithms which do
   filtering based on the absolute standard deviation calculated on the
   high frequency coefficients.

 */


/**
   This class contains functions that are useful in debugging
   wavelet code.
 */
class debug {
   public:
   
   /**
      Print the result of a wavelet transform so that each coefficient
      spectrum is printed in its own block, showing the structure of
      the result.
   */
   void pr_ordered( const DoubleVec& coef)
   {
      const char *format = "%7.4f ";
      printf("{");
      int len = coef.size();
      int cnt = 0;
      int num_in_freq = 0;
      for (int i = 0; i < len; i++) {
         printf(format, coef[i]);
         cnt++;
         if (num_in_freq == 0) {
            printf("\n");
            cnt = 0;
            num_in_freq = 1;
         }
         else if (cnt == num_in_freq) {
            printf("\n");
            cnt = 0;
            num_in_freq = num_in_freq * 2;
         }
      }
      printf("}\n");
   } // pr_ordered

   /**
      Print wavelet transform intermediate results.

      The wavelet transform calculates a set of averages and
      coefficients (differences).  These are calculated recursively.
      For example, for a time series with size 32, the first iteration
      of the recursive wavelet transform will calculate a set of 16
      averages and 16 coefficients (differences).

      The next set of differences and avarages will be calculated at
      the start of the array (0..15) and will consist of 8 averages
      and 8 differences.

      This function is passed a value for <tt>N</tt> which is the size
      of the average and difference spectrum.  It prints each of these.

   */
   void pr_intermediate( DoubleVec& ts, int N)
   {
      const char* fmt = "%7.4f ";
      int i;
      int half = N >> 1;
      
      printf(" ave = ");
      for (i = 0; i < half; i++) {
         printf(fmt, ts[i] );
      }
      printf("\n");
      printf("coef = ");
      for (i = half; i < N; i++) {
         printf(fmt, ts[i] );
      }
      printf("\n");
   } // pr_intermediate


   /**
      Print the first N elements of <tt>ts</tt>.  If N is less than
      the length of <tt>ts</tt> the print a dividing mark (e.g., "|")
      and print the rest of the array.

      This function is useful for displaying the flow of the
      wavelet computation.
   */
   void pr_vector( DoubleVec& ts)
   {
     const int N = ts.size();
     const char* fmt = "%7.4f ";

     int i;
     for (i = 0; i < N; i++) {
       printf(fmt, ts[i] );
     }
     int len = ts.size();
     if (len != N) {
       printf(" | ");
       
       for (i = N; i < len; i++) {
	 printf(fmt, ts[i] );
       }
     }
     printf("\n");
   } // pr_vector

};  // debug





/**
   Support for four point polynomial interpolation, using the Lagrange
   formula.

 */
class interpolation {

   private:
   double fourPointTable[4][4];
   double twoPointTable[4][4];

   /**
     <p>
     The polynomial interpolation algorithm assumes that the known
     points are located at x-coordinates 0, 1,.. N-1.  An interpolated
     point is calculated at <b><i>x</i></b>, using N coefficients.  The
     polynomial coefficients for the point <b><i>x</i></b> can be 
     calculated staticly, using the Lagrange method.
     </p>

     @param x the x-coordinate of the interpolated point
     @param N the number of polynomial points.
     @param c[] an array for returning the coefficients

     */
  void lagrange( double x, int N, double c[] )
  {
    double num, denom;

    for (int i = 0; i < N; i++) {
      num = 1;
      denom = 1;
      for (int k = 0; k < N; k++) {
	if (i != k) {
	  num = num * (x - k);
	  denom = denom * (i - k);
	}
      } // for k
      c[i] = num / denom;
    } // for i
  } // lagrange


  /**
    <p>
    For a given N-point polynomial interpolation, fill the coefficient
    table, for points 0.5 ... (N-0.5).
    </p>

   */
  void fillTable( const int N, double table[4][4] )
  {
    double x;
    double n = N;
    int i = 0;

    for (x = 0.5; x < n; x = x + 1.0) {
      lagrange( x, N, table[i] );
      i++;
    }
  } // fillTable


  /**
    Print an N x N table polynomial coefficient table
   */
  void printTable( double table[4][4], int N)
  {
    printf("%d-point interpolation table:\n", N);
    double x = 0.5;
    for (int i = 0; i < N; i++) {
      printf("%4.2f: ", x);
      for (int j = 0; j < N; j++) {
	printf("%6.4f", table[i][j] );
	if (j < N-1)
	  printf(", ");
      }
      printf("\n");
      x = x + 1.0;
    }    
  }


  /**
    Print the 4-point and 2-point polynomial coefficient
    tables.
   */
  void printTables()
  {
    printTable( fourPointTable, 4 );
    printTable( twoPointTable, 2 );
    printf("\n");
  } // printTables


    /**
    <p>
    For the polynomial interpolation point x-coordinate 
    <b><i>x</i></b>, return the associated polynomial
    interpolation coefficients.
    </p>

    @param x the x-coordinate for the interpolated pont
    @param n the number of polynomial interpolation points
    @param c[] an array to return the polynomial coefficients
   */
  void getCoef( double x, int n, double c[])
  {
    int j = (int)x;

    if (j < 0 || j >= n) {
      printf("poly::getCoef: n = %d, bad x value = %f\n", n, x);
    }

    if (n == 2) {
      c[2] = 0.0;
      c[3] = 0.0;
    }
    else if (n != 4) {
      printf("poly::getCoef: bad value for N\n");
      return;
    }

    for (int i = 0; i < n; i++) {
      if (n == 4) {
	c[i] = fourPointTable[j][i];
      }
      else { // n == 2
	c[i] = twoPointTable[j][i];
      }
    }

  } // getCoef


   public:

   /**
      The interpolation class constructor calculates the coefficients for
      a four point polynomial interpolated at -0.5, 0.5, 1.5, 2.5 and 3.5.
   */
   interpolation() 
   {
    // Fill in the 4-point polynomial interplation table
    // for the points 0.5, 1.5, 2.5, 3.5
    fillTable( 4, fourPointTable );
    
    // Fill in the 2-point polynomial interpolation table
    // for 0.5 and 1.5
    fillTable( 2, twoPointTable );
   } // interpolation class constructor


  /**
    <p>
    Given four points at the x,y coordinates {0,d<sub>0</sub>},
    {1,d<sub>1</sub>}, {2,d<sub>2</sub>}, {3,d<sub>3</sub>}
    return the y-coordinate value for the polynomial interpolated
    point at <b><i>x</i></b>.
    </p>
    
    @param x the x-coordinate for the point to be interpolated
    @param N the number of interpolation points
    @param d[] an array containing the y-coordinate values for
           the known points (which are located at x-coordinates
	   0..N-1).
   */
  double interpPoint( double x, int N, double d[])
  {
    double c[4];
    double point = 0;
    
    int n = 4;
    if (N < 4)
      n = N;

    getCoef( x, n, c );

    if (n == 4) {
      point = c[0]*d[0] + c[1]*d[1] + c[2]*d[2] + c[3]*d[3]; 
    }
    else if (n == 2) {
      point = c[0]*d[0] + c[1]*d[1];
    }

    return point;
  } // interpPoint

};  // class interpolation






/**
   This class implements the wavelet Lifting Scheme with polynomial
   interpolation.

   This version of wavelets is based on Wim Sweldens' tutorial paper
   <i>Building Your Own Wavelets at Home</i>.  This tutorial was
   presented at SIGGraph.  The tutorial is available on the 
   Web.

   One of the attractive features of Lifting Scheme wavelets is that
   the transform and the inverse transform are exact mirrors of each other.
   To arrive at the inverse transform the order of the operations is
   reversed and subtraction and addition operations are exchanged.
   This allows a generic Lifting Scheme base class to be constructed,

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91成人国产精品| 国产精品久久久久久久裸模| 亚洲男人都懂的| 99久久国产综合精品色伊| 国产欧美一区二区在线| 国产91高潮流白浆在线麻豆 | 日韩专区欧美专区| 日韩欧美电影在线| 成人网男人的天堂| 亚洲人成精品久久久久久| 欧美视频你懂的| 精品日韩在线观看| 粗大黑人巨茎大战欧美成人| 亚洲欧洲制服丝袜| 在线视频中文字幕一区二区| 婷婷丁香激情综合| 久久一日本道色综合| av在线播放不卡| 亚洲aaa精品| 国产欧美综合在线观看第十页| 99久久精品国产毛片| 青青草视频一区| 国产精品久久久久一区| 日韩一区二区视频| 成人一区二区视频| 蜜臀久久99精品久久久久久9| 中文字幕第一区| 欧美日本高清视频在线观看| 国产99精品在线观看| 亚洲成人久久影院| 最新日韩在线视频| 精品免费一区二区三区| 欧美人狂配大交3d怪物一区| bt欧美亚洲午夜电影天堂| 麻豆国产精品视频| 午夜精品在线看| 亚洲婷婷综合色高清在线| wwwwww.欧美系列| 日韩欧美国产精品一区| 欧美日韩综合不卡| 欧美日韩精品一区二区三区| 色综合久久中文字幕| 国产成人免费视频一区| 六月丁香婷婷色狠狠久久| 亚洲国产精品自拍| 亚洲一区影音先锋| 亚洲免费观看视频| 亚洲精品精品亚洲| 亚洲欧美日韩国产综合| 亚洲欧美日韩国产手机在线| 国产精品国产三级国产三级人妇 | 久久爱www久久做| 麻豆精品在线视频| 国产剧情一区二区| 国产大片一区二区| 91美女福利视频| 欧洲在线/亚洲| 91精品国产91综合久久蜜臀| 日韩一二三区不卡| 久久久精品综合| 亚洲免费在线观看视频| 婷婷久久综合九色综合绿巨人 | 欧美精品亚洲二区| 555www色欧美视频| 国产欧美一区二区在线| 一区二区在线观看免费视频播放| 亚洲综合视频网| 捆绑紧缚一区二区三区视频| 成人高清在线视频| 欧美日韩国产中文| 国产欧美va欧美不卡在线| 亚洲午夜国产一区99re久久| 精品亚洲国产成人av制服丝袜| 成人一区二区三区在线观看| 欧美日韩国产小视频| 国产欧美日产一区| 日韩专区一卡二卡| 99这里只有久久精品视频| 4438x成人网最大色成网站| 中文字幕欧美国产| 丝袜美腿亚洲一区二区图片| jlzzjlzz欧美大全| 国产人伦精品一区二区| 美女视频网站黄色亚洲| 91成人免费在线视频| 最好看的中文字幕久久| 高清成人免费视频| 91精品国产色综合久久久蜜香臀| 中文字幕中文字幕在线一区 | 天天操天天色综合| 久久国产麻豆精品| 国产91精品精华液一区二区三区 | 免费成人在线网站| 欧美午夜精品一区二区三区| 国产日韩欧美精品电影三级在线| 亚洲一区二区欧美日韩| 播五月开心婷婷综合| 欧美岛国在线观看| 奇米精品一区二区三区在线观看一| 成人一级黄色片| 国产精品丝袜在线| 成人激情动漫在线观看| 久久精品视频在线看| 性久久久久久久| 欧洲一区二区三区在线| 综合分类小说区另类春色亚洲小说欧美 | 欧洲色大大久久| 1024成人网| 色域天天综合网| 亚洲高清在线精品| 欧美日韩一区久久| 亚洲欧美日韩成人高清在线一区| 不卡的av网站| 亚洲电影在线免费观看| 欧美日韩情趣电影| 免费在线成人网| 久久久噜噜噜久久人人看| 风流少妇一区二区| 一区二区国产视频| 日韩三级免费观看| 成人午夜伦理影院| 亚洲中国最大av网站| 欧美一区二区三区婷婷月色| 麻豆国产欧美一区二区三区| 国产精品―色哟哟| 欧美午夜电影网| 国产成人免费在线观看| 亚洲综合色丁香婷婷六月图片| 97久久人人超碰| 免费看欧美女人艹b| 欧美体内she精视频| 蜜臀av一区二区在线观看| 欧美国产国产综合| 日本精品一级二级| 国产精品性做久久久久久| 一级做a爱片久久| 国产日韩欧美一区二区三区乱码 | 狠狠久久亚洲欧美| 高清成人在线观看| 日韩成人精品在线观看| 1区2区3区国产精品| 精品国产乱码久久久久久免费| 欧美中文字幕一二三区视频| 国产成人高清视频| 激情另类小说区图片区视频区| 中文字幕一区免费在线观看| 久久久国产一区二区三区四区小说 | 欧美激情艳妇裸体舞| 56国语精品自产拍在线观看| 91国产免费观看| 91色九色蝌蚪| 一本大道av伊人久久综合| 高清在线成人网| 国产suv精品一区二区883| 国产福利一区在线| 国产一区二区毛片| 国产精品影视在线| 国产乱淫av一区二区三区| 国产精品18久久久久久久久| 麻豆精品久久久| 国产在线播放一区| 成人性生交大片免费看在线播放 | 亚洲精品在线三区| 久久综合久久久久88| 国产欧美va欧美不卡在线| 中文字幕成人av| 一区二区三区不卡视频在线观看| 综合网在线视频| 亚洲gay无套男同| 青青草国产精品亚洲专区无| 国产在线精品一区二区| 丁香激情综合国产| 在线免费观看不卡av| 欧美色欧美亚洲另类二区| 91精品国产综合久久久久久久| 日韩欧美电影一区| 国产亚洲欧美日韩日本| 夜夜精品浪潮av一区二区三区| 亚洲一区免费观看| 国内精品在线播放| 欧美性欧美巨大黑白大战| 欧美变态tickle挠乳网站| 自拍偷拍欧美激情| 久久精品免费看| 色综合久久九月婷婷色综合| 日韩一区二区影院| 亚洲精品欧美激情| 国产**成人网毛片九色 | 污片在线观看一区二区| 国产成人免费视频网站高清观看视频 | 日韩一区二区三区av| 国产精品视频一二| 激情都市一区二区| 777午夜精品视频在线播放| 亚洲激情av在线| 国产91精品久久久久久久网曝门| 欧美电影一区二区| 亚洲国产va精品久久久不卡综合| www.亚洲免费av| 欧美国产国产综合|