Talk:Cohen–Daubechies–Feauveau wavelet

Correct last digits and different normalizations
Hmm... I got her by clicking on "Discussion when I was Visitiong the Cohen-Daubechies-Feauveau wavelet page, and I get an error message from Wikipedia saying they dont have an article???

Hey men, the filter coeffs are incorrect; if inverted, it results in a 21/19-tap filter. The correct one with (1;1) normalization

--Frigo 10:39, 12 February 2006 (UTC)

I have included the correct version, with (1;1) normalization, and with inverses used in interleaved filtering (we interleave the lowpass and highpass coeffs, THEN we filter) but haven't removed the previous, despite that it is wrong; its inverse is a 21/19-tap filter (as I described above). Should it be removed? Frigo 18:51, 7 March 2006 (UTC)


 * Hi, Frigo, nice that You found Your way here. Sometimes, in the last year more often then acceptable, the wiki-servers have grave problems. Especially for people logged in and trying to edit. Without login, the read-only version is on different servers and should have better stability.
 * I will check Your concerns, the coeffient table was just pasted. Can You tell how You arrived at a 21/19-tap filter? Also, the importance of "interleaved version" needs explaination.--LutzL 08:39, 8 March 2006 (UTC) llehmann at wavelet org


 * Actually, those coefficients above are wrong, since the synthesis filters are just the analysis filters, multiplied by two. But 9/7 is not orthogonal. The coefficients in the old version of the article were right, and You repeated them, adding two wrong columns. Now they should be correct up to rounding and sufficiently explained to be above all doubts.--LutzL 15:54, 8 March 2006 (UTC)

Hi. The wrong version differed two coeff from the right version:

