```Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!e21g2000vbz.googlegroups.com!not-for-mail
From: Greg Heath <heath@alumni.brown.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: angle function in matlab
Date: Sat, 16 Jul 2011 07:24:34 -0700 (PDT)
Lines: 19
References: <ivq9n0\$rpn\$1@newscl01ah.mathworks.com>
NNTP-Posting-Host: 69.242.101.137
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1310826275 18898 127.0.0.1 (16 Jul 2011 14:24:35 GMT)
NNTP-Posting-Date: Sat, 16 Jul 2011 14:24:35 +0000 (UTC)
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR
2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:736481

On Jul 15, 4:59 pm, "Penny " <pqq3393...@yahoo.com.cn> wrote:
> I am doing with some ultasound data now. I want to find out the phase difference between the RF data of two adjacent elements. But when i use angle function in matlab, i find a problems:
>
> when i do this
> t=0:0.05:2*pi;
> a=sin(2*pi*t);
> plot(angle(hilbert(a)))
>
> I don't know why the first phase is not zero.
> Could anyone tell me where the problem is? Many thanks!

phase of the cosine is 0
phase of the sine is pi/2

Hope this helps.

Greg
```