4

I have an issue regard to the unwrapping of phases over time.

I have a radar which monitors a slow periodic moving object. From the received signal, i want to see the phase of the object over time. The phase-over-time signal is extracted from FFTs (at the same FFT bin for all the FFTs). Here is the result i got: enter image description here

Because the phases are wrapped, so I need to do an unwrapping for the phases. I use the Matlab command "unwrap" to to this. So I got: enter image description here

The issue is marked at the red circle. Here I expect the signal at this time-instant to be unwrapped. However it wasn't, and the reason is:

- From time sample NO. 42 -> 44, the phases take two time samples to being
wrapped, instead of only one (i.e between two consecutive time samples).
Because of this the phase-over-time signal are not unwrapped correctly. 

I also tried to used another phase-unwrapping method (Adaptive numerical integration), however the result is the same as using "unwrap" command from Matlab.

Here is the phase-over-time signal I expected to see (I did the unwrapping manually): enter image description here

What is the problem mentioned above (Is it a well-known problem or has any name for it)? And of course what is the solution for this?

I would really appreciate any help from you! Thanks alot.

Filipe Gonçalves
  • 20,783
  • 6
  • 53
  • 70
BL_
  • 821
  • 1
  • 17
  • 23

2 Answers2

5

Matlab's unwrap function tries to avoid any jumps between consecutive values larger than tol. By default, tol is pi. Your jumps from -1.644 to -0.7 to 1.55 are not larger than pi, so unwrap doesn't find it necessary to adjust your data. Note, even if the -0.7 wasn't in there, unwrap still wouldn't adjust your data as the jump would still be less than pi.

The tolerance is an optional parameter in unwrap, you can set:

unwrap(x,tol)

I would suggest setting your tolerance to pi/2 or 3*pi/4, depending on your data.

The unwrap documentation probably has more information

http://uk.mathworks.com/help/matlab/ref/unwrap.html?refresh=true

RPM
  • 1,704
  • 12
  • 15
  • Thanks for the reply @RPM If -0.7 was not there, then the jump is (1.55 - -1.644 = 3.194 > pi), so it would be counted as a jump. I think the "unwrap" command is fine. I also tried to unwrap the phases using Adaptive Numerical Integration method, however the result is the same. I think it's somehow a problem of the signal itself. And btw I think "unwrap" command does not work for jump less than pi even if the "tol" value is set e.g pi/2. – BL_ Sep 08 '15 at 06:05
3

It seems that your input signal is between -pi and pi an your desired output between 0 and 2pi, so why dont'you simply add 2pi to the negative values ? Here is a try:

I = s<0;
s(I) = s(I) + 2*pi;

That should provide the desired output, in a more simpler way.

Best,

Ratbert
  • 5,463
  • 2
  • 18
  • 37
  • Thanks @Ratbert Actually I don't really care about the absolute value of the signal, I concern more about its correct shape, cause I want to estimate is frequency. – BL_ Sep 08 '15 at 06:10
  • I understand, my point here is not to put the signal in a given range but to transform the signal to the desired output. Give it a try and you'll see that it answers your problem without the use of `unwrap`. – Ratbert Sep 08 '15 at 06:15
  • Thanks very much @Ratbert. I did try and the result looks better. However now it has some problems with parts of signal which are around the zero-level. These parts of signal have some unexpected jumps which is not wanted (not the above signal, it's a very simple one for illustrating my problem. The actually signal is more noisy). I'm trying to find the solution for these incorrectly jumps! – BL_ Sep 08 '15 at 07:18