phase

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package phase holds the small phase-domain helpers the rotation analyses use — the native Go equivalents of numpy.unwrap and the per-symbol differential phase that makes a π/4-DQPSK constellation's rotation visible. They are stdlib-only and operate on plain float64 / complex128 slices.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diff

func Diff(z []complex128) []float64

Diff returns the per-sample differential phase angle(z[i]·conj(z[i-1])) in (-π, π] — the rotation between consecutive samples, i.e. the π/4-DQPSK rotation signal. The output has length len(z)-1; it is nil when z has fewer than two samples.

func FromComplex

func FromComplex(z []complex128) []float64

FromComplex returns the wrapped instantaneous phase (atan2(Im, Re), in (-π, π]) of each sample in z. Returns a new slice.

func Unwrap

func Unwrap(p []float64) []float64

Unwrap removes 2π discontinuities from a sequence of phase angles in radians, matching numpy.unwrap with the default discontinuity of π: wherever the step between consecutive samples exceeds π in magnitude, a multiple of 2π is added to bring it back into (-π, π]. The first sample is left untouched. Returns a new slice; the input is not modified.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL