How to change the colormap of CWT wavelet transform to dB scale (10log_10(x))
12 views (last 30 days)
Show older comments
Yaser Arafath Gulam Dhasthagir
on 13 Apr 2023
Commented: Yaser Arafath Gulam Dhasthagir
on 17 Apr 2023
Hello, I plotted my data using wavelet transform with Morlet as mother wavelet and i got the plot of time vs frequency with the energy as the colormap. I was wondering if I could chnage the color map to dB scale (10*Log10(x)). Can anyone help? Also the current frequency scale is in log scale. How can i change it to linear scale?
I attached the plot. The below is the code used.
%Compute scalogram
%Parameters
sampleRate = Fs;
wavelet = 'amor';
%Compute time vector
t = 0:1/sampleRate:(length(D1)*1/sampleRate)-1/sampleRate;
%Compute CWT
%If necessary, substitute workspace variable name for D4 as first input to cwt() function in code below
%Run the function call below without output arguments to plot the results
[waveletTransform,frequency] = cwt(D1, sampleRate, wavelet);
scalogram = abs(waveletTransform);
0 Comments
Answers (1)
Gokul Nath S J
on 17 Apr 2023
Hi Yaser Arafath Gulam Dhasthagir,
Based on my understanding, it seems that you want to change the colormap of the CWT wavelet transform to dB scale.
The colormap can be converted to dB scale by using the following code.
cwt(D1, sampleRate, wavelet);
ax = gca;
ax.ColorScale = "log";
For further information, kindly refer the following link.
with regards,
Gokul
See Also
Categories
Find more on Continuous Wavelet Transforms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!