Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Inverse continous wavelet transfrom
Date: Tue, 9 Feb 2010 18:04:05 +0000 (UTC)
Organization: The MathWorks Inc
Lines: 53
Message-ID: <hks82l$2n$1@fred.mathworks.com>
References: <hkp9pp$5ou$1@fred.mathworks.com> <hkpb4s$t28$1@fred.mathworks.com> <hks2s7$rcj$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1265738645 87 172.30.248.35 (9 Feb 2010 18:04:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 9 Feb 2010 18:04:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1597503
Xref: news.mathworks.com comp.soft-sys.matlab:605840


"Jetson Ronald" <ajetsonronald@yahoo.co.in> wrote in message <hks2s7$rcj$1@fred.mathworks.com>...
> "Wayne King" <wmkingty@gmail.com> wrote in message <hkpb4s$t28$1@fred.mathworks.com>...
> > "Jetson Ronald" <ajetsonronald@yahoo.co.in> wrote in message <hkp9pp$5ou$1@fred.mathworks.com>...
> > > Hello
> > > I am analyzing 1-D Non stationary signal. I have used  'db4' continuous wavelet for my analysis. I have the Time-frequency plot now. I would like to extract a range of frequencies and convert them to time domain using inverse wavelet transform. But i could not do inverse wavelet transform for the continuous wavelet transform. Kindly help me out!!
> > > Regards
> > > Jet
> > 
> > Hi Jet, are you sure you need to use the CWT to analyze your signal and not the critically-sampled wavelet transform (dwt) or the wavelet packet transform? Both the dwt and discrete wavelet packet transfrorms in MATLAB have reconstruction routines. If you still feel you need to use the CWT in your analysis, then there is a least one file exchange submission for you to consider:
> > 
> > http://www.mathworks.com/matlabcentral/fileexchange/20821-continuous-wavelet-transform-and-inverse
> > 
> > Hope that helps,
> > Wayne
> 
> Thank you Wayne for the information. 
> I can use dwt also here i face two problems 1) I could not do the time frequency plot because my out put is cA and cD. 2) while reconstruction(idwt) I get my full signal back which I do not want . I need to get only a range of frequencies(scales). 
> Kindly help me out.
> Thank you..

Hi, you can use wavedec() to give you a wavelet decomposition to a desired level. Then you can obtain the detail and approximation coefficients corresponding to your desired level with detcoef and appcoef. For example:

load noisdopp;
dwtmode('per');
[C,L] = wavedec(noisdopp,8,'db4');
% Get all the detail coefficients and store in a cell array
Dcell = detcoef(C,L,'cells');
%finest level detail  approx. [Fs/4, Fs/2] is in Dcell{1}
D1 = Dcell{1}; 
% Next level detail approx. [Fs/8, Fs/4] is in Dcell{2}
plot(Dcell{2})

and so on. If you want a finer frequency decomposition use the wavelet packet decomposition wpdec()

T = wpdec(noisdopp,8,'db4');

Note: the wavelet packet transform decomposes the signal into the doublets (j,p) where j is the depth index and p is the number of nodes at the same depth to its left. 
You can plot the wavelet packet tree and see this ordering:

plot(T)

Beginning with the node (0,0) you can also simply order these nodes: 0,1,2,3,4,5,6, etc. This is the index you need to extract the wavelet packet coefficients. The doublet (0,0) is zero, (1,0) is 1, (1,1) is 2 etc.

You can retrieve this information with depo2ind()

N = depo2ind(2,[2 3]);  % get the index for the (2,3) node for a tree of order 2&#8212;the % wavelet packet transform yields a binary tree! 

% N equals 6
wp_coefs =  wpcoef(T,6);  % Retrieve the wavelet packet coefficients for the node 
% (2,3) 

Hope that helps,
Wayne