⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hiltrans.m

📁 JLAB is a set of Matlab functions I have written or co-written over the past fifteen years for the p
💻 M
字号:
function[y]=hiltrans(x)%HILTRANS  Hilbert transform.%%   Y=HILTRANS(X) returns the Hilbert transform of column vector X.%%   If SIZE(X,2)>1, HILTRANS takes the Hilbert transform along columns.%%   'hiltrans --f' makes a sample figure%   _________________________________________________________________%   This is part of JLAB --- type 'help jlab' for more information%   (C) 2004 J.M. Lilly --- type 'help jlab_license' for details          if strcmp(x,'--f')  hiltrans_fig;returnendif isreal(x)  bool=1;else  bool=0;endN=size(x,1);X=fft(x);sgnom=ones(N,1);%sgnom(1)=0;index=[1:N];index=find(index-1>N/2);sgnom(index)=-1;d=-sqrt(-1)*(sgnom);d=oprod(d,1+zeros(size(x(1,:)))');y=ifft(X.*d);%Take real part if real vector was inputif bool  y=real(y);endfunction[]=hiltrans_fign=256;t=[-n:n]';warning offx=1./t;warning onindex=find(~isfinite(x));if ~isempty(index)  x(index)=0;endy=hiltrans(x);figure,plot(cumsum(y))disp('This is a plot of cumsum(hiltrans(1/x))')disp('Hilbert transform of 1/x should be -pi*delta function')

⌨️ 快捷键说明

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