Wavelet signal processing menu vs command line
7 次查看(过去 30 天)
显示 更早的评论
Hi All,
I am trying to get my head around using the command line vs using 'wavemenu' to process some signals. For convenience,I will provide same code using one of the datasets provided with MatLab.
The signal is quite different from what I am using, but hopefully this will make it easier for others to recreate/use the below code.
load leleccum
sig=leleccum;
[C,L]=wavedec(sig,12,'db10');
cD3 = detcoef(C,L,8);
[Ea, Ed] = wenergy(C, L);
%% % at this point I use wavemenu to import 'sig' using the 'Wavelet 1-D' menu area. Settings = db 10 and level 12, I click 'Analyze' finally I use file>export to workspace>export all details ([d1;...;dn]). The data exprorted is saved the workspace as my_VAR_1
subplot(221)
plot(sig)
subplot(223)
plot(cD3)
axis tight
subplot(222)
plot(sig)
subplot(224)
plot(my_VAR_1(8,:))
axis tight
The signals 'cD3' and those saved in my_VAR_1 are a different length when viewing the plots the pattern of change ifs clearly different.
Its fairly obvious that I don't really understand what the command [C,L]=wavedec(sig,12,'db10'); is doing. Therefore I am hoping someone can help with the following questions:
1.) What is the difference between the two approaches I have displayed above? 2.) When using the wenergy command, I understand the Ea output, but I do not get the Ed. Please can someone explain? I would like to be able to state how much energy is in each component of the signal as a percentage. The Ed values do not add up to the equivalent of Ea, so I am a tad confused. 3.) Once I have understood the above points, how can I estimate the approximate frequencies of each component?
I would to avoid the use of wavemenu so that I can automate the process to read multiple signals (I have further analysis to complete once I figured the above points out).
Thank you in advance for any help you can offer. Regards Dan
1 个评论
Good mind
2018-11-7
you get half length in each level because you use wavedec function, try with nondecimated discrete stationary wavelet transform (swt) to get same length.
cD8(not cD3) = detcoef(C,L,8);is To extract the level 8 detail coefficients
try learning wavelet toolbox user's guide
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 AI for Signals and Images 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!