Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Phase unwrapping?

Subject: Phase unwrapping?

From: enippola@yahoo.com (Ervin)

Date: 26 Aug, 2002 20:36:19

Message: 1 of 3

Hi,

I am having problems with the Phase Unwrapping routine, image size
1024*1024.

Matlab 'unwrap' function doesn't work well. I can not use this
function.
Anyone out there who has done this before ? Any information would be
very much appreciated.

Ervin

Subject: Phase unwrapping?

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

Date: 28 Aug, 2002 03:19:19

Message: 2 of 3

enippola@yahoo.com (Ervin) wrote in message news:<5awvgp5bl3hb@legacy>...
> Hi,
>
> I am having problems with the Phase Unwrapping routine, image size
> 1024*1024.
>
> Matlab 'unwrap' function doesn't work well. I can not use this
> function.
> Anyone out there who has done this before ? Any information would be
> very much appreciated.
>
> Ervin

My experience is only with 1-D. My best results involved the following:
(WARNING! My memory isn't perfect.)

1. Define a backward difference function:

   bdiff(phase) = [phase(1);diff(phase)];

   and a wrap function

   phase = atan2(sin(phase),cos(phase));
   phase = phase + 2*pi*(phase <= -pi);

2. Find a reference point of minimum slope

   dphase = bdiff(phase);
   n0 = find(min(abs(dphase)))
   n0 = n0 + (dphase(n0) < 0)
   phase0 = phase(n0);
   phase = phase - phase0;

3. Define upper and lower subvectors

   phaseu = flipud(phase(1:n0));
   phased = phase(n0:end);

5. Unwrap 2nd differences

   phaseu = flipud(cum(cum(wrap(bdiff(bdiff(phaseu))))));
   phased = cum(cum(wrap(bdiff(bdiff(phased)))));

6. Combining

   phase = phase0 + [phaseu; phased(2:end)];


7. Test on a quadratic

   t = dt * [0:N-1]';
   phase = wrap(a * (t-dt*N/2).^2);

Hope this helps.

Greg

Subject: Phase unwrapping?

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

Date: 29 Aug, 2002 19:30:45

Message: 3 of 3

heath@ll.mit.edu (Greg Heath) wrote in message news:<9e910d7a.0208280219.3c7e26f6@posting.google.com>...
> enippola@yahoo.com (Ervin) wrote in message news:<5awvgp5bl3hb@legacy>...
> > Hi,
> >
> > I am having problems with the Phase Unwrapping routine, image size
> > 1024*1024.
> >
> > Matlab 'unwrap' function doesn't work well. I can not use this
> > function.
> > Anyone out there who has done this before ? Any information would be
> > very much appreciated.
> >
> > Ervin
>
> My experience is only with 1-D. My best results involved the following:
> (WARNING! My memory isn't perfect.)
>
> 1. Define a backward difference function:
>
> bdiff(phase) = [phase(1);diff(phase)];
>
> and a wrap function
>
> phase = atan2(sin(phase),cos(phase));
> phase = phase + 2*pi*(phase <= -pi);
>
> 2. Find a reference point of minimum slope
>
> dphase = bdiff(phase);
> n0 = find(min(abs(dphase)))
> n0 = n0 + (dphase(n0) < 0)
> phase0 = phase(n0);
> phase = phase - phase0;
>
> 3. Define upper and lower subvectors
>
> phaseu = flipud(phase(1:n0));
> phased = phase(n0:end);
>
> 5. Unwrap 2nd differences
>
> phaseu = flipud(cum(cum(wrap(bdiff(bdiff(phaseu))))));
> phased = cum(cum(wrap(bdiff(bdiff(phased)))));

Whoops!

    phaseu = flipud(cumsum(cumsum(wrap(bdiff(bdiff(phaseu))))));
    phased = cumsum(cumsum(wrap(bdiff(bdiff(phased)))));
 
> 6. Combining
>
> phase = phase0 + [phaseu; phased(2:end)];
>
>
> 7. Test on a quadratic
>
> t = dt * [0:N-1]';
> phase = wrap(a * (t-dt*N/2).^2);
>
> Hope this helps.
>
> Greg

Tags for this Thread

No tags are associated with this thread.

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.

Contact us