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
0 个评论
回答(1 个)
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 个评论
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 Exchange 中查找有关 Continuous Wavelet Transforms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!