# How do I remove the ambiguity velocity/phase wrapping from my data?

FollowAmbiguity problems are a fundamental aspect of all phase difference measurements, because you cannot measure phase outside [-pi, pi]. The ambiguity velocity comes into play in all Doppler systems, but it is only an issue in “pure coherent systems” because of the large pulse separation.

**To identify wrapping:**

If you are lucky, the velocities are fairly strong so the wraps go from a positive velocity to a negative velocity and are quite obvious. A simple sign filter (i.e. positive velocity expected, wrapped points have a negative sign) will work fairly efficiently to identify wrapped points.

For smaller velocities, it is a bit harder to identify wrapped points by sign alone. Playing with various forms of local median filters to identify wrapped points has varying degrees of success, dependent largely on the quality of the dataset. Histograms are actually extremely useful for this type of work. Often the ambiguity velocity causes the tail of a histogram to be cut off and shifted to the wrong side of the histogram (so a sign filter would probably work wonders here), meaning that it is fairly easy to pick out wrapped velocities visually. This is at least a good way to check the success of any identification scheme developed.

**To unwrap the data:**

It is, in principle, possible to unwrap data when you can make assumptions about du/dt, but only if the SNR and correlation are good. There are two ways to go about dealing with your present data. 1. Develop an outlier filter to remove the wrapped data. If there are only a few points (some small percentage of the total data) it’s relatively simple to define a cutoff threshold outside of which you discard the velocity data. If needed, you can interpolate these removed points back in as long as the gaps created by removing them are not too large. The advantage of this is that it is relatively simple and quick, and the impact on statistics is going to be fairly minimal because so few points are involved. 2. If the number of wrapped points is fairly high, the above is problematic because the variance of the signal is artificially constrained by the phase wrapping (i.e. the largest events are being eliminated from sampling). In this case the data either needs to be corrected or retaken. For a field deployment this generally means correction. Below are the recommended steps for going about doing this.

**Step 1** in ambiguity correction is to get the data back into beam coordinates. Search for “Coordinate Transformation” in our FAQ database to find an explanation on how to do this, or consult our Practical Primer for Pulse-Coherent Instruments available under Documents.

**Step 2** is to find the Ambiguity Velocity. Ambiguity Velocity (the velocity corresponding to pi, denoted V_amb) is the maximum beam velocity that can be measured by the instrument in its deployed configuration. This is set by the Nominal Velocity Range in the configuration window of the software. There are two ways of finding this velocity:

- A simple estimate of V_amb is the average of the absolute values of the maximum and minimum measured velocities.
- A more accurate expression is V_amb = c / ( 4 * f * timeLagInSeconds ), where c is the speed of sound, f is the instrument frequency and timeLagInSeconds is pulled from the configuration information in the *.HDR file. (This formula is the standard Pulse-Coherent maximum velocity calculation. Search for “lag” in our FAQ database to read more about this topic.)

**Step 3** is to remove the V_amb. The procedure is as follows:

`loop over all the data points`

*If large jump in velocity, then*

*if the jump is negative, then*

*newvel = oldvel + 2*Vamb*

*else*

newvel = oldvel - 2*Vamb

newvel = oldvel - 2*Vamb

*end*

*end*

*end loop*

**Step 4** is to transform the velocities back to XYZ or ENU.

A few words of caution: It’s generally best to avoid phase wrapping issues as the time spent correcting them is often fairly significant (and the process is sometimes frustrating). The most difficult task is identifying the points that are wrapped and automating that process. The correction is fairly simple once the points are identified, however.

## Comments

0 comments

Please sign in to leave a comment.