Full Transform Functions¶
Object methods are documented in API Overview.
All four full functions select window="meyer" by default. Gaussian accepts
nu and support; WDM inverse methods pass their retained metadata automatically.
Bare coefficient arrays carry no metadata, so low-level inverse callers must
pass the matching originating configuration.
from_time_to_wdm ¶
from_time_to_wdm(data: Any, *, nt: int, nf: int, a: float, d: float, dt: float, backend: str | Backend | None = None, window: Literal['meyer', 'gaussian'] = 'meyer', nu: float | None = None, support: int | None = None) -> Any
Compute Wilson coefficients with Meyer or modified-Gaussian windows.
Gaussian nu defaults to 0.5 and support to min(16, nf) half-band
spacings. Its default a=1/3, d=1 values are ignored. Meyer rejects
explicit nu or support.
from_freq_to_wdm ¶
from_freq_to_wdm(data: Any, *, nt: int, nf: int, a: float, d: float, dt: float, backend: str | Backend | None = None, window: Literal['meyer', 'gaussian'] = 'meyer', nu: float | None = None, support: int | None = None) -> Any
Compute Wilson coefficients from full complex Fourier-domain samples.
The spectrum is projected to the Fourier transform of its real inverse.
Window options follow :func:from_time_to_wdm; an rFFT half-spectrum is
not a full Fourier grid.
from_wdm_to_time ¶
from_wdm_to_time(coeffs: Any, *, a: float, d: float, dt: float, backend: str | Backend | None = None, window: Literal['meyer', 'gaussian'] = 'meyer', nu: float | None = None, support: int | None = None) -> Any
Reconstruct a time-domain signal with the originating window settings.
Bare arrays carry no window metadata: the caller must supply the family
and Gaussian settings used for analysis. :class:WDM does this for you.
from_wdm_to_freq ¶
from_wdm_to_freq(coeffs: Any, *, dt: float, a: float, d: float, backend: str | Backend | None = None, window: Literal['meyer', 'gaussian'] = 'meyer', nu: float | None = None, support: int | None = None) -> Any
Reconstruct a full Fourier grid with the originating window settings.
Compact Subbands¶
The compact functions and aliases below support both window families. Meyer retains its existing span convention; Gaussian expands spans according to its finite frequency support. These APIs use a one-sided Fourier grid and treat omitted bins or coefficient channels as zero. Bare coefficient arrays carry no window metadata: pass the originating settings to inverse synthesis.
from_freq_to_wdm_subband ¶
from_freq_to_wdm_subband(data: Any, *, df: float, nfreqs_fourier: int, kmin: int, nfreqs_wdm: int, ntimes_wdm: int, a: float = 1.0 / 3.0, d: float = 1.0, backend: str | Backend | None = None, window: Literal['meyer', 'gaussian'] = 'meyer', nu: float | None = None, support: int | None = None) -> tuple[Any, int]
Compute the overlapping WDM sub-band from a compact Fourier span.
Use this when the input is already cropped in the one-sided Fourier domain. The function evaluates only the WDM frequency channels whose window support intersects the supplied Fourier span, rather than materializing the full WDM grid.
Parameters:
-
data(Any) –One-dimensional one-sided Fourier samples for the compact span
[kmin, kmin + len(data)). -
df(float) –Frequency spacing of the full one-sided Fourier grid.
-
nfreqs_fourier(int) –Number of samples in the full one-sided Fourier grid, including DC and Nyquist.
-
kmin(int) –Starting Fourier-bin index of
datain the full one-sided grid. -
nfreqs_wdm(int) –Number of positive WDM frequency intervals in the full transform. A full WDM coefficient grid has
nfreqs_wdm + 1frequency channels. -
ntimes_wdm(int) –Number of WDM time bins.
-
a(float, default:1.0 / 3.0) –Window roll-off parameter.
-
d(float, default:1.0) –Window order parameter.
-
backend(str | Backend | None, default:None) –Backend name or object. If omitted, the default backend is used.
-
window(Literal['meyer', 'gaussian'], default:'meyer') –Meyer (default) or orthogonalized modified Gaussian.
-
nu(float | None, default:None) –Gaussian shape parameter, default 0.5; omitted for Meyer.
-
support(int | None, default:None) –Gaussian half-band spacings retained on each side, default
min(16, nfreqs_wdm); omitted for Meyer.
Returns:
-
Any–A tuple
(coeffs, mmin).coeffshas shape -
int–(ntimes_wdm, nf_sub_wdm)and stores the touched WDM channels. -
tuple[Any, int]–mminis the first WDM frequency-channel index represented by -
tuple[Any, int]–coeffs[:, 0].
Notes
Fourier bins outside the supplied crop are zero. Retain window,
nu and support for the inverse; the returned array carries no
window metadata.
from_freq_to_wdm_band ¶
from_freq_to_wdm_band(data: Any, *, df: float, nfreqs_fourier: int, kmin: int, nfreqs_wdm: int, ntimes_wdm: int, mmin: int, nf_sub_wdm: int, a: float = 1.0 / 3.0, d: float = 1.0, backend: str | Backend | None = None, window: Literal['meyer', 'gaussian'] = 'meyer', nu: float | None = None, support: int | None = None) -> Any
Compute a requested WDM channel block from a compact Fourier span.
This is the study-facing variant of the subband API: it first computes the
minimal touched WDM span, then returns only the requested compact block
mmin : mmin + nf_sub_wdm. The requested block must lie inside the
touched span of the supplied Fourier support.
Parameters:
-
data(Any) –One-dimensional one-sided Fourier samples for the compact span
[kmin, kmin + len(data)). -
df(float) –Frequency spacing of the full one-sided Fourier grid.
-
nfreqs_fourier(int) –Number of samples in the full one-sided Fourier grid, including DC and Nyquist.
-
kmin(int) –Starting Fourier-bin index of
datain the full one-sided grid. -
nfreqs_wdm(int) –Number of positive WDM frequency intervals in the full transform. A full WDM coefficient grid has
nfreqs_wdm + 1frequency channels. -
ntimes_wdm(int) –Number of WDM time bins.
-
mmin(int) –First WDM frequency-channel index to return.
-
nf_sub_wdm(int) –Number of WDM frequency channels to return.
-
a(float, default:1.0 / 3.0) –Window roll-off parameter.
-
d(float, default:1.0) –Window order parameter.
-
backend(str | Backend | None, default:None) –Backend name or object. If omitted, the default backend is used.
-
window(Literal['meyer', 'gaussian'], default:'meyer') –Meyer (default) or orthogonalized modified Gaussian.
-
nu(float | None, default:None) –Gaussian shape parameter, default 0.5; omitted for Meyer.
-
support(int | None, default:None) –Gaussian support, default
min(16, nfreqs_wdm).
Returns:
-
Any–The requested coefficient block with shape
-
Any–(ntimes_wdm, nf_sub_wdm).
from_wdm_to_freq_subband ¶
from_wdm_to_freq_subband(coeffs: Any, *, df: float, nfreqs_fourier: int, mmin: int, nfreqs_wdm: int, ntimes_wdm: int, a: float = 1.0 / 3.0, d: float = 1.0, backend: str | Backend | None = None, window: Literal['meyer', 'gaussian'] = 'meyer', nu: float | None = None, support: int | None = None) -> tuple[Any, int]
Reconstruct the touched Fourier span from a compact WDM block.
This is the inverse of the compact sub-band transform. It expands a block of adjacent WDM frequency channels into the one-sided Fourier bins touched by those channels' window support.
Parameters:
-
coeffs(Any) –Two-dimensional WDM coefficient block with shape
(ntimes_wdm, nf_sub_wdm). -
df(float) –Frequency spacing of the full one-sided Fourier grid.
-
nfreqs_fourier(int) –Number of samples in the full one-sided Fourier grid, including DC and Nyquist.
-
mmin(int) –First WDM frequency-channel index represented by
coeffs[:, 0]. -
nfreqs_wdm(int) –Number of positive WDM frequency intervals in the full transform. A full WDM coefficient grid has
nfreqs_wdm + 1frequency channels. -
ntimes_wdm(int) –Number of WDM time bins.
-
a(float, default:1.0 / 3.0) –Window roll-off parameter.
-
d(float, default:1.0) –Window order parameter.
-
backend(str | Backend | None, default:None) –Backend name or object. If omitted, the default backend is used.
-
window(Literal['meyer', 'gaussian'], default:'meyer') –Window family used for the supplied coefficients.
-
nu(float | None, default:None) –Originating Gaussian shape parameter, default 0.5.
-
support(int | None, default:None) –Originating Gaussian support, default
min(16, nfreqs_wdm).
Returns:
-
Any–A tuple
(spectrum, kmin).spectrumcontains the reconstructed -
int–one-sided Fourier span, and
kminis the starting Fourier-bin index -
tuple[Any, int]–of
spectrum[0]in the full one-sided grid.
Notes
WDM channels outside the supplied block are zero. Supply the same
window, nu and support used to create the coefficients.
wdm_span_from_fourier_span ¶
wdm_span_from_fourier_span(*, nfreqs_fourier: int, nfreqs_wdm: int, ntimes_wdm: int, kmin: int, lendata: int, window: str = 'meyer', nu: float | None = None, support: int | None = None) -> tuple[int, int]
Map a compact one-sided Fourier span onto the touched WDM channels.
Parameters:
-
nfreqs_fourier(int) –Number of samples in the full one-sided Fourier grid, including DC and Nyquist.
-
nfreqs_wdm(int) –Number of positive WDM frequency intervals in the full transform. A full WDM coefficient grid has
nfreqs_wdm + 1frequency channels. -
ntimes_wdm(int) –Number of WDM time bins.
-
kmin(int) –Starting Fourier-bin index of the compact Fourier span.
-
lendata(int) –Number of Fourier bins in the compact span.
-
window(str, default:'meyer') –Meyer or modified Gaussian; default Meyer preserves historical spans.
-
nu(float | None, default:None) –Gaussian shape parameter; it does not alter the geometric tap span.
-
support(int | None, default:None) –Gaussian spectral support in channel spacings on either side.
Returns:
-
int–A tuple
(mmin, nf_sub_wdm).mminis the first touched WDM -
int–frequency-channel index, and
nf_sub_wdmis the number of adjacent -
tuple[int, int]–WDM channels touched by the Fourier span.
fourier_span_from_wdm_span ¶
fourier_span_from_wdm_span(*, nfreqs_fourier: int, nfreqs_wdm: int, ntimes_wdm: int, mmin: int, nf_sub_wdm: int, window: str = 'meyer', nu: float | None = None, support: int | None = None) -> tuple[int, int]
Map a compact WDM channel span onto the touched one-sided Fourier bins.
Parameters:
-
nfreqs_fourier(int) –Number of samples in the full one-sided Fourier grid, including DC and Nyquist.
-
nfreqs_wdm(int) –Number of positive WDM frequency intervals in the full transform. A full WDM coefficient grid has
nfreqs_wdm + 1frequency channels. -
ntimes_wdm(int) –Number of WDM time bins.
-
mmin(int) –First WDM frequency-channel index in the compact WDM span.
-
nf_sub_wdm(int) –Number of adjacent WDM frequency channels in the compact span.
-
window(str, default:'meyer') –Meyer or modified Gaussian; default Meyer preserves historical spans.
-
nu(float | None, default:None) –Gaussian shape parameter; it does not alter the geometric tap span.
-
support(int | None, default:None) –Gaussian spectral support in channel spacings on either side.
Returns:
-
int–A tuple
(kmin, lendata).kminis the first touched one-sided -
int–Fourier-bin index, and
lendatais the number of touched Fourier -
tuple[int, int]–bins.