Thread Subject: phase-calculation of disturbed data

Subject: phase-calculation of disturbed data

From: Jochen Philipp

Date: 24 Apr, 2003 10:32:40

Message: 1 of 12

Is there a way to get a reasonable phase-plot of a disturbed dataset?
I have already tried if I can get it right by changing the tolerance
of the function "unwrap", but it doesn't work. (The problem is that
"unwrap" only compares to the value before and doesn't take into
account a trend of the values around)


Thank you!

Subject: phase-calculation of disturbed data

From: AJ \"no z\" Johnson

Date: 28 Apr, 2003 06:03:41

Message: 2 of 12

"Jochen Philipp" <jochen.philipp@gmx.de> wrote in message
news:eebce67.-1@WebX.raydaftYaTP...
> Is there a way to get a reasonable phase-plot of a disturbed dataset?
> I have already tried if I can get it right by changing the tolerance
> of the function "unwrap", but it doesn't work. (The problem is that
> "unwrap" only compares to the value before and doesn't take into
> account a trend of the values around)
>
>
> Thank you!

Try the double-difference technique. I think it can work like this:
(1) compute the phase of each sample (which you have done)
(2) compute the phase difference from sample to sample
(3) call the UNWRAP function on that
(4) re-integrate the phases using CUMSUM

It's been a while, so my recollection of the implementation may be flawed,
but the concept is sound.
-Aj

Subject: phase-calculation of disturbed data

From: David B. Chorlian

Date: 29 Apr, 2003 01:49:33

Message: 3 of 12

In <eebce67.-1@WebX.raydaftYaTP> "Jochen Philipp" <jochen.philipp@gmx.de> writes:

>Is there a way to get a reasonable phase-plot of a disturbed dataset?
>I have already tried if I can get it right by changing the tolerance
>of the function "unwrap", but it doesn't work. (The problem is that
>"unwrap" only compares to the value before and doesn't take into
>account a trend of the values around)

One method would be to "smooth" the output from unwrap() by
selecting only the monotonic values from that output and
using interp1() with the 'pchip' option to fill in the
"errant" values.

>Thank you!

--
David B. Chorlian
Neurodynamics Lab SUNY/HSCB
chorlian@spot.cns.hscbklyn.edu
davidc@panix.com

Subject: phase-calculation of disturbed data

From: Jochen Philipp

Date: 29 Apr, 2003 01:03:33

Message: 4 of 12

AJ \no z\ Johnson wrote:
>
>
> "Jochen Philipp" <jochen.philipp@gmx.de> wrote in message
> news:eebce67.-1@WebX.raydaftYaTP...
>> Is there a way to get a reasonable phase-plot of a disturbed
dataset?
>> I have already tried if I can get it right by changing the
tolerance
>> of the function "unwrap", but it doesn't work. (The problem is
that
>> "unwrap" only compares to the value before and doesn't take into
>> account a trend of the values around)
>>
>>
>> Thank you!
>
> Try the double-difference technique. I think it can work like this:
> (1) compute the phase of each sample (which you have done)
> (2) compute the phase difference from sample to sample
> (3) call the UNWRAP function on that
> (4) re-integrate the phases using CUMSUM
>
> It's been a while, so my recollection of the implementation may be
flawed,
> but the concept is sound.
> -Aj
>
>
>
The idea sounds good, but it doesn't work! That's the code I am using:


