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

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

?? 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,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品久久久久香蕉网| 91精品国产手机| 色综合久久九月婷婷色综合| 99re这里只有精品首页| 色88888久久久久久影院按摩| 欧美日韩中文字幕一区二区| 欧美一级艳片视频免费观看| 2022国产精品视频| 亚洲在线中文字幕| 老司机免费视频一区二区三区| 国产成人免费视频精品含羞草妖精 | 亚洲人成在线播放网站岛国| 成人黄色在线视频| 麻豆91免费观看| 丁香一区二区三区| 欧美一区二区三区免费视频| 国产欧美精品一区二区三区四区| 亚洲乱码国产乱码精品精小说 | 色婷婷久久一区二区三区麻豆| 91精品国产91久久综合桃花 | 欧美日韩视频在线一区二区| 2023国产精品| 蜜臀av亚洲一区中文字幕| 欧美艳星brazzers| 中文字幕va一区二区三区| 日日摸夜夜添夜夜添精品视频| 日本麻豆一区二区三区视频| 国产呦萝稀缺另类资源| 欧美午夜影院一区| 一区二区三区成人| gogo大胆日本视频一区| 国产精品视频一二| av网站免费线看精品| 日本一二三不卡| 99久久国产综合精品色伊| 国产免费观看久久| 成人va在线观看| 中文字幕一区二区不卡| 91老师国产黑色丝袜在线| 亚洲欧美中日韩| 色婷婷久久一区二区三区麻豆| 亚洲欧洲一区二区三区| 色婷婷久久综合| 亚洲第一会所有码转帖| 欧美videos大乳护士334| 韩国三级在线一区| 自拍偷在线精品自拍偷无码专区| 色又黄又爽网站www久久| 日韩激情av在线| 国产精品理论片| 91精品国产综合久久福利| 九九九精品视频| 夜夜嗨av一区二区三区网页| 欧美精品1区2区3区| 国产成人精品亚洲日本在线桃色| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 91久久精品一区二区三| 经典三级视频一区| 亚洲一卡二卡三卡四卡无卡久久 | 成人免费毛片aaaaa**| 亚洲天堂免费看| 久久久精品综合| 日韩欧美一级特黄在线播放| 大白屁股一区二区视频| 国精产品一区一区三区mba视频| 一区二区三区在线看| 国产精品美女久久福利网站| 欧美精品一区二区三区很污很色的| 91免费视频观看| 国产1区2区3区精品美女| 日本欧美久久久久免费播放网| 一区二区三区日韩欧美精品| 久久精品夜夜夜夜久久| 精品国内片67194| 精品久久人人做人人爰| 日韩欧美一区在线观看| 欧美一级片在线看| 欧美va亚洲va在线观看蝴蝶网| 欧美猛男男办公室激情| 欧美日韩视频在线第一区| 91九色02白丝porn| 欧美性大战久久| 91精品欧美久久久久久动漫| 7777精品伊人久久久大香线蕉的 | av午夜精品一区二区三区| 国产aⅴ综合色| aaa亚洲精品一二三区| 色乱码一区二区三区88| 欧美性色综合网| 精品少妇一区二区三区日产乱码 | 99久久99久久免费精品蜜臀| 国产成人精品免费看| 国产成a人亚洲精| 成人亚洲一区二区一| 国产99精品国产| 成人av电影免费在线播放| 成人精品电影在线观看| 99re这里只有精品6| 欧美精品高清视频| 精品国产乱码久久久久久夜甘婷婷 | 国产网站一区二区| 亚洲欧美怡红院| 丝袜美腿亚洲综合| 国产精品一区二区三区四区| 99久久婷婷国产精品综合| 成人app软件下载大全免费| 欧美在线观看视频在线| 日韩精品一区国产麻豆| 亚洲人精品午夜| 国内成人精品2018免费看| 欧洲人成人精品| 国产日韩成人精品| 视频一区中文字幕| 99精品视频在线播放观看| 欧美变态口味重另类| 亚洲中国最大av网站| 国产伦精品一区二区三区在线观看 | 在线视频一区二区免费| 精品国精品国产| 三级影片在线观看欧美日韩一区二区| 成人综合日日夜夜| 日韩女优av电影| 日韩电影在线观看电影| 99久久精品免费看| 日韩亚洲欧美综合| 婷婷六月综合网| 欧美性生活大片视频| 一区二区三区精品| 在线亚洲+欧美+日本专区| 亚洲欧美偷拍另类a∨色屁股| 国产精品99久久久久久久女警| 成人午夜电影网站| 91精品国产综合久久精品麻豆| 亚洲天堂av老司机| 91亚洲精品乱码久久久久久蜜桃 | 麻豆精品视频在线观看免费 | 亚洲高清免费视频| 欧美日韩中文一区| 美女在线观看视频一区二区| 欧美美女一区二区| 麻豆91精品91久久久的内涵| 欧美一级黄色片| 国产成人精品影视| 亚洲精品日韩综合观看成人91| 欧美视频中文一区二区三区在线观看| 亚洲精品欧美二区三区中文字幕| 91小视频免费观看| 热久久免费视频| 国产精品毛片久久久久久久| 91福利在线观看| 国产一区二区成人久久免费影院| 亚洲国产日韩一区二区| 精品国产精品一区二区夜夜嗨| 国产成人亚洲综合a∨婷婷图片| 亚洲蜜臀av乱码久久精品蜜桃| 欧美日韩国产影片| 成人久久久精品乱码一区二区三区| 亚洲人成网站色在线观看| 日韩午夜激情视频| 色婷婷久久综合| 国产成人精品免费在线| 午夜国产精品一区| 亚洲精品国产第一综合99久久| 欧美tickling网站挠脚心| 91激情在线视频| 成人免费观看视频| 国模娜娜一区二区三区| 婷婷开心激情综合| 亚洲第一精品在线| 一区二区三国产精华液| 1024国产精品| 中文字幕在线一区免费| 国产欧美精品国产国产专区| 精品1区2区在线观看| 欧美一区二区视频在线观看2020 | 午夜精品久久久久影视| 亚洲视频在线观看三级| 亚洲女与黑人做爰| 亚洲精品菠萝久久久久久久| 中文字幕精品一区| 中文字幕一区二区三区精华液 | 欧美一级免费大片| 4hu四虎永久在线影院成人| 欧美男生操女生| 日韩片之四级片| 欧美激情一区二区三区蜜桃视频| 国产亚洲欧洲一区高清在线观看| 久久久91精品国产一区二区精品| 精品国产免费一区二区三区香蕉| 国产欧美日韩另类视频免费观看| 久久综合色天天久久综合图片| 久久久蜜臀国产一区二区| 国产精品色呦呦| 午夜免费久久看| 国产成人av一区二区| 欧洲精品一区二区| 久久日韩精品一区二区五区| 亚洲免费在线播放| 日韩一区二区三区在线观看| 久久精品一区二区三区av|