3
$\begingroup$

I want to implement a Time-Freqency analysis by wavelet packets. I don't know what level and sampling rate should I use. I've tried different value for level(3,4,5,6,). but I couldn't get an accurate frequency identification. here is my little scrip and results, hope one can say whats the problem, Thanks in advance.

f=30;N=300;                            %df:final time,N:segments
t=linspace(0,df,N); dt=t(3)-t(2);      % dt: time intervals
fs=ceil(inv(t(2)-t(1)));              % fs: sampling freq
fn=[0.4 0.6 1.0];E=[0.03 0.05 0.1];   %fn:freq, E:damping
 A=[1.0 2.0 3.0];wn=2*pi.*fn;a=E.*wn;wd=wn.*sqrt(1-E.^2);  % A:Amplitude.
y=A(1)*exp(-a(1)*t).*sin(wd(1)*t)+A(2)*exp(-a(2)*t).*...
      sin(wd(2)*t)+A(3)*exp(-a(3)*t).*sin(wd(3)*t);
level = 3;
wpt = wpdec(y,level,'coif5');
[Spec,Time,Freq] = wpspectrum(wpt,fs,'plot');    

here are result for Level 3,4,5,6 decompositions.
enter image description here
as you can see in the pictures, It doesn't show fn=[0.4 0.6 1.0] values accurately. Then I have run another little scrip to see which frequencies,WP identified.

absSpec=abs(Spec);
modI=max(absSpec');          % get  max |Spec| correspond to freq of signal
modI=modI/max(modI);         % normalize each column 0-1
fig=1;fig=fig+1;figure(fig)
Freq=fliplr(Freq);            % the frequency order must be reverse. idk why, i fount-
                              % out by trail and error. very strange but true.
plot(Freq,modI)              % Plot all modes(freq).
grid on

Here is the frequency plot for level 3,4,5,6.
enter image description here
As you can see it doesn't show [0.4,0.6,1]Hz frequencies at level 3,4,5. but in level 6 it shows something(why?). but not accurate though. it represent a range of frequency specially for 0.6 and 1 Hz.(the peak is flat) why this is happening?
moreover, I got the plot for level 8,9,10,11 too. in here I can see a better results, but still it represent 2 or more peaks for each frequencies(why?)(plot is small here so you may barely see it).
enter image description here
so my questions are:

  1. what sampling rate($f_s$)should i select in this case?(now it's 10)
  2. why frequency plot doesn't show any result in level 3,4,5?
  3. It shows some result in level 6 for all frequencies. but what is its range? I can understand it is representing a range of frequencies for every components(0.4,0.6,1Hz) of my signal. Afterward, what is the error for detected range in this level(or any level)?
  4. In level 8,9,10,11 frequency plot has a narrower range so its more accurate, but what is other smaller peaks around detected frequencies?
  5. for a time series with size of M what is WPT computational complexity in terms of big O(), I thought its faster than CWT but it is definitely not (I just can feel it by Tic_Toc function). so would anyone compare WPT with CWT in computational complexity (big O) terms?

Thanks in Advance for your ideas and answers.

$\endgroup$
  • $\begingroup$ If you want frequency accuracy, you need something else than DWT or PacketWT, which seem to have dyadic scales all the time (ie more or less things like [20Hz,40Hz], [40Hz,80Hz], [80Hz,160Hz] !). You should use CWT instead $\endgroup$ – Basj Nov 23 '13 at 21:34
  • $\begingroup$ I am using CWT and getting accurate results. but I want to compare the results with DWT(WPT) too, but DWT shows very bad results. @Basj $\endgroup$ – Electricman Nov 23 '13 at 21:37
  • $\begingroup$ Could you try a higher order coiflet? With the short length wavelets, the frequency separation is far from stellar, the packet transform only increases the frequency overlaps. I once played around with Daubchies D12 (with absolute amplitude, not the usual logarithmic scale). $\endgroup$ – Dr. Lutz Lehmann Dec 29 '13 at 20:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.