Wavelet plotting with imagesc

7 visualizaciones (últimos 30 días)
Nikolas
Nikolas el 27 de Jul. de 2016
Respondida: Nikolas el 27 de Jul. de 2016
Dear all, I am trying to plot the results of wavelet decomposition using imagesc and unfortunately this is not working properly.
The plot is perfect using surf, but the plot returned with this command is too heavy (and consequently slow) to manipulate (zoom in/out), so I need to do this with imagesc.
The code I am using is the following:
%Example 5s long signal
sr = 1000;
t = linspace(0,5,5*sr);
sig = 2*cos(2*pi*100*t).*(t<0.500)+3*cos(2*pi*300*t).* (t>0.500 & t <1)+randn(size(t));
WaveletName='cmor2-1';
fc = centfrq(WaveletName);
freqrange = [10 300];
scalerange = fc./(freqrange*(1/sr));
scales = scalerange(end):1:scalerange(1);
Coeffs = cwt(sig,scales,WaveletName);
F = scal2frq(scales,WaveletName,1/sr);
figure;
subplot(1,2,1);
surf(t,F,abs(Coeffs),'EdgeColor','none'); view(2); colorbar; title('Surf');
subplot(1,2,2);
imagesc(t,F,abs(Coeffs)); axis xy; colorbar; title('Imagesc');
Below an example of the resulting plots
Any ideas on how to get imagesc to plot the same thing as surf?

Respuesta aceptada

Nikolas
Nikolas el 27 de Jul. de 2016
I finally found the solution.
The issue is that imagesc doesn't accept non-linear axes as input.
Using instead the function uimagesc from FileExchange does the trick and it is as fast as the native imagesc.

Más respuestas (0)

Categorías

Más información sobre Wavelet Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by