Wavelet plotting with imagesc

10 ビュー (過去 30 日間)
Nikolas
Nikolas 2016 年 7 月 27 日
回答済み: Nikolas 2016 年 7 月 27 日
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?

採用された回答

Nikolas
Nikolas 2016 年 7 月 27 日
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.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeWavelet Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by