mexhat.m
来自「这是伯克里wavelet transforms一书中的例子的代码」· M 代码 · 共 20 行
M
20 行
function mx = mexhat(a,ts,int)
%mx = mexhat(a,ts,int) creates a Mexican hat wavelet dilated to a factor,
%a. The sampling interval is ts. The samples of the wavelet are returned.
%The samples of the wavelet are taken in the interval, -int to int.
%Time axis goes from -int to int in steps of ts, the sampling interval
%Note: a MUST NOT be zero.
%This routine is used is by the routine, ctwt.
%
%Author: Ajit S. Bopardikar
%Copyright (c) 1998 by Addison Wesley Longman, Inc.
%
if(a~=0)
t=0:ts:int;
mx=1/sqrt(abs(a)) * (1 - 2*(t/a).^2).*exp(-(t/a).^2);
l =length(mx);
mx = [mx(l:-1:2) mx]; %sampled wavelet
else
fprintf('The dilation factor input by you is zero. Cant compute the wavelet samples at this factor\n');
end %endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?