声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 3862|回复: 3

求助:求用MATLAB实现hilbert变换过程的程序 谁有共享一下哈 谢谢

[复制链接]
发表于 2006-6-4 22:24 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
如题<BR>求用MATLAB实现hilbert变换过程的程序 谁有共享一下哈 谢谢<BR>
回复
分享到:

使用道具 举报

发表于 2006-6-5 01:49 | 显示全部楼层
<P>function x = hilbert(xr,n)<BR>%HILBERT  Discrete-time analytic signal via Hilbert transform.<BR>%   X = HILBERT(Xr) computes the so-called discrete-time analytic signal<BR>%   X = Xr + i*Xi such that Xi is the Hilbert transform of real vector Xr.<BR>%   If the input Xr is complex, then only the real part is used: Xr=real(Xr).<BR>%   If Xr is a matrix, then HILBERT operates along the columns of Xr.<BR>%<BR>%   HILBERT(Xr,N) computes the N-point Hilbert transform.  Xr is padded with <BR>%   zeros if it has less than N points, and truncated if it has more.  <BR>%<BR>%   For a discrete-time analytic signal X, the last half of fft(X) is zero, <BR>%   and the first (DC) and center (Nyquist) elements of fft(X) are purely real.<BR>%<BR>%   Example:<BR>%     Xr = [1 2 3 4];<BR>%     X = hilbert(Xr)<BR>%   produces X=[1+1i 2-1i 3-1i 4+1i] such that Xi=imag(X)=[1 -1 -1 1] is the<BR>%   Hilbert transform of Xr, and Xr=real(X)=[1 2 3 4].  Note that the last half<BR>%   of fft(X)=[10 -4+4i -2 0] is zero (in this example, the last half is just<BR>%   the last element).  Also note that the DC and Nyquist elements of fft(X)<BR>%   (10 and -2) are purely real.<BR>%<BR>%   See also FFT, IFFT.</P>
<P>%   Copyright 1988-2002 The MathWorks, Inc.<BR>%   $Revision: 1.10 $  $Date: 2002/03/28 17:28:20 $</P>
<P>%   References:<BR>%     [1] Alan V. Oppenheim and Ronald W. Schafer, Discrete-Time<BR>%     Signal Processing, 2nd ed., Prentice-Hall, Upper Saddle River, <BR>%     New Jersey, 1998.<BR>%<BR>%     [2] S. Lawrence Marple, Jr., Computing the discrete-time analytic <BR>%     signal via FFT, IEEE Transactions on Signal Processing, Vol. 47, <BR>%     No. 9, September 1999, pp.2600--2603.</P>
<P>if nargin&lt;2, n=[]; end<BR>if ~isreal(xr)<BR>  warning('HILBERT ignores imaginary part of input.')<BR>  xr = real(xr);<BR>end<BR>% Work along the first nonsingleton dimension<BR>[xr,nshifts] = shiftdim(xr);<BR>if isempty(n)<BR>  n = size(xr,1);<BR>end<BR>x = fft(xr,n,1); % n-point FFT over columns.<BR>h  = zeros(n,~isempty(x)); % nx1 for nonempty. 0x0 for empty.<BR>if n&gt;0 &amp; 2*fix(n/2)==n<BR>  % even and nonempty<BR>  h([1 n/2+1]) = 1;<BR>  h(2:n/2) = 2;<BR>elseif n&gt;0<BR>  % odd and nonempty<BR>  h(1) = 1;<BR>  h(2:(n+1)/2) = 2;<BR>end<BR>x = ifft(x.*h(:,ones(1,size(x,2))));</P>
<P>% Convert back to the original shape.<BR>x = shiftdim(x,-nshifts);</P>
 楼主| 发表于 2006-6-5 08:17 | 显示全部楼层
<P>谢谢楼上的  把要进行hilbert变换的信号代入xr就行吗?我怎么运行不出来 </P>
发表于 2006-6-5 12:45 | 显示全部楼层
实际这是MATLAB信号工具箱中的官方函数,可以查阅看看它的实例以及官方的在线FAQ,有详细的介绍<BR><a href="http://www.mathworks.com/cgi-bin/texis/webinator/search/?db=MSS&amp;prox=page&amp;rorder=750&amp;rprox=750&amp;rdfreq=500&amp;rwfreq=500&amp;rlead=250&amp;sufs=0&amp;order=r&amp;is_summary_on=1&amp;ResultCount=10&amp;query=hilbert" target="_blank" >http://www.mathworks.com/cgi-bin/texis/webinator/search/?db=MSS&amp;prox=page&amp;rorder=750&amp;rprox=750&amp;rdfreq=500&amp;rwfreq=500&amp;rlead=250&amp;sufs=0&amp;order=r&amp;is_summary_on=1&amp;ResultCount=10&amp;query=hilbert</A>
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-11-14 22:50 , Processed in 0.066088 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表