Wavelet plotting with imagesc

8 vues (au cours des 30 derniers jours)
Nikolas
Nikolas le 27 Juil 2016
Réponse apportée : Nikolas le 27 Juil 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?

Réponse acceptée

Nikolas
Nikolas le 27 Juil 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.

Plus de réponses (0)

Catégories

En savoir plus sur Wavelet Toolbox 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