📄 imagecwt.sci
字号:
function ImageCWT(cwt,scaling,colors,option,oct,scale)
// ImageCWT -- Image of Continuous Wavelet Transform
// Usage
// ImageCWT(cwt,scaling,colors)
// Inputs
// cwt matrix produced by CWT
// scaling string, 'Overall', 'Individual'
// colors string argument for colormap
// option 'lin' or 'log' for the type of display
// oct Default=2
// scale Default=4
//
// Side Effects
// Image Display of Continuous Wavelet Transform
//
// Copyright Aldo I Maalouf
[lhs,rhs]=argn();
if rhs < 5,
oct = 2;
scale = 4;
end
if rhs < 4
option = 'log';
end
sz = size(cwt);
n = sz(1);
nscale = sz(2);
noctave= floor(log2(n)) -2;
nvoice = nscale ./ noctave;
if string(option)=='log'
ytix = linspace(1+(oct-floor(log2(scale))),log2(n)-oct,nscale);
xtix = linspace(0,n,n);
else
xtix = linspace(0,n,n);
ytix = linspace(fix(n/2),0,fix(nscale));
end
if string(scaling)=='Individual',
for k=1:nscale,
goodstart = min(n/2 .* 2^(-k/nvoice), n/4);
amin = min(cwt(fix(goodstart):fix(n-goodstart),k));
amax = max((cwt(fix(goodstart):fix(n-goodstart),k)));
cwt(:,k) = ((cwt(:,k))-amin) ./ (amax-amin) .*256;
end
else
amin = min(min(cwt));
amax = max(max((cwt)));
cwt = (cwt+amax) ./ (2*amax) .*256;
end
if string(option)=='lin'
mtlb_image(xtix,ytix, flipud(cwt'));
plot2d([0;1],[0;1],0);//axis('xy');
else
mtlb_image(xtix,ytix, cwt');
plot2d([0;1],[0;1],0);//axis('ij');
xtitle('','','log2(s)');
//xlabel('')
//ylabel('log2(s)')
end
xset("colormap",eval(colors));
endfunction
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -