updated top-level README and version_decl for V4.5 (#1847)
[WRF.git] / var / external / wavelet / DWTAPartition.c
blob99a95a2c03f34837a0a6c5e80711560cfdefaf79
1 // Author: Aime' Fournier
2 // E-mail: fournier@ucar.edu
4 #include "qf.h" // for IFH(), pqf ...
6 void DWTAPartition( // create indexes for dwtai()
7 int *iv, // in iv[0]: data length/out iv[1:lm]: v-space lengths
8 int *iw, // out iw[0:lm]: w-space lengths
9 int *ia, // out: ia[0] transform length; ia[1:lm] w starts
10 int lm, // maximum level
11 const pqf *h, // low-pass filter
12 const pqf *g) { // high-pass filter
13 int j,lg,lh; // index; filter lengths
15 lh=h->omega-h->alpha+1;
16 lg=g->omega-g->alpha+1;
17 for( j=1; j<=lm; j++ ) {
18 iv[j]=IFH(iv[j-1]+lh);
19 iw[j]=IFH(iv[j-1]+lg);
21 iw[0]=0; // no w space at level 0
22 ia[lm]=iv[lm]; // start of largest-scale w
23 for( j=lm; j>=1; j-- )
24 ia[j-1]=ia[j]+iw[j];