/* Mallat's Periodic Wavelet Transform pdwt( u[], N, J, h[], g[], L): [0] If J>0, then do [1] to [4] [1] Allocate temp[0]=0,...,temp[N-1]=0 [2] Compute pcqfilter( temp[], u[], N/2, h[], g[], L) [3] Compute pdwt( temp[], N/2, J-1, h[], g[], L ) [4] For i=0 to N-1, copy u[i] = temp[i] [5] Return Reconstruction of $N=2^JK$ Samples from Mallat's Periodic Wavelet Expansion ipdwt( u[], N, J, h[], g[], L): [0] If J>0, then do [1-] through [4] [1] Allocate temp[0]=0,...,temp[N-1]=0 [2] Compute ipdwt( u[], N/2, J-1, h[], g[], L ) [3] Compute ipcqfilter( temp[], u[], N/2, h[], g[], L ) [4] For i=0 to N-1, let u[i] = temp[i] [5] Return */ #include #include #include #include "pcqfilt.c" void pdwt(float u[], int N, int J, const float h[], const float g[], int L) { if(J>0) { float *temp; int i; temp = (float *)calloc(N, sizeof(float)); assert(temp); pcqfilter(temp, u, N/2, h,g,L); pdwt(temp, N/2, J-1, h,g,L); for(i=0;i0) { float *temp; int i; ipdwt(u, N/2, J-1, h,g,L); temp = (float *)calloc(N, sizeof(float)); assert(temp); ipcqfilter(temp, u, N/2, h,g,L); for(i=0;i