MathUtils.FftUtils#
MathUtils/FftUtils.py
- compute_standard_wCD(N)#
- class FftInvPdf(cf)#
Bases:
objectNumerically invert a characteristic function (CF) to obtain a PDF via FFT.
The FFT operates on a fixed integer grid
[0, N](defaultN=1024). The input time array passed to__call__must therefore be pre-scaled so that the peak of the PDF falls within roughly[10, 100]on that grid.Typical usage in a model wrapper:
_impl = FftInvPdf(my_cf) def my_pdf(x, ..., timescale=None): # Rule of thumb: map the peak position t_peak to ~80 on the grid. if timescale is None: timescale = 80.0 / t_peak ts = timescale return ts * _impl(ts * x, ...) # inverse-scale the amplitude
The caller is responsible for both the forward scaling (
ts * x) and the inverse-amplitude scaling (ts * result) so that the returned values form a proper PDF integrating to 1 over the original (unscaled) time axis.