
Re: time and frequency marginals in the wavelet scalogram and energy
Posted:
Dec 11, 2013 3:23 PM


On Thursday, December 12, 2013 4:18:06 AM UTC+13, palmar wrote: > TideMan <mulgor@gmail.com> wrote in message <df595ab33e34425ebf0d9029db106673@googlegroups.com>... > > > On Wednesday, December 11, 2013 1:54:20 PM UTC+13, palmar wrote: > > > > Hi there: > > > > > > > > I have been looking for some matlab code to compute the time and frequency marginals in the wavelet scalogram. > > > > > > > > > > > > > > > > Moreover I was trying to to verify the socalled total energy condition of the scalogram, basically the energy of the scalogram should match the energy of the signal. > > > > > > > > > > > > > > > > I have done a double integral of the scalogram and the result doesnt match the energy of the signal, so I should be doing something wrong since the result should be wavelet dependent, and we should take that in account when calculating the energy of the signal. > > > > > > > > > > > > > > > > integral(integral(P(f,t))= sum(norm(s(t)).^2) > > > > > > > > > > > > > > > > P(f,t)= scalogram and s(t) signal > > > > > > > > > > > > > > > > Time marginal: > > > > > > > > integral(P(f,t)df=s(t).^2 > > > > > > > > Frequency marginal > > > > > > > > integral(P(f,t)dt=S(w).^2 > > > > > > > > Any ideas? > > > > > > > > Thanks > > > > > > BTW > > > Why do you use: > > > integral(integral(P(f,t))= sum(norm(s(t)).^2) > > > and not > > > integral(integral(P(f,t))= var(s) > > > which is Parseval's Law. > > > > Many many thanks TideMan > > > > Regarding the above you are right. Point taken. > > > > the nice link you sent with the ever important Torrece´s paper is very good but I can´t find in there any mentiion to the marginals calcultaion. > > > > There is a matlab function in http://tftb.nongnu.org/ that does the marginals, incidentally only for the Cohen Class timefrequency representations, not scalograms I gather. > > > > Still looking!!
I'm afraid I don't know what you mean by "marginals", but one way to reconstitute the signal into a set of time series for each level of frequency (scale)is with this snippet of code:
scale=scale(:); % Make sure it's a column vector denom=scale*ones(1,nt); ywrecon=real(wave)./sqrt(denom); ywrecon=ywrecon*sqrt(dt)*dj*factor;
where the variables are those in T&C's wavelet.m and factor is from Table 2 of their paper (dependent upon the mother wavelet). Once you have this matrix, ywrecon(nt,nf), i.e. a time series for each frequency interval, you can do: var(ywrecon) to get the frequency spectrum, or sum(var(ywrecon)) to get the total energy, or sum(ywrecon,2) to get s(t).

