cutcutcodec.core.signal.window.alpha_to_band

cutcutcodec.core.signal.window.alpha_to_band(alpha: Real) float[source]

Empirical estimation based on regression.

The fitted model is \(band = a*\alpha^2 + b*\alpha + c + d*tanh(e*\alpha)\).

This function is strictly increasing.

Bijection of band_to_alpha().

Examples

>>> import torch
>>> from cutcutcodec.core.signal.window import alpha_to_band, find_win_law
>>> alphas, _, bands = find_win_law()
>>> pred = [alpha_to_band(a) for a in alphas.tolist()]
>>> # import matplotlib.pyplot as plt
>>> # _ = plt.plot(alphas.numpy(force=True), bands.numpy(force=True))
>>> # _ = plt.plot(alphas.numpy(force=True), pred)
>>> # plt.show()
>>>