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!