p=unwrap(unwrap(angle(G)));
phase=cumsum(p').*180./pi;


Anything wrong with that?


Regards, Jochen

Subject: phase-calculation of disturbed data

From: Jochen Philipp

Date: 29 Apr, 2003 01:06:48

Message: 5 of 12

>David B. Chorlian wrote:
>
> One method would be to "smooth" the output from unwrap() by
> selecting only the monotonic values from that output and
> using interp1() with the 'pchip' option to fill in the
> "errant" values.
>
>>Thank you!
>


Is there a way to find the monotonic values with a Matlab-Function?

Subject: phase-calculation of disturbed data

From: AJ \"no z\" Johnson

Date: 29 Apr, 2003 07:36:02

Message: 6 of 12

"Jochen Philipp" <jochen.philipp@gmx.de> wrote in message
news:eebce67.2@WebX.raydaftYaTP...
> AJ \no z\ Johnson wrote:
> >
> >
> > "Jochen Philipp" <jochen.philipp@gmx.de> wrote in message
> > news:eebce67.-1@WebX.raydaftYaTP...
> >> Is there a way to get a reasonable phase-plot of a disturbed
> dataset?
> >> I have already tried if I can get it right by changing the
> tolerance
> >> of the function "unwrap", but it doesn't work. (The problem is
> that
> >> "unwrap" only compares to the value before and doesn't take into
> >> account a trend of the values around)
> >>
> >>
> >> Thank you!
> >
> > Try the double-difference technique. I think it can work like this:
> > (1) compute the phase of each sample (which you have done)
> > (2) compute the phase difference from sample to sample
> > (3) call the UNWRAP function on that
> > (4) re-integrate the phases using CUMSUM
> >
> > It's been a while, so my recollection of the implementation may be
> flawed,
> > but the concept is sound.
> > -Aj
> >
> >
> >
> The idea sounds good, but it doesn't work! That's the code I am using:
>
>
> p=unwrap(unwrap(angle(G)));
> phase=cumsum(p').*180./pi;
>
>
> Anything wrong with that?
>
>
> Regards, Jochen

Here's an example.
% Say you have a actual phase sequence that looks like this:
n=50;
p0=0.3*randn(1,n)+(0:n-1)*pi*0.95; subplot 311; plot(1:n,p0)
% But your measured phase looks like this:
p=mod(p0,2*pi);
% unwrap will have a very tough go of it.
subplot 312; plot(1:n,p,'b',1:n,unwrap(p),'r')
% So take the phase differences, unwrap, and reconstruct.
dp=diff(p);
subplot 313; plot(1:n,cumsum(unwrap([0,dp])))
% This may slope the wrong direction, because of freqeuncy
% wrapping at Nyquist frequency

May this will work in your application.
-Aj

Subject: phase-calculation of disturbed data

From: heath@ll.mit.edu (Greg Heath)

Date: 29 Apr, 2003 08:08:00

Message: 7 of 12

"Jochen Philipp" <jochen.philipp@gmx.de> wrote in message
news:<eebce67.-1@WebX.raydaftYaTP>...
> Is there a way to get a reasonable phase-plot of a disturbed dataset?
> I have already tried if I can get it right by changing the tolerance
> of the function "unwrap", but it doesn't work. (The problem is that
> "unwrap" only compares to the value before and doesn't take into
> account a trend of the values around)

See my post in the Aug '02 thread Re: Phase Unwrapping

Hope this helps.

Greg

Subject: phase-calculation of disturbed data

From: David B. Chorlian

Date: 30 Apr, 2003 02:11:03

Message: 8 of 12

In <eebce67.3@WebX.raydaftYaTP> "Jochen Philipp" <jochen.philipp@gmx.de> writes:

>>David B. Chorlian wrote:
>>
>> One method would be to "smooth" the output from unwrap() by
>> selecting only the monotonic values from that output and
>> using interp1() with the 'pchip' option to fill in the
>> "errant" values.
>>
>>>Thank you!
>>


>Is there a way to find the monotonic values with a Matlab-Function?

find(sign(diff(X)))
...

--
David B. Chorlian
Neurodynamics Lab SUNY/HSCB
chorlian@spot.cns.hscbklyn.edu
davidc@panix.com

Subject: phase-calculation of disturbed data

From: Dick@santacruzwireless.com (Dick Walvis)

Date: 29 Apr, 2003 21:22:32

Message: 9 of 12

"Jochen Philipp" <jochen.philipp@gmx.de> wrote in message news:<eebce67.-1@WebX.raydaftYaTP>...
> Is there a way to get a reasonable phase-plot of a disturbed dataset?
> I have already tried if I can get it right by changing the tolerance
> of the function "unwrap", but it doesn't work. (The problem is that
> "unwrap" only compares to the value before and doesn't take into
> account a trend of the values around)
>
>
> Thank you!

When we do phase averaging for block phase estimators in receivers we
usually convert the signal to real and imaginary. These values are
averaged, and then converted back to the phase domain.

HTH

Dick Walvis

Subject: phase-calculation of disturbed data

From: Jochen Philipp

Date: 30 Apr, 2003 20:18:13

Message: 10 of 12

I tried your suggested code on my data but it didn't work
sufficiently. Therefore I sent you an email with the code and my data
but you mail-address is not working. If you are still interested in
the problem, could you please mail me your correct address so I can
try it again?
Regards, Jochen
>
>

Subject: phase-calculation of disturbed data

From: Jochen Philipp

Date: 30 Apr, 2003 20:31:56

Message: 11 of 12

Jochen Philipp wrote:
>
>
> I tried your suggested code on my data but it didn't work
> sufficiently. Therefore I sent you an email with the code and my
data
> but you mail-address is not working. If you are still interested in
> the problem, could you please mail me your correct address so I can
> try it again?
> Regards, Jochen
>>
>>
>
uhhps! I forgot to mention which address I mean. It is:
aj.jozhnson@lmco.com

Subject: phase-calculation of disturbed data

From: AJ \"no z\" Johnson

Date: 1 May, 2003 11:06:11

Message: 12 of 12

"Jochen Philipp" <jochen.philipp@gmx.de> wrote in message
news:eebce67.8@WebX.raydaftYaTP...
> I tried your suggested code on my data but it didn't work
> sufficiently. Therefore I sent you an email with the code and my data
> but you mail-address is not working. If you are still interested in
> the problem, could you please mail me your correct address so I can
> try it again?
> Regards, Jochen
> >
> >

It's de-spammed. Remove the "z".
-AJ "no Z" Johnson

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com