Also, I tried to invert it with gauss-jordan decomposition and with a extended cholesky decomposition (don't ask...), with matrix sizes of 64x64, 128x128, and if I remember correctly, 100x100. In every cases, the wrong version caused a "leakage", modifying the 0 coeffs of the synthesis filters. I became aware of this flaw, so I begin to search for the right coefficients of CDF 9/7. I found it in FBI's WSQ specification, with (sqrt(2),sqrt(2)) normalization (pdf file, page 49):

http://citeseer.ist.psu.edu/98590.html

I use this code, and it works 100% good with the filters I specified (the synthesis filters aren't the analysis ones multiplied with 2, I checked it.

// a_l_len=9,a_h_len=7,a_l_shift=0,a_h_shift=1

// s_l_len=9,s_h_len=7,s_l_shift=1,s_h_shift=0

void wavelet_forward_symmetric_symmetric(double input[],double temp[],int n,wavelet &w){ int x,y,h,i,j; double s;

for(x=0;x<(n>>1);x++){ h=(x<<1)+w.a_l_shift; s=w.a_l[w.a_l_len>>1]*input[h]; for(y=1;y<=(w.a_l_len>>1);y++){ i=abs(h+y); j=abs(h-y); if(i>=(n<<1)-2)i%=(n<<1)-2; if(j>=(n<<1)-2)j%=(n<<1)-2; if(i>=n)i=(n<<1)-2-i; if(j>=n)j=(n<<1)-2-j; s+=w.a_l[(w.a_l_len>>1)+y]*(input[i]+input[j]);}; temp[x]=s;};

for(x=0;x<(n>>1);x++){ h=(x<<1)+w.a_h_shift; s=w.a_h[w.a_h_len>>1]*input[h]; for(y=1;y<=(w.a_h_len>>1);y++){ i=abs(h+y); j=abs(h-y); if(i>=(n<<1)-2)i%=(n<<1)-2; if(j>=(n<<1)-2)j%=(n<<1)-2; if(i>=n)i=(n<<1)-2-i; if(j>=n)j=(n<<1)-2-j; s+=w.a_h[(w.a_h_len>>1)+y]*(input[i]+input[j]);}; temp[x+(n>>1)]=s;};

for(x=0;x>1);x++){ temp[(x<<1)+w.a_l_shift]=input[x];         // was 0. now a_l_shift. is this good? temp[(x<<1)+w.a_h_shift]=input[x+(n>>1)];}; // was 1. now a_h_shift. is this good?

for(x=0;x<(n>>1);x++){ h=(x<<1)+w.s_l_shift; s=w.s_l[w.s_l_len>>1]*temp[h]; for(y=1;y<=(w.s_l_len>>1);y++){ i=abs(h+y); j=abs(h-y); if(i>=(n<<1)-2)i%=(n<<1)-2; if(j>=(n<<1)-2)j%=(n<<1)-2; if(i>=n)i=(n<<1)-2-i; if(j>=n)j=(n<<1)-2-j; s+=w.s_l[(w.s_l_len>>1)+y]*(temp[i]+temp[j]);}; input[(x<<1)+w.s_l_shift]=s;};

for(x=0;x<(n>>1);x++){ h=(x<<1)+w.s_h_shift; s=w.s_h[w.s_h_len>>1]*temp[h]; for(y=1;y<=(w.s_h_len>>1);y++){ i=abs(h+y); j=abs(h-y); if(i>=(n<<1)-2)i%=(n<<1)-2; if(j>=(n<<1)-2)j%=(n<<1)-2; if(i>=n)i=(n<<1)-2-i; if(j>=n)j=(n<<1)-2-j; s+=w.s_h[(w.s_h_len>>1)+y]*(temp[i]+temp[j]);}; input[(x<<1)+w.s_h_shift]=s;}; }; Frigo 23:57, 8 March 2006 (UTC)


 * Hi, I gave the algorithm to compute the coefficients to any precision already in the article. One only has to numerically compute the real root of a polynomial of degree 3. The table was directly computed this way in the CAS Magma. I will repeat it next week with a little more precision.--LutzL 20:49, 10 March 2006 (UTC)

Hello. I have a question: which form of the filters is the correct form, the synthesis lowpass being longer than the synthesis highpass, or vice-versa? Most paper I have seen assumed the synthesis lowpass filter is longer. A long time ago I tried both, and somewhy I choose the lowpass filter to be longer. I don't remember why I chose it and how I have implemented the other... (Perhaps I felt it is more elegant =), f.e. in the case of interpolating filters (like 5/3), the analysis and synthesis filters are equal, with sqrt(2) normalization) Anyway, I thought it is called interleaved filtering, but I'm not sure.. And what is the most appropiate normalization for displaying on wiki? I think it would be (1;1) and/or (sqrt(2);sqrt(2)). Frigo 23:59, 10 March 2006 (UTC)


 * Hi, for Your convinience the filters in an almost unpractical precision

I don't know a final answer to Your questions. In image processing it is preferable if the synthesis scaling filter belongs to the smoother scaling function. The errors while quantizing may be bigger with the "bumpier" analysis fitler, but the reconstructed image looks smooth. For 97 I don't know ad hoc the smoothness of both scaling functions, but for 53 resp bior-4,4, the shorter sequence belongs to the spline of order 3, which is as smooth as it can get. And no, You are wrong, the synthesis filters in 53 have also a differing length, as explained and computed in the article. For the normalization, well there has to be a factor of 1/2 somewhere, but the exact location is not important for bitplane coding etc.--LutzL 12:07, 11 March 2006 (UTC)

I noticed something strange: if I multiply the analysis highpass coefficients with -1, the synthesis lowpass filter becomes a highpass filter, and vice-versa. (basically, every 2nd of their coeffs gets multiplied by -1). So the lowpass filter becomes the shorter of the two, but it can't be better than the longer one, since we only multiplied the an. highpass coeffs with -1.

so, in the case of 5/3 filter:

original: (synthesis highpass first, lowpass second in interleave)

-0.2500000000000000, 0.5000000000000000,  1.5000000000000000,  0.5000000000000000, -0.2500000000000000,

and

-0.5000000000000000, 1.0000000000000000, -0.5000000000000000,

"new": (synthesis lowpass first, highpass second in interleave)

0.2500000000000000, 0.5000000000000000, -1.5000000000000000,  0.5000000000000000,  0.2500000000000000,

and

0.5000000000000000, 1.0000000000000000,  0.5000000000000000,

(And I obtain the synthesis filters via matrix inversion; analysis lowpass filter is first, analysis highpass filter is second in interleave; so I can't be wrong)

---

I noticed that the reconstruction of only the LL subband is smoother with an analysis 9/7 (L/H) filter (with 9/3 or 3/9 synthesis filter), than with an analysis 9/3 (L/H) filter (with 9/7 or 7/9 synthesis filter), the latter is full of "diamond" shape.

---

And a question: how do you reconstruct? Upsample and filter and add, or interleave and filter?

Frigo 00:19, 15 March 2006 (UTC)

The meaning of "Interleave"
Interleave and filter is not going to work. If I had to implement it efficiently, I would use lifting. But for the exposition here the first variant has to be applied, as it is explained in Fast wavelet transform.--LutzL 09:54, 16 March 2006 (UTC)

I see, Hilbert space.

But interleaved filtering can be deducted from upsampling + filtering + add, because of the add operation. And because we insert 0s, the synthesis filters can be trivially "transformed" between interleaved filtering and upsampled filtering by exchanging every 2nd coefficient of the synthesis lowpass and highpass filters.

It works. When I multiply my interleaved filtering's transform matrices, it results in a unitary matrix, when I decompose + recompose Lena or Baboon without modifying anything, it results in the original image. So it works. One can easily see this if he inverts a wavelet transform matrix.

Frigo 17:50, 17 March 2006 (UTC)


 * Hi, I added some headlines, so that one can edit in pieces. Of course You are right, I didn't understand the operation behind the word. If You check the "reconstruction" section in the "fast transform" piece, the abstract formula is exactly that, upsample, filter, add. By the way, the whole wavelet thing here is a total mess. The Discrete wavelet transform has less mathematical contents than the fast transform, lifting is still missing. The continuous wavelet transform is both mentioned in wavelet series, where it doesn't belong, and in wavelet, where it has too much detail, in fact more than in its own article. The latter should be a link to wavelet theory, which should be an overview with hardly more than short explainations of the list of wavelet-related transforms and the lists already present, commons:wavelet and commons:Category:wavelets are better organized;-). "discrete wavelet" should be an overview as well, linking together MRA, FWT, complex extension of both, the different classes ("haar", "daubechies", "coiflet", "biorthogonal") etc. Its all here, but in bad shape.--LutzL 19:05, 17 March 2006 (UTC)


 * Hello, it was a while :) Yeah, synthesis filters are a little confusing, since they can be applied two ways (and there are two forms of them, respectively). At analysis/decomposition, you simply filter the data with a lowpass filter (phase 0) and a highpass filter (phase 1). But at synthesis/recomposition, you can either go with the upsample-filter-add, or the interleave-filter methods. The first one inserts 0s into both the coarse and the detail subbands, filters them with a lowpass and highpass filter, and adds them up. The second one interleaves the coarse and detail subbands, and filters it with a lowpass filter (phase 1) and a highpass filter (phase 0). The two methods, of course, produces the same result, and their filter pairs can be calculated from the other pair. Unfortunately the entire scientific literature regarding wavelets are excessively mystified, even at such simple things (At the moment I'm stuck with the directional filter bank part of the contourlet transform. Now, that's some difficult stuff). Frigo 21:34, 20 August 2007 (UTC)

something wrong in $$Q_2(x)$$
The expression for $$Q_2(X)$$ is wrong and does not satisfy the identity $$(1-X/2)^A \, Q_A(X)+(X/2)^A\,Q_A(2-X)=1$$. This identity implies $$Q_A(0)=1$$ and $$Q_A(1)=2^{A-1}$$ so that $$Q_2(1)=2$$. The correct expression is $$Q_2(X)=1+2(X/2)=1+X$$. —Preceding unsigned comment added by 71.36.189.68 (talk) 18:10, 4 February 2010 (UTC)


 * Yes, you are right and it is a pity that it took over a year to correct. Must have flown under my radar at the time. (Not to mention that it was my error to begin with, 9/7 was done with CAS, why not 5/3?) Hopefully, not to many students were confused by WP-dependend teachers.--LutzL (talk) 11:52, 10 May 2011 (UTC)

External links modified
Hello fellow Wikipedians,

I have just modified one external link on Cohen–Daubechies–Feauveau wavelet. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
 * Added archive https://web.archive.org/web/20120305164605/http://www.embl.de/~gpau/misc/dwt97.c to http://faculty.gvsu.edu/aboufade/web/wavelets/student_work/EF/how-works.html

When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.

Cheers.— InternetArchiveBot  (Report bug) 07:41, 10 August 2017 (UTC)

Figure description
What wavelet is used in the example transform? 9/7 irreversible?

Lahebo (talk) 20:20, 8 February 2018 (UTC)