Re: Mathematica Wavelet-Explorer Question: Inverse Wavelet Transform on a subset of the coefficients
- To: mathgroup at smc.vnet.net
- Subject: [mg23023] Re: Mathematica Wavelet-Explorer Question: Inverse Wavelet Transform on a subset of the coefficients
- From: Oscar Stiffelman <oscar at internap.com>
- Date: Tue, 11 Apr 2000 23:18:40 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
I think I found the answer. Below, I construct a table comparing the difference between the two approaches. compareIWT[wt_, filter_, numDropped_] := ( wt1 = MapIndexed[(If[Length[wt] - First[#2] < numDropped, 0*#1, #1]) &, wt]; wt2 = Take[wt, Length[wt] - numDropped]; iwt1 = InverseWaveletTransform[wt1, filter]; iwt2 = InverseWaveletTransform[wt2, filter]; Mean[iwt2]/Mean[iwt1] ) Table[compareIWT[wt4, D4, i], {i, 1, 10}] {1.41421, 2., 2.82843, 4., 5.65685, 8., 11.3137, 16., 22.6274, 32.} This is just (sqrt(2))^numDropped. I guess I will just use this scaling factor-- I assume it will work for other filter lengths and types of filters. -- Oscar On Mon, 10 Apr 2000, Oscar Stiffelman wrote: > Hi, > > I am using the Wavelet Explorer package in Mathematica, and I noticed > something somewhat peculiar. If I perform an inverse wavelet transform on > a subset of the coefficients, the mean is shifted up, but if I instead > zero out those coefficients (rather than truncating), then the mean > remains the same: > > In[1]:= <<Wavelets`Wavelets` > > In[2]:= randomWalk = NestList[(# + Random[Real, {-1, 1}])&, 0, 1023]; > > In[3]:= wt = WaveletTransform[randomWalk, DaubechiesFilter[4]]; > > In[4]:= Length /@ wt > > Out[4]= {4, 4, 8, 16, 32, 64, 128, 256, 512} > > In[5]:= iwt1 = InverseWaveletTransform[wt*{1,1,1,1,1,1,1,0,0}, > DaubechiesFilter[4]]; > > > In[6]:= Mean[iwt1] > > Out[6]= 11.9505 > > In[7]:= Mean[randomWalk] > > Out[7]= 11.9505 > > In[8]:= iwt2 = InverseWaveletTransform[Take[wt, Length[wt]-2], > DaubechiesFilter[4]]; > > In[9]:= Mean[iwt2] > > Out[9]= 23.9011 > > > > Can anybody explain this? The curves are basically the same shape > (but at different resolutions). How can I consistently scale the > truncated inverse wavelet transform so that it will always be correct? > > Thanks, > > Oscar Stiffelman > >