Technology / Technical guide

Yaw Angle Wrapping, Unwrapping & Circular Means

A wrapped angle locates a direction on a circle, while an unwrapped angle describes a chosen continuous branch through a sequence. Circular averaging answers a third question: the central direction of defined angular observations. None of these operations automatically reconstructs unobserved full turns or establishes physical yaw motion.

A direction and a continuous travel history differ.

Keep the coordinate convention, sequence assumptions and averaging quantity visible before interpreting an angular number.

01 / Wrapped direction

Adding a full turn leaves the direction unchanged.

For a degree representation with period 360°, directions differing by any integer multiple of 360° occupy the same circular position.

For a degree representation with period 360°, directions differing by any integer multiple of 360° occupy the same circular position. A wrapped interval such as 0° to just below 360° chooses one representative for each position.

The coordinate guide identifies the physical frame and sign. Wrapping does not change an axis definition or convert wind-from direction into wind-to direction; those are different transformations.

02 / Sequence branch

A boundary jump can be a representation change.

Hypothetical ordered readings: 350°, 355°, 2° and 8°.

Hypothetical ordered readings: 350°, 355°, 2° and 8°. If the physical increments are known to follow the short forward changes, a continuous branch is 350°, 355°, 362° and 368°.

The large raw subtraction from 355° to 2° then represents the interval boundary rather than a 353° reverse movement. MathWorks describes phase unwrapping by adding period multiples; the chosen branch still needs an interpretation beyond the numerical adjustment.

03 / Increment limit

Unwrapping needs information about possible travel.

The same wrapped observations could include one or more unobserved full turns.

The same wrapped observations could include one or more unobserved full turns. Selecting nearest consecutive differences is only justified by an appropriate increment assumption, such as true changes strictly below half a turn with adequate error margin.

An exact half-turn difference is ambiguous in sign, and noise or gaps can defeat the chosen branch. Unwrapping therefore does not prove motor travel, cable twist or encoder history. Sequence order matters, whereas a simple direction average answers a different question.

04 / Circular mean

Average direction vectors rather than degree labels.

For nonnegative weights summing to one, form C = Σw_i cosθ_i and S = Σw_i sinθ_i using a consistent angular unit.

For nonnegative weights summing to one, form C = Σw_i cosθ_i and S = Σw_i sinθ_i using a consistent angular unit. When the resultant is nonzero, atan2(S,C) defines a central circular direction in the selected frame.

For hypothetical equal directions 358° and 2°, symmetry gives S = 0 and positive C, so the central direction is 0°, not the arithmetic label average 180°. This derives a direction statistic; it is not an actual wind-vector average.

05 / Resultant length

An average direction can become undefined.

R = √(C²+S²) lies between zero and one for those weights.

R = √(C²+S²) lies between zero and one for those weights. Exact opposing directions with equal weight cancel, giving R = 0 and no unique mean direction. A small disturbance near cancellation can change the indicated mean substantially.

That loss of a central direction is different from a motor fault or a missing sensor. Changing the weights also changes the statistic. Speed-weighted flow vectors, duration-weighted directions and equally weighted angle observations need not give the same result.

06 / Scope

Representation arithmetic does not establish yaw capability.

An unwrapped sequence retains a selected history branch; a circular mean compresses a set of directions and can lose sequence information.

An unwrapped sequence retains a selected history branch; a circular mean compresses a set of directions and can lose sequence information. Both require their stated inputs and assumptions rather than a universal conversion between heading and physical rotation.

No MARSTON unwrap algorithm, sensor period or permitted travel is assigned. The timing guide addresses a separate alignment issue; no angle correction, operating command or controller setting is provided here.

Related technical guides: Cross-Correlation: Lag Sign, Similarity & Time Delay · Ratiometric Sensing: Common Reference & Residual Errors · Dynamic States & Observability: What Outputs Can Reveal.

General background: MathWorks: Phase branches and period-multiple adjustments. These references explain industry concepts; they are separate from the applicable MARSTON product and project documents.

Key concepts and conditions.

Read each quantity with its reference, units and stated conditions. A general relation does not establish a model-specific value.

Concept / quantityMeaning / relationConditions / limits
Wrapped angleDirection representative modulo one turnFrame and interval convention are explicit.
Unwrapped branchSequence adjusted by period multiplesNeeds justified incremental-motion assumptions.
Circular meanatan2 of weighted sine/cosine sumsUndefined when the resultant is zero.
R√(C²+S²), dimensionlessMeasures vector concentration under the chosen weights.
WeightingNonnegative weights summing to oneChanging weights changes the reported statistic.

Engineering questions.

Does wrapping record how many turns occurred?

No. Full-turn counts are lost in the directional representative.

Can nearest-difference unwrapping recover every gap?

No. Unobserved travel can violate its increment assumptions.

Is a half-turn increment uniquely signed?

No. Additional information is needed to choose the branch.

Does every angle set have a unique circular mean?

No. A zero resultant leaves it undefined.

Is a circular direction mean a wind-vector mean?

Not automatically; the represented quantities and weighting differ.

Are the readings actual yaw motion?

No. They are hypothetical representation examples.

Technical enquiry

Discuss the technical question.

A wrapped angle locates a direction on a circle, while an unwrapped angle describes a chosen continuous branch through a sequence. Share the model and applicable operating or design information for an engineering discussion.