声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 3860|回复: 2

[综合讨论] 关于matlab中phase函数和angle函数的区别

[复制链接]
发表于 2013-9-7 15:13 | 显示全部楼层 |阅读模式

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

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

x
我用两种算法计算一个多输入多输出模型的传递函数得到结果(两组复数序列,分别对应两种算法的结果,分别记作H1_ij,Hv_ij,),分别对比两组复数序列实部和虚部,发现都能完全吻合。当用phase函数分别求这两组复数序列的相位时,发现当ij不同时,phase(H1_ij)和phase(Hv_ij)有时同相,有时相位差2pi,而angle(H1_ij)和angle(Hv_ij)则计算出的结果始终完全吻合。因此向各位大侠请教phase函数和angle函数的区别,望不吝赐教,谢谢回复!
回复
分享到:

使用道具 举报

发表于 2013-9-17 09:35 | 显示全部楼层
1.若有附加图形可能别人比较容易了解LZ说的问题
2.详看下help, 应该会有说明
3.若想进一步了解并确定, 或许可以直接看下该函数(使用edit)
4.google下, ref: http://stackoverflow.com/questio ... e-command-in-matlab

点评

赞成: 0.0
赞成: 0
3Q!元老提供的第4条中说的太清楚不过了,谢谢!  发表于 2013-9-18 10:09

评分

1

查看全部评分

发表于 2013-9-18 23:02 | 显示全部楼层
想想应该直接贴上好像比较好
Matlab help for phase

PHASE  Computes the phase of a complex vector

    PHI=phase(G)

    G is a complex-valued row vector and PHI is returned as its
    phase (in radians), with an effort made to keep it continuous
    over the pi-borders.Matlab help for angle

ANGLE  Phase angle.
    ANGLE(H) returns the phase angles, in radians, of a matrix with
    complex elements.  

    Class support for input X:
       float: double, single
At first, ANGLE command is from MATLAB core, PHASE from system identification toolbox.

ANGLE command always give result in range [-pi, pi].

PHASE command is more complex. If you have two adjacent points in input vector with phase near pi, for example

X=[-1+0.1i -1-0.1i]phase(X) command will give answer greater than pi for the second value (difference between phases values should be less than pi).

At this time angle(X) command will give value near -pi for the second argument (wrap values into range [-pi, pi]). E.g.

phase(X(2)) = angle(X(2)) + 2*pi

点评

赞成: 5.0
赞成: 5
好!  发表于 2013-9-19 20:25
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-12-24 00:52 , Processed in 0.115696 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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