MATLAB toolbox wavelet time-frequency

2 次查看(过去 30 天)
Godefroy
Godefroy 2011-5-26
[EDIT: 20110526 02:20 CDT - reformat - WDR]
plan time-frequency with wavelet packets D-1
I have a question about the time-frequency plan.
as the example in wavedemo -> GUI mode -> Wavelet packet D-1.
There are a graphic time-frequency plan.
I show my source code :
fe=100e3;
Te=1/fe;
N=1024;
t=[0:Te:(N-1)*Te];
f0=1000;
f1=50000;
x=chirp(t,f0,(N-1)*Te,f1);
n_tree = 4; %Tree level number
%-------------------------------------------------------
figure;
subplot(2,1,1),plot(x);
title('signal original');
%
wpt = wpdec(x,n_tree,'db4');
plot(wpt);
bt = besttree(wpt);
plot(bt);
for i=1:(2^n_tree)
temp = wpcoef(wpt,[n_tree i-1]);
cfs(i,:) = temp;
end
%subplot(2,1,2),plot(cfs);
figure;
for i=1:(2^n_tree)
subplot((2^n_tree)/2,2,i),plot(cfs(i,:));
%title('partie signal (', n_tree ,',',i-1, ')');
end
cfs=cfs.^6;
figure;
image(cfs);
My problem is the frequency order.
I don't know how do it. i search in the toolbox...
I hope I will have a reply.
regards
  3 个评论
Godefroy
Godefroy 2011-5-27
the functions "wpdec" and "besttree" give the signal decomposition but the indic is not arranged in frequency order.
for example i want to decompose a chirp in level 2. I will have 4 frequency(as frequency 10 - 20 - 30 - 40 Hz), i should have in frequency order from 10 Hz to 40 Hz. But the function give the order as 10 -> 20 -> 40 -> 30. So i don't known how to have the good order as 10 - 20 - 30 - 40 Hz. I cannot to arrange the order manual because i need to analyze the signal with the tree and level of 4 or 5 or any more.
I hope with this details it will reply to your isssue.
regards
Yang
Yang 2011-11-25
hi, you can use the function "otnodes" to get the correct order. e.g.
wpt = wpdec(x,n_tree,'db4');
[~,tn_Seq,I] = otnodes(wpt);
hope it helps to you

请先登录,再进行评论。

回答(1 个)

Doug Hull
Doug Hull 2012-9-17
answered in comments

类别

Help CenterFile Exchange 中查找有关 Wavelet Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by