waverot.m

来自「JLAB is a set of Matlab functions I have」· M 代码 · 共 45 行

M
45
字号
function[w,err]=waverot(w)%WAVEROT Rotates complex-valued wavelets.%%   WAVEROT(W) where W is a complex-valued analytic wavelet, rotates%   W such that the real part is even and the imaginary part is odd.%  %   Also, specifies that at the midpoint of W, the real part must be%   positive and the imaginary part must be increasing, like a sinusoid.%   _________________________________________________________________%   This is part of JLAB --- type 'help jlab' for more information%   (C) 2004 J.M. Lilly --- type 'help jlab_license' for details        if size(w,2)>size(w,1)  error('W must be a column vector.')endN=1000; %use this many points to avoid huge matricesif length(w)>N  n=round(length(w)/N); %this is the interval to give me N points  x=w(1:n:end);else  x=w;endphi=[0:.01:pi]';rot=exp(sqrt(-1)*phi);x1=oprod(x,rot);x2=conj(oprod(flipud(x),rot));dx=sum(abs(x2-x1));[m,mi]=min(dx);rot1=rot(mi);w=w*rot1;mid=round(length(w)/2);if real(w(mid))<0  w=-w;endif imag(w(mid+1)-w(mid))<0  w=conj(w);end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?