The difference between the old version and new version of CWT (Continuous Wavelet Transform)

조회 수: 15 (최근 30일)
Supatat Hovanotayan 2019년 8월 5일
답변: garima 2020년 5월 31일
Hi Everyone!!!
My name is Supatat Hovanotayan. I am a master student studying in Mechanical Engineering, The University of Tokyo.
The reason why I am writing this question is to ask and consult you about the old version and new version of cwt code.
Older version:
However, for my research, I have used old and new version of cwt code both to detect abrupt change in roll angular velocity of rail vehicle.
** I am using MATLAB2019a**
This is roll angular velocity signal as shown below
The figure shown below is the result when I used the old version of cwt
And the result when I used the new version of cwt
According to the results, they are totally diferrent, you can see that the result of the old version of cwt shows the maximum wavelet coefficientn the low frequency range[around 1Hz].
But the result of the new version of cwt showa the maximum wavelet coefficient at the around 10Hz.
It makes me confused with it. First of all, I though the result should be like the old version, but once the used the new version of cwt I got the diffrent result.
Therefore, this is my quesion
1. What is the diferrece between the old and new version? [I read realease notebook already but do not understand clearly]
2. Do you think which result is correct?
3. Why did I get different results?
Could anyone please help me to find out this problem it is very impoetant to my master thesis
I am looking forward to hearing from you
Best regards,
Supatat Hovanotayan

댓글을 달려면 로그인하십시오.

채택된 답변

Wayne King 2019년 8월 5일
Hi Supatat, Some of this has been discussed here:
You did not show the code that you used in both cases (old CWT api and new CWT api), but obviously we recommend the new API for a number of reasons.
In your specific case, if you are actually looking at the where the maximum values occur in the wavelet transform, then the old version is not recommend because it normalizes the wavelets using L2 normalization. That is discussed here:
In your case this means that the bandpass filter used has a peak amplitude that depends on the scale, the lower the scale the higher the amplitude. So it biases the results toward larger scales (or lower frequencies). The new CWT does not do that, all filters have the same magnitude in L1 normalization, that is a fairer picture. That is particularly true if you are looking at values. Qualitatively, it looks like the picture of the signal is the same in both othe old and new CWT, but the L2 normalization of the old API is biasing the results toward lower frequencies.
For example: Here we have two oscillations with unambigously unit amplitude. See that the new CWT gets it right.
Fs = 1e3;
t = 0:1/Fs:1;
x = cos(2*pi*32*t).*(t>=0.1 & t<0.3)+sin(2*pi*64*t).*(t>0.7);
cwt(x,1000)
Try the above example with the old CWT and you will see that the reported amplitude (magnitude) for the 32-Hz component is larger than the 64-Hz component and neither of them will be close to 1.
Hope that helps,
Wayne
댓글 수: 1이전 댓글 -1개 표시이전 댓글 -1개 숨기기
Supatat Hovanotayan 2019년 8월 5일
These are cwt codes I used
old version:
scale = 1:512
Fs = 200;
t = 0:1/Fs:(length(roll)-1)/Fs;
[cfs,freq] = cwt(roll,scale,'morl',1/Fs)
surf(t,freq,abs(cfs));
colormap jet;
xlabel('Time(s)'),ylabel('Frequency (Hz)')
new version:
Fs = 200;
t = 0:1/Fs:(length(roll)-1)/Fs;
[coef,f] = cwt(roll,Fs,'amor');
surf(t,f,abs(coef));
colormap jet;
xlabel('Time(s)'),ylabel('Frequency (Hz)')
For your answer, it makes me understand it much better. Thank you very much
And I will try the example that you gave me in your answer.
Thank you very much for your help
PS: If I have any question, Can I ask you again?

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

garima 2020년 5월 31일
Hi Supatat,
since I have just started learning of wavelet transfrom .
could you please explain, how to decide scale for cwt (if we are using older cwt)?
what is the significance of scale.
댓글 수: 0이전 댓글 -2개 표시이전 댓글 -2개 숨기기

댓글을 달려면 로그인하십시오.

garima 2020년 5월 31일
Hello wayne,
I have tried the above example with the old CWT example given by you.
is there any way to scale (correct) the amplitude?

댓글을 달려면 로그인하십시오.

카테고리

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

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by