morlet.m

来自「这是伯克里wavelet transforms一书中的例子的代码」· M 代码 · 共 19 行

M
19
字号
function mo = morlet(a,ts,int)
%mo = morlet(a,ts,int) creates a morlet wavelet dilated to a factor 'a'.
%Time axis goes from -int to int in steps of ts, the sampling interval.
%Note: a MUST NOT be zero.
%This routine is used by the routine 'ctwt'.
%
%Author: Ajit S. Bopardikar
%Copyright (c) 1998 by Addison Wesley Longman, Inc.
%

  if(a~=0)
    w0=pi*sqrt(2/log(2));
    t=0:ts:int;
    mo=1/sqrt(2*pi*abs(a)) * exp(-i*w0*(t/a)).*exp(-(t/a).^2);
    l =length(mo);
    mo = [mo(l:-1:2) mo]; %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 + -
显示快捷键?