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

2 vues (au cours des 30 derniers jours)
Yared Daniel le 19 Juil 2021
Commenté : Mathieu NOE le 22 Juil 2021
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
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 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Réponses (1)

Mathieu NOE le 19 Juil 2021
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
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 commentairesAfficher AucuneMasquer Aucune
Yared Daniel le 20 Juil 2021
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 le 22 Juil 2021
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 ...

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Signal Analysis dans Help Center et File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by