Some bugs(?) in cwt, continuous wavelet transformation function in matlab.
3 次查看(过去 30 天)
显示 更早的评论
Hi, mate.
During for wavelet anaylsis my data. I found strange point in using cwt function in matlab. When I extract [wt, f] variables using this function and plot it, however, it doesn't the same as the plot which used in cwt plot.
Here is an example in mablab, Kobe data. First one is just using that command
load kobe
cwt(kobe,1);
Last one is using that commands
load kobe
[wt,f,coi] = cwt(kobe,1);
imagesc((1:numel(kobe))./60,f*1e3,abs(wt));
set(gca,'Ydir','normal');
xlabel('Time(mins)')
ylabel('Frequency[mHz]')
I think there are some problems in frequency output of this function. Is there any methods to revise that error?
Regards,
Minho
0 个评论
回答(1 个)
Wayne King
2016-10-7
Hi Minho, This is because when you call CWT with no output arguments, the CWT uses a logarithmic frequency axis, it actually uses log to the base 2 as explained in the help.
"The frequency or period axis in the scalogram uses a log2 scale."
The wavelet transform most appropriately uses logarithmic scaling on the frequency axis because of the dilation property of the wavelet. So if you use a logarithmic axis
[wt,f,coi] = cwt(kobe,1);
imagesc((1:numel(kobe))./60,log2(f*1e3),abs(wt));
ax = gca;
ytick = str2num(cell2mat(ax.YTickLabel));
ax.YTickLabel = num2str(2.^ytick);
set(gca,'Ydir','normal');
xlabel('Time(mins)')
ylabel('Frequency[mHz]')
You will see it is the same. In your example, you are using a linear frequency axis. That is what accounts for the difference in what you see.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Continuous Wavelet Transforms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!