1 // Author: Aime' Fournier
2 // E-mail: fournier@ucar.edu
4 #include <stdio.h> // for printf() ...
7 void dwtai2( // 2D version of dwtai()
8 real
*u
, // input/output array of size ia[0][0]*ia[1][0]
9 real
*s
, // scratch array of size max(ia[0][0],ia[1][0])
10 int *iv
[2], // v-space lengths from DWTAPartition()
11 int *ia
[2], // w-space starts from DWTAPartition()
12 int lm
, // maximum level
13 const pqf
*h
, // low-pass filter
14 const pqf
*g
) { // high-pass filter
15 extern real
l2norm(); // l2 norm
18 lx
=ia
[1][0]; // padded x-length (nu. columns)
19 ly
=ia
[0][0]; // padded y-length (nu. rows)
20 //printf("dwtai2: norm=%9.2e\n",l2norm(u,lx,iv[0][0],iv[1][0]));
21 for( k
=0; k
<iv
[0][0]*lx
; k
+=lx
) {
22 // printf("dwtai2: norm[%d,0:%d]=%9.2e\n",k/lx,iv[1][0]-1,l2norm(u+k,lx,1,iv[1][0]));
23 dwtai(u
+k
,s
,iv
[1],ia
[1],lm
,h
,g
);
24 // printf("dwtai2: norm[%d,0:%d]=%9.2e\n",k/lx, lx-1,l2norm(u+k,lx,1, lx));
26 xpi2(u
,ly
,lx
,sizeof(real
));
27 for( k
=0; k
< ly
*lx
; k
+=ly
) {
28 // printf("dwtai2: norm[0:%d,%d]=%9.2e\n",iv[0][0]-1,k/ly,l2norm(u+k,ly,1,iv[0][0]));
29 dwtai(u
+k
,s
,iv
[0],ia
[0],lm
,h
,g
);
30 // printf("dwtai2: norm[0:%d,%d]=%9.2e\n", ly-1,k/ly,l2norm(u+k,ly,1, ly));
32 xpi2(u
,lx
,ly
,sizeof(real
));
33 //printf("dwtai2: norm=%9.2e\n",l2norm(u,lx,ly,lx));