Linear scale to Log scale in CWT

조회 수: 23 (최근 30일)
Raviteja
Raviteja 2011년 7월 23일
답변: Robert U 2019년 9월 25일
Following this code..
>> y=[zeros(1,500) ones(1,500)];
>> cwt(y,1:128,'haar','plot');
>> colormap jet
>> colorbar
Here the plot is showing linear scale..
How to convert the linear scale to show log scale in CWT command..
I tried with this code
>>cwt(y,log10(1:128),'haar','plot');
But wavelet doesn't scale '0' scale so giving error like
**************************************
ERROR ...
--------------------------------------
cwt ---> Invalid Value for Scales !
**************************************
??? Error using ==> cwt at 74
Invalid Value for Scales !
So what is the solution to my problem ( conversion of linear to log scale ) ?

답변 (1개)

Robert U
Robert U 2019년 9월 25일
Hi Raviteja,
the command cwt() allows to use the output matrix of the wavelet transform to produce your own plots. One possibility is to use the following way:
% attention: this is the 'old' command call, since version 2016b there is a 'new' command call
% assumption - the sampling frequency is 500 Hz
[wt,f] = cwt(y,1:128,'haar',500);
% create figure and axes
fh = figure;
ah = axes(fh);
% plot the absolute value of wavelet transform matrix (frequency vector may not contain '0 Hz'
imagesc(ah,1:size(wt,2),f,abs(wt))
colormap(fh,'pink') % change colormap to 'pink' to reproduce 'cwt'-look
ah.XScale = 'log'; % change scale of x axis to logarithmic
You can change almost all figure related parameters in that manner.
Kind regards,
Robert

카테고리

Help CenterFile Exchange에서 Continuous Wavelet Transforms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by