Skip to content

Wrap ofdmframesync phase error with 2*pi, not 2/pi - #468

Open
Wahaj18 wants to merge 1 commit into
jgaeddert:masterfrom
Wahaj18:fix-459-ofdmframesync-phase-wrap
Open

Wahaj18 wants to merge 1 commit into
jgaeddert:masterfrom
Wahaj18:fix-459-ofdmframesync-phase-wrap

Conversation

@Wahaj18

@Wahaj18 Wahaj18 commented Oct 9, 2026

Copy link
Copy Markdown

Summary

ofdmframesync wraps the differential phase error with M_2_PI. In <math.h>, M_2_PI is 2/pi (~0.637), not 2*pi. That means large phase steps are barely reduced and stay outside the intended [-pi, pi] range. Elsewhere in liquid-dsp (and in the unwrap autotests) the wrap correctly uses 2*M_PI.

This change matches that convention.

Fixes #459

Test plan

  • make check — 1349 tests / 0 failures (includes ofdmframesync_acquire_*, ofdmframesync_config, ofdmflexframe_*)

M_2_PI from math.h is 2/pi (~0.637), not 2*pi. Using it when wrapping
the differential phase into [-pi, pi] barely moves the value, so large
phase steps stay mis-wrapped. The rest of liquid-dsp (and the unwrap
autotests) already use 2*M_PI for this.

Fixes jgaeddert#459
@seonlee2013

seonlee2013 commented Oct 9, 2026 via email

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ofdmframesync wraps NCO phase error at pi/2, not 2*pi

2 participants