How to visualize time frequency information of time series signal using continuous wavelet transform

1 回表示 (過去 30 日間)
I have time series signal named X with variable Sg. I want to visualize it’s time frequency information by using continuous wavelet transform with the following input parameters:
samplingperiod=0.25;
scale = 24;
Fs = 4;
t = 0:1/Fs:(numel(Sg)-1)/Fs;
t = 0:1/Fs:(numel(Sg)-1)/Fs;
wavelet name = ‘db2’
I have tried the following script and got the following output (time scale information)
clear
load('X.mat')
samplingperiod=0.25;
scale = 24;
Fs = 4;
t = 0:1/Fs:(numel(Sg)-1)/Fs;
ax = newplot;
c = cwt(Sg,scale,'db2','plot');
colormap('jet(227)')
axis tight;
cb = colorbar(ax);
However what I need is a time- frequency information with a frequency range of 0 up to 2 Hz and time in second (4800/4 =1200 second) like the following figure
Thank you for contribution in advance

回答 (1 件)

Mathieu NOE
Mathieu NOE 2021 年 7 月 19 日
hello
I used this FEX submission as I don't have the Wavelet Toolbox
Your code adapted is as follows. Note you can "zoom" the dB scale to better see the small signals rendering - here I choosed 40 dB of max scale.
clear
load('X.mat')
Fs = 4;
t = (0:numel(Sg)-1)/Fs;
ax = newplot;
[y,f,coi] = cwt(Sg,Fs);
% reduction of the dB scale : only display max to min = max - Range_dB
Range_dB = 40; % dB scale
out_dB = 20*log10(abs(y));
ind = find(out_dB< max(out_dB,[],'all')-Range_dB);
out_dB(ind) = NaN;
imagesc(t,f,out_dB);
xlabel('Time (s)')
ylabel('Frequency (Hz)')
colormap('jet(128)')
axis tight;
cb = colorbar(ax);
set(gca,'YDir','normal');
  2 件のコメント
Yared Daniel
Yared Daniel 2021 年 7 月 20 日
Thank you Mr Mathieu for responding but what is the wavelet family? can this applicable for db or sym family? and the does the decible scale related with scale of the wavelet?
Mathieu NOE
Mathieu NOE 2021 年 7 月 22 日
hello Yared
sorry, I am not expert in wavelet , I am until now using more basic fft tools . I have to learn a bit more myself on wavelet ...

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeContinuous Wavelet Transforms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by