Clear Filters
Clear Filters

How to change the colormap of CWT wavelet transform to dB scale (10log_10(x))

12 views (last 30 days)
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);

Answers (1)

Gokul Nath S J
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

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!