Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phase not unwrapped before group delay is calculated #71

Open
roseengineering opened this issue Oct 26, 2023 · 0 comments
Open

Phase not unwrapped before group delay is calculated #71

roseengineering opened this issue Oct 26, 2023 · 0 comments

Comments

@roseengineering
Copy link

roseengineering commented Oct 26, 2023

return vna_atan2f(i, r) / (2 * VNA_PI * deltaf);

To properly measure group delay, ie. -dph / (2 * pi * df), the phase must be "unwrapped" before this calculation is performed, otherwise for large phase shifts (but <180 deg) between points, the group delay calculation might be in error. For a non-dispersive DUT like a coaxial cable, highly accurate group delay measurements require a large frequency "aperture". For example to measure coax length, a df of .3 / delay is recommended. Unfortunately because of this non-unwrapping issue measurements could be wrong. See my measurement at https://twitter.com/gmagiros/status/1396204275089477636?s=20

The python code below show how to unwrap phase and then calculate the group delay between two points.

for n in range(1, len(ph)):  # where ph is the phases in radians
    dph = ph[n] - ph[n-1]
    if dph <= -np.pi: dph += 2 * np.pi
    if dph >= np.pi: dph -= 2 * np.pi
    df = f[n] - f[n-1]
    g[n-1] = -dph / (2 * np.pi * df)
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

No branches or pull requests

1 participant