Some bugs(?) in cwt, continuous wavelet transformation function in matlab.

조회 수: 3 (최근 30일)
Minho Kim
Minho Kim 2016년 10월 7일
답변: Wayne King 2016년 10월 7일
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

답변 (1개)

Wayne King
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.

카테고리

Help CenterFile Exchange에서 Continuous Wavelet Transforms